Parcourir la source

It works with malloc 5 and I redirected it to use the original malloc by removing the malloc.o in the libsgx_tstdc archive

dettanym il y a 6 ans
Parent
commit
2111b046d8
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 1 0
      sdk/tlibc/Makefile
  2. 3 3
      sdk/tlibcrypto/ipp/sgx_ecc256.cpp

+ 1 - 0
sdk/tlibc/Makefile

@@ -50,6 +50,7 @@ LIBC_C_SRCS := $(wildcard gen/*.c gdtoa/*.c locale/*.c math/*.c stdlib/*.c strin
 else
 LIBC_C_SRCS := $(wildcard gen/*.c gdtoa/*.c locale/*.c stdlib/*.c string/*.c stdio/*.c time/*.c)
 endif
+LIBC_C_SRCS := $(filter-out stdlib/malloc.c,$(LIBC_C_SRCS))
 
 LIBC_CPP_SRCS := $(wildcard gen/*.cpp) tstdc_version.cpp
 LIBC_ASM_SRCS := $(wildcard gen/*.S)

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

@@ -42,7 +42,7 @@
 *   Output: sgx_ecc_state_handle_t *p_ecc_handle - Pointer to the handle of ECC crypto system  */
 sgx_status_t sgx_ecc256_open_context(__attribute__((unused))sgx_ecc_state_handle_t* p_ecc_handle)
 {
-/*    IppStatus ipp_ret = ippStsNoErr;
+    IppStatus ipp_ret = ippStsNoErr;
     IppsECCPState* p_ecc_state = NULL;
     // default use 256r1 parameter
     int ctx_size = 0;
@@ -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(10));
+    p_ecc_state = (IppsECCPState*)(malloc(5));
     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);