简体   繁体   English

为什么我们在 DH 安全 session 建立中需要发起者或响应者的飞地身份?

[英]Why we need the enclave identity of initiator or responder in DH secure session establishment?

I'm developing a sgx application using sgx_dh API.我正在使用 sgx_dh API 开发一个 sgx 应用程序。 The workflow can be summarized as follows (two roles here are dh_initiator, dh_i in short, and dh_responder, ie, dh_r.):工作流程可以总结如下(这里的两个角色分别是dh_initiator,简称dh_i,以及dh_responder,即dh_r。):

step0: Initiate session in dh_i and dh_r side; step0:在dh_i和dh_r端启动session;

step1: dh_r generates msg1 contains g_a and sends msg1 to dh_i; step1:dh_r生成包含g_a的msg1并将msg1发送给dh_i;

step2: dh_i processes msg1 and generates msg2 containing g_b, and sends msg2 to dh_r; step2:dh_i处理msg1,生成包含g_b的msg2,并将msg2发送给dh_r;

step3: dh_r processes msg2 and genertaes msg3 including affirm of the sharing key, and then sends msg3 to dh_i; step3:dh_r处理msg2并生成msg3,包括对共享密钥的确认,然后将msg3发送给dh_i;

step4: dh_i processes msg3. step4:dh_i 处理 msg3。 DH key exchange has done. DH 密钥交换完成。

In step3, the dh_r will output a sgx_dh_session_enclave_identity_t type variable, and so as to dh_i in step4 that outputs a variable in the same type.在step3中,dh_r将output一个sgx_dh_session_enclave_identity_t type的变量,以便dh_i在step4中输出一个相同类型的变量。 According to the SGX Developer Reference, the two variables are used in dh session establishment.根据 SGX Developer Reference,这两个变量用于 dh session 建立。

But I cannot figure out where they will BE USED since they are generated when the key exchange and enclave authentication has done.但我无法弄清楚它们将在哪里使用,因为它们是在密钥交换和飞地身份验证完成时生成的。

Any suggestion or hint is appreciated, and if any misunderstanding here, please correct me kindly.任何建议或提示表示赞赏,如果在这里有任何误解,请纠正我。 Thanks so much~非常感谢~

These two variables are provided to explicit the values you should verify to ensure you're communicating with the correct enclaves (you may check how they are used in the LocalAttestation sample: https://github.com/intel/linux-sgx/blob/62b116c502b09b125db9acc965694d3ecff8e698/SampleCode/LocalAttestation/EnclaveInitiator/EnclaveMessageExchange.cpp#L133-L144 ).提供这两个变量是为了明确您应该验证的值,以确保您与正确的 enclave 进行通信(您可以检查它们在 LocalAttestation 示例中的使用方式: https://github.com/intel/linux-sgx/blob /62b116c502b09b125db9acc965694d3ecff8e698/SampleCode/LocalAttestation/EnclaveInitiator/EnclaveMessageExchange.cpp#L133-L144 )。

They are not here to be passed to other functions of the dh exchange protocol provided by the sdk, you should process them "manually" and define your own acceptation policy before relying on the secure channel established.它们不会在这里传递给 sdk 提供的 dh 交换协议的其他功能,您应该“手动”处理它们并定义自己的接受策略,然后再依赖建立的安全通道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM