Parcourir la source

Works with the normal ctx_size malloc

dettanym il y a 6 ans
Parent
commit
0f738fb8c2
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  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