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; }
bool ecall_destroy_session(){ sgx_status_t ret = sgx_close_pse_session(); if(ret == SGX_SUCCESS){ return true; } return false; }
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; } ret = sgx_ra_init(&g_sp_pub_key, b_pse, p_context); if(b_pse) { sgx_close_pse_session(); return ret; } return ret; }