소스 검색

Works with the normal ctx_size malloc

dettanym 6 년 전
부모
커밋
0f738fb8c2
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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