Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "openssl"]
path = openssl
url = https://github.com/openssl/openssl.git
10 changes: 2 additions & 8 deletions Linux/build_openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@
SGXSSL_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $SGXSSL_ROOT

OPENSSL_VERSION=`ls $SGXSSL_ROOT/../openssl_source/*1.1.1q.tar.gz | head -1 | grep -o '[^/]*$' | sed -s -- 's/\.tar\.gz//'`
if [ "$OPENSSL_VERSION" == "" ]
then
echo "In order to run this script, OpenSSL 1.1.1q tar.gz package must be located in openssl_source/ directory."
exit 1
fi
echo $OPENSSL_VERSION
OPENSSL_VERSION=openssl

#Create required directories
mkdir -p $SGXSSL_ROOT/package/include/openssl/
Expand All @@ -54,7 +48,7 @@ mkdir -p $SGXSSL_ROOT/package/lib64/
# build openssl modules, clean previous openssl dir if it exist
cd $SGXSSL_ROOT/../openssl_source || exit 1
rm -rf $OPENSSL_VERSION
tar xvf $OPENSSL_VERSION.tar.gz || exit 1
cp -r $SGXSSL_ROOT/../openssl . || exit 1

# Remove AESBS to support only AESNI and VPAES
sed -i '/BSAES_ASM/d' $OPENSSL_VERSION/Configure
Expand Down
2 changes: 1 addition & 1 deletion Linux/sgx/libsgx_tsgxssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ifeq ($(SGX_ARCH), x86)
else
SGX_COMMON_CFLAGS := -m64 -Wall
ifeq ($(LINUX_SGX_BUILD), 1)
include ../../../../../buildenv.mk
include ../../../../../../../buildenv.mk
SGX_EDGER8R := $(BUILD_DIR)/sgx_edger8r
SGX_SDK_INC := $(COMMON_DIR)/inc
LIBCXX_INC := $(LINUX_SDK_DIR)/tlibcxx/include
Expand Down
2 changes: 1 addition & 1 deletion Linux/sgx/libsgx_usgxssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ifeq ($(SGX_ARCH), x86)
else
SGX_COMMON_CFLAGS := -m64 -Wall
ifeq ($(LINUX_SGX_BUILD), 1)
include ../../../../../buildenv.mk
include ../../../../../../../buildenv.mk
SGX_EDGER8R := $(BUILD_DIR)/sgx_edger8r
SGX_SDK_INC := $(COMMON_DIR)/inc
else ifeq ($(LINUX_SGX_BUILD), 2)
Expand Down
2 changes: 1 addition & 1 deletion Linux/sgx/test_app/sgx_t.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ifeq ($(SGX_ARCH), x86)
else
SGX_COMMON_CFLAGS := -m64 -Wall
ifeq ($(LINUX_SGX_BUILD), 1)
include ../../../../../buildenv.mk
include ../../../../../../../buildenv.mk
SGX_LIBRARY_PATH := $(BUILD_DIR)
SGX_ENCLAVE_SIGNER := $(BUILD_DIR)/sgx_sign
SGX_EDGER8R := $(BUILD_DIR)/sgx_edger8r
Expand Down
2 changes: 1 addition & 1 deletion Linux/sgx/test_app/sgx_u.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ifeq ($(SGX_ARCH), x86)
else
SGX_COMMON_CFLAGS := -m64 -Wall
ifeq ($(LINUX_SGX_BUILD), 1)
include ../../../../../buildenv.mk
include ../../../../../../../buildenv.mk
SGX_LIBRARY_PATH := $(BUILD_DIR)
SGX_EDGER8R := $(BUILD_DIR)/sgx_edger8r
SGX_SDK_INC := $(COMMON_DIR)/inc
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Windows
(Note: Perl, NASM need to be included in machine's PATH variable)

To build Intel® SGX SSL package in Windows OS:
1. Download OpenSSL package into openssl_source/ directory. (tar.gz package, e.g. openssl-1.1.1q.tar.gz)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add steps to prepare the submodule code here as we remove the download step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

1. Download the source code and prepare the submodule
2. Download and install latest SGX SDK from [Intel Developer Zone](https://software.intel.com/en-us/sgx-sdk/download). You can find installation guide from the same website.
3. Change the directory to the SGXSSL path and enter the following command:
```
Expand All @@ -51,7 +51,7 @@ Linux
- Intel(R) SGX Linux latest release, including SDK, PSW, and driver

To build Intel® SGX SSL package in Linux OS:
1. Download OpenSSL 1.1.1q package into openssl_source/ directory. (tar.gz package, e.g. openssl-1.1.1q.tar.gz)
1. Download the source code and prepare the submodule
2. Download and install latest SGX SDK from [01.org](https://01.org/intel-software-guard-extensions/downloads). You can find installation guide in the same website.
3. Source SGX SDK's environment variables.
4. Cd to Linux/ directory and run:
Expand Down
14 changes: 3 additions & 11 deletions Windows/build_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ Rem

@echo off


set SGXSSL_VERSION=1.9.100.%errorlevel%

REM Check if Prerequisites apps available
echo "Validating Prerequisites (Perl, NASM, OpenSSL source)"
echo "Validating Prerequisites (Perl, NASM)"
perl -v > nul 2>&1
if %errorlevel% neq 0 (
echo "Build failed, can't find perl."
Expand All @@ -48,12 +45,7 @@ if %errorlevel% neq 0 (
exit /b 1
)

set OPENSSL_VERSION=openssl-1.1.1q

if not exist ..\openssl_source\%OPENSSL_VERSION%.tar.gz (
echo "Please download %OPENSSL_VERSION%.tar.gz and put at ..\openssl_source\"
exit /b 1
)
set OPENSSL_VERSION=openssl

for /f "tokens=2*" %%A in ('REG QUERY "HKLM\SOFTWARE\Intel\SGX_PSW" /v Version') DO (
for %%F in (%%B) do (
Expand All @@ -62,7 +54,7 @@ for /f "tokens=2*" %%A in ('REG QUERY "HKLM\SOFTWARE\Intel\SGX_PSW" /v Version')
)
)
:break
set SGXSSL_VERSION=%PSW_VER%_%OPENSSL_VERSION:openssl-=%
set SGXSSL_VERSION=%PSW_VER%_%OPENSSL_VERSION%-1.1.1q
echo "Building SGXSSL with: %OPENSSL_VERSION% %date% %time% to %SGXSSL_VERSION%"

REM *********************************************************
Expand Down
5 changes: 2 additions & 3 deletions Windows/build_package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ set SGXSSL_SOLUTION=%SGXSSL_ROOT%\sgx\
set OPENSSL_VERSION=%2
set TEST_MODE=%4
set PROCESSOR_ARCHITECTURE=AMD64
set WIN_SDK_VER=8.1
perl svn_revision.pl > sgx\libsgx_tsgxssl\tsgxssl_version.h

set build_mode=%1
Expand Down Expand Up @@ -88,8 +87,8 @@ goto build_start

cd %SGXSSL_ROOT%\..\openssl_source
rmdir /s /q %OPENSSL_VERSION%

call powershell -Command "tar xf %OPENSSL_VERSION%.tar.gz"
mkdir %OPENSSL_VERSION%
xcopy /Q /Y /S %SGXSSL_ROOT%\..\%OPENSSL_VERSION% %OPENSSL_VERSION%

REM Remove AESBS to support only AESNI and VPAES
call powershell -Command "(get-content %OPENSSL_VERSION%\Configure) -replace ('BSAES_ASM','') | out-file %OPENSSL_VERSION%\Configure"
Expand Down
1 change: 1 addition & 0 deletions openssl
Submodule openssl added at 29708a