Pārlūkot izejas kodu

Works with the normal ctx_size malloc

dettanym 6 gadi atpakaļ
vecāks
revīzija
0f738fb8c2
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      sdk/tlibcrypto/ipp/sgx_ecc256.cpp

+ 3 - 3
sdk/tlibcrypto/ipp/sgx_ecc256.cpp

@@ -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