Skip to content

Commit 2a602c8

Browse files
committed
Support OpenSSL 1.1.1b on Windows.
Add _onexit() API.
1 parent cb1d235 commit 2a602c8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Windows/sgx/libsgx_tsgxssl/tstdlib.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ void __imp_RtlVirtualUnwind()
122122
}
123123
#endif
124124

125+
typedef int (__cdecl* _onexit_t)(void);
126+
127+
_onexit_t sgxssl__onexit(
128+
_onexit_t function
129+
)
130+
{
131+
//_onexit returns a pointer to the function if successful or NULL if there is no space to store the function pointer.
132+
//This function call could be skipped in enclave since EPC memory will be recycled when destroying an enclave.
133+
//
134+
return function;
135+
}
125136

126137

127138
} // extern "C"

openssl_source/bypass_to_sgxssl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
/*stdlib.h*/
7676
#define _exit sgxssl__exit
7777
#define getenv sgxssl_getenv
78+
#define _onexit sgxssl__onexit
7879

7980
/*string.h*/
8081
#define strerror_s sgxssl_strerror_s

0 commit comments

Comments
 (0)