|
@@ -52,10 +52,10 @@ sgx_status_t sgx_ecc256_open_context(__attribute__((unused))sgx_ecc_state_handle
|
|
|
ipp_ret = ippsECCPGetSize(256, &ctx_size);
|
|
|
if (ipp_ret != ippStsNoErr)
|
|
|
return SGX_ERROR_UNEXPECTED;
|
|
|
- p_ecc_state = (IppsECCPState*)(malloc(5));
|
|
|
+ p_ecc_state = (IppsECCPState*)(malloc(ctx_size));
|
|
|
if (p_ecc_state == NULL)
|
|
|
return SGX_ERROR_OUT_OF_MEMORY;
|
|
|
-/* ipp_ret = ippsECCPInit(256, p_ecc_state);
|
|
|
+ ipp_ret = ippsECCPInit(256, p_ecc_state);
|
|
|
if (ipp_ret != ippStsNoErr)
|
|
|
{
|
|
|
SAFE_FREE(p_ecc_state);
|
|
@@ -70,7 +70,7 @@ sgx_status_t sgx_ecc256_open_context(__attribute__((unused))sgx_ecc_state_handle
|
|
|
return SGX_ERROR_UNEXPECTED;
|
|
|
}
|
|
|
*p_ecc_handle = p_ecc_state;
|
|
|
-*/ return SGX_SUCCESS;
|
|
|
+ return SGX_SUCCESS;
|
|
|
}
|
|
|
|
|
|
/* Cleans up ecc context
|