Zondax / hello-rustee

Apache License 2.0
0 stars 2 forks source link

TA not found or Security errors #3

Closed jleni closed 4 years ago

jleni commented 4 years ago

There are no execution issues in QEMU, however, in the case of:

When executing the host, we receive:

hello_rustee: TEEC_Opensession failed. [Code 0xffff0008 origin 0x3]

0xffff0008 corresponds to TEEC_ERROR_ITEM_NOT_FOUND.

If we try to install the TA in secure storage ( according to Link ) there is a security error:

root@stm32mp1:~# xtest --install-ta /lib/optee_armtz/8d22f026-eb0a-4401-b575-5cf59327119b.ta 
Installing "/lib/optee_armtz/8d22f026-eb0a-4401-b575-5cf59327119b.ta"
xtest: install_ta: TEEC_InvokeCommand: 0xffff000f err_origin 0x4

0xffff000f corresponds to TEEC_ERROR_SECURITY

Improved error messages (mapping from codes to errors) is planned as part of https://github.com/Zondax/hello-rustee/issues/1

jleni commented 4 years ago

In order to reproduce:

  1. run make install_device. We expect the device to be addressable as stm32mp1 (this should happen automatically if your DHCP server is configured properly. Otherwise change the makefile or your hosts file)
  2. in the device, run /home/root/hello_rustee
jleni commented 4 years ago

Adding a bit more info after enabling additional logging in the image:

D/TC:? 0 tee_ta_init_pseudo_ta_session:273 Lookup pseudo TA 8d22f026-eb0a-4401-b575-5cf59327119b
D/TC:? 0 load_elf:842 Lookup user TA ELF 8d22f026-eb0a-4401-b575-5cf59327119b (Secure Storage TA)
D/TC:? 0 load_elf:842 Lookup user TA ELF 8d22f026-eb0a-4401-b575-5cf59327119b (REE)
D/TC:? 0 load_elf:847 res=0xffff000f
D/TC:? 0 tee_ta_open_session:540 init session failed 0xffff0008