Develop programs for Arm trust zone

2019-01-22 16:06发布

How can I develop applications that use Arm's trust zone? Specifically, I want to develop a program that can save sensitive data in the secure world.

Should this program run in the normal world or the secure world? I know there are trustlets in the secure world, do I need to develop trustlets? Are there SDK or API that I can use to directly interact with an existing secure world os or do I need to compile and install my own secure os?

Any advice will be greatly appreciated.

Thank you!

4条回答
Ridiculous、
2楼-- · 2019-01-22 16:38

The better way is install a REE OS and a TEE OS in one device. When a program wants to do some sensitive things, the device will change to TEE OS, so you can deal with sensitive date securely. When you have done with sensitvie date, device will change to REE OS. But implementing two OS switch on a device is a tough work.

查看更多
爷的心禁止访问
3楼-- · 2019-01-22 16:43

Operating Systems such as MobiCore already exist and have been deployed on mass market devices such as Samsung Galaxy S3.

MobiCore is an OS that runs alongside Android, so trustlets (= MobiCore apps) can communicate with Android apps via a set of system calls to the MobiCore driver, which is the part of the Android OS in charge of communicating with the trusted execution enviromnent.

If you are looking to develop trustlets for MobiCore as explained above, you must become a MobiCore developer, which you could theoretically do by signing up as a developer for MobiCore's Trustonic venture.

If you wish to use ARM's TrustZone technology on your own device / dev board with an open-source secure OS, perhaps you can use OpenVirtualization's SierraTEE, which seems to be compiled for Xilinx Zynq-7000 AP SOC and also compatible with Android as the rich OS.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-01-22 16:49

You can use OPTEE(Open Sourec Portable Trusted Execution environment) OS. If you are looking for trusted execution environment application examples, which are also know Trusted Applications(TA), then you can check this optee trusted applications examples repository and this TA using OP-TEE and Comcast Crypto API.

  • Optee os provides following APIs for writing Trusted Applications:
    • Secure Storage APIs for secure storage
    • Cryptographic Operations APIs for encryptiion, decryption of secure credentials and data
    • Secure Element API which help in hosting applications or applets on tamper-resistant platform
    • Time APIs
    • Arithmetical APIs For client side or normal world optee provides:
  • Tee client side Apis

You can refer documentation here.

查看更多
The star\"
5楼-- · 2019-01-22 16:56

There are two extremes. These are documented in the Software overview chapter of ARMs Security Technology: Building a Secure System using TrustZone Technology.

APIs

At the one end of the spectrum, there is only a set of APIs which can be called from the normal world. This is detailed in the SMC calls for Linux. For instance, if the device contains a public-private key, an API call could sign data. The normal world would never have access to the private key, but anyone can verify that the device is original by verifying the signature. So the normal world is free to forward this request over any communications interface. This maybe part of authenticating a device.

Co-operative OSs

In this mode, there is a full blown OS in both the secure and normal world (called TEE and REE elsewhere). The OSs must co-operate with interrupts and scheduling. They may also use SMC calls, lock free algorithms and semaphores along with shared memory.

ARM recommends using the FIQ for the secure world and to leave the IRQ for the normal world. Specifically, there are settings to stop the normal world from masking the FIQ ever. All of these issue rely on the type of IPC, scheduling, interrupt response, etc that the system needs.

The simplest Secure scheduler would always pre-empt the normal world. Only the idle task would yield the CPU to the normal world. A more flexible solution would have the schedulers co-operate so that both worlds can have higher and lower priority tasks.

查看更多
登录 后发表回答