node-secureworker
node-secureworker copied to clipboard
Port changes to original duktape source
Currently, this code is modified from the release tarball. We should also wrap code changes in a new config flag or something.
Some notes:
duktape-dist
- SGX include dirs,
/NODEFAULTLIB- Compile for SGX platform. -
DUK_OPT_NO_FILE_IO- File I/O is not available in enclave. -
DUK_OPT_CPP_EXCEPTIONS- The SGX SDK doesn't supportsetjmp. -
DUK_OPT_NO_JX- The SGX SDK doesn't supportsscanf, which JX needs. -
/TP- Compile as C++ because we need C++ exceptions.
Code changes (duktape-dist)
-
DUK_SNPRINTFin duk_bi_date.c - The SGX SDK doesn't supportsprintf(without the "n"). ProvideDUK_BI_DATE_ISO8601_BUFSIZE. -
duk_bi_date_get_*_sgx- Stubbed out routines for getting the time and locale information from the OS. Consider using SGX's Trusted Time system to implement this for real. - Don't include
<windows.h>- We're not running on Windows. - Don't include
<setjmp.h>- The SGX SDK doesn't have this file. - Use unprefixed
snprintfandvsnprintf- That's what the SGX SDK provides. - Remove
duk_fileandDUK_STD*- The SGX SDK doesn't provide the underlyingFILEandstd*.