sgx_status_t enclave_init_ra( int b_pse, sgx_ra_context_t *p_context) { // isv enclave call to trusted key exchange library. sgx_status_t ret; if(b_pse) { int busy_retry_times = 2; do{ ret = sgx_create_pse_session(); }while (ret == SGX_ERROR_BUSY && busy_retry_times--); if (ret != SGX_SUCCESS) return ret; } #ifdef SUPPLIED_KEY_DERIVATION ret = sgx_ra_init_ex(&g_sp_pub_key, b_pse, key_derivation, p_context); #else ret = sgx_ra_init(&g_sp_pub_key, b_pse, p_context); #endif if(b_pse) { sgx_close_pse_session(); return ret; } return ret; }
// TKE interface for isv enclaves sgx_status_t sgx_ra_init( const sgx_ec256_public_t *p_pub_key, int b_pse, sgx_ra_context_t *p_context) { return sgx_ra_init_ex(p_pub_key, b_pse, NULL, p_context); }