这里以optee_examples中的hello_world为例,该例是实现整数加一操作。
1、 CA 需要与 OPTEE OS 之间建立一个 Context(InitializeContext),以后此 CA 与 TEE 环境的所有通信均基于此 Context来实现的;
1、 CA 需要与 OPTEE OS 之间建立一个 Context(InitializeContext),以后此 CA 与 TEE 环境的所有通信均基于此 Context来实现的;
/* Initialize a context connecting us to the TEE */
res = TEEC_InitializeContext(NULL, &ctx);
if (res != TEEC_SUCCESS)
errx(1, "TEEC_InitializeContext failed with code 0x%x", res);
2、 CA 会向 OPTEE OS 申请与请求的 TA 建立一个 Session(OpenSession);
/*
* Open a session to the "hello world" TA, the TA will print "hello
* world!" in the log when the session is created.
*/
res = TEEC_OpenSession(&ctx, &sess, &uuid,
TEEC_LOGIN_PUBLIC, NULL, NULL, &err_origin);
if (res != TEEC_SUCCESS)
errx(1, "TEEC_Opensession failed with code 0x%x origin 0x%x",
res, err_origin);

最低0.47元/天 解锁文章
1554

被折叠的 条评论
为什么被折叠?



