apache / incubator-teaclave-trustzone-sdk

Teaclave TrustZone SDK enables safe, functional, and ergonomic development of trustlets.
https://teaclave.apache.org
Apache License 2.0
203 stars 58 forks source link

Question: returning data from the TA #97

Closed HakonToemte closed 1 year ago

HakonToemte commented 1 year ago

Hello.

I am trying to instantiate a struct, App, in the TA and return it to the CA. I've been using the rust examples as guidance and it seems that accessing data from the TA is done via the Operation parameters. From my understanding these parameters can only be of type ParamTmpRef or ParamValue. So bytes or u32. Can i then only access values from the TA in the form of bytes or u32?

Is it not possible to return directly from invoke_command? In my approach below invoke_command returns an empty Result<()>. CA: image TA: image

It might be obvious to you that it's my first time working with a TEE, so I can suffer from misconceptions :)

Thankful for any help!