Merge pull request #997 from NickolasLapp/master

Updates to Linux-SGX README, and disable automatic include of
This commit is contained in:
JacobBarthelmeh 2017-06-30 11:48:12 -06:00 committed by GitHub
commit a3375ef961
2 changed files with 21 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# Static Library: Building libwolfssl.sgx.static.lib.a for use with SGX Enclaves # Static Library: Building libwolfssl.sgx.static.lib.a for use with SGX Enclaves
### Requirements: ### Requirements:
This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necesary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familure with simiulation software being used in place of hardware. This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necesary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familure with simulation software being used in place of hardware.
### Overview and Build: ### Overview and Build:
This project creates a static library to then link with Enclaves. A simple example of an Enclave linking to the created wolfSSL library can be found in wolfssl-examples on github. This project has been tested with gcc 5.4.0 on Ubuntu 16.04. This project creates a static library to then link with Enclaves. A simple example of an Enclave linking to the created wolfSSL library can be found in wolfssl-examples on github. This project has been tested with gcc 5.4.0 on Ubuntu 16.04.
@ -12,6 +12,14 @@ To create the static library, simply call make:
This will create a local static library, libwolfssl.sgx.static.lib.a, that can be linked with SGX enclaves to access wolfSSL APIs using SGX hardware. This will create a local static library, libwolfssl.sgx.static.lib.a, that can be linked with SGX enclaves to access wolfSSL APIs using SGX hardware.
Limitations: ### Customization:
To enable wolfssl debug, add CFLAGS=-DDEBUG_WOLFSSL.
To enable wolfssl benchmark tests with enclave, specify: HAVE_WOLFSSL_BENCHMARK at build
To enable wolfcrypt testsuite with enclave, specify: HAVE_WOLFSSL_TEST at build
For example, to enable all three:
`make -f sgx_t_static.mk CFLAGS=-DDEBUG_WOLFSSL HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1`
### Limitations:
Single Threaded (multiple threaded applications have not been tested) Single Threaded (multiple threaded applications have not been tested)
AES-NI use with SGX has not been added in yet AES-NI use with SGX has not been added in yet

View File

@ -90,15 +90,22 @@ Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/src/tls.c\ $(WOLFSSL_ROOT)/src/tls.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.c\ $(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.c\ $(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.c\
$(WOLFSSL_ROOT)/wolfcrypt/test/test.c\
$(WOLFSSL_ROOT)/wolfcrypt/benchmark/benchmark.c
Wolfssl_Include_Paths := -I$(WOLFSSL_ROOT)/ \ Wolfssl_Include_Paths := -I$(WOLFSSL_ROOT)/ \
-I$(WOLFSSL_ROOT)/wolfcrypt/ \ -I$(WOLFSSL_ROOT)/wolfcrypt/ \
-I$(WOLFSSL_ROOT)/wolfcrypt/test/ \
-I$(WOLFSSL_ROOT)/wolfcrypt/benchmark/ \
-I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
ifeq ($(HAVE_WOLFSSL_TEST), 1)
Wolfssl_Include_Paths += -I$(WOLFSSL_ROOT)/wolfcrypt/test
Wolfssl_C_Files += $(WOLFSSL_ROOT)/wolfcrypt/test/test.c
endif
ifeq ($(HAVE_WOLFSSL_BENCHMARK), 1)
Wolfssl_C_Files += $(WOLFSSL_ROOT)/wolfcrypt/benchmark/benchmark.c
Wolfssl_Include_Paths += -I$(WOLFSSL_ROOT)/wolfcrypt/benchmark/
endif
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11 Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Wolfssl_Include_Paths) -fno-builtin-printf -I. Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Wolfssl_Include_Paths) -fno-builtin-printf -I.