Skip to content

Fix SGX-RA Building #4208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
22 changes: 17 additions & 5 deletions product-mini/platforms/linux-sgx/enclave-sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ WAMR_BUILD_LIBC_WASI = 1

VMLIB_BUILD_DIR ?= $(CURDIR)/../build
LIB_RATS_SRC ?= $(VMLIB_BUILD_DIR)/_deps/librats-build
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/librats/lib/librats
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/librats/include
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-build
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-src/include

ifeq ($(shell getconf LONG_BIT), 32)
SGX_ARCH := x86
Expand Down Expand Up @@ -99,7 +99,7 @@ else
endif

ifeq ($(WAMR_BUILD_LIB_RATS), 1)
App_Link_Flags += -L$(LIB_RATS_INSTALL_DIR) -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
App_Link_Flags += -L$(LIB_RATS_SRC)/tee/sgx/untrust -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
endif

App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
Expand Down Expand Up @@ -152,7 +152,19 @@ else
endif

ifeq ($(WAMR_BUILD_LIB_RATS), 1)
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) -L$(LIB_RATS_INSTALL_DIR)/attesters -L$(LIB_RATS_INSTALL_DIR)/verifiers -L$(SGX_SSL)/lib64 -L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib -L$(LIB_RATS_INSTALL_DIR)/crypto_wrappers
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) \
-L$(LIB_RATS_SRC)/tee/sgx/trust \
-L$(LIB_RATS_SRC)/attesters/sgx-ecdsa \
-L$(LIB_RATS_SRC)/attesters/nullattester \
-L$(LIB_RATS_SRC)/attesters/sgx-la \
-L$(LIB_RATS_SRC)/verifiers/nullverifier \
-L$(LIB_RATS_SRC)/verifiers/sgx-la \
-L$(LIB_RATS_SRC)/verifiers/sgx-ecdsa-qve \
-L$(SGX_SSL)/lib64 \
-L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib \
-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
Copy link
Collaborator

Choose a reason for hiding this comment

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

duplicate line with 166

-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
-L$(LIB_RATS_SRC)/crypto_wrappers/nullcrypto
Rats_Lib_W_Link_libs := -lattester_nullattester -lattester_sgx_ecdsa -lattester_sgx_la \
-lverifier_nullverifier -lverifier_sgx_la -lverifier_sgx_ecdsa_qve -lcbor \
-lrats_lib -lsgx_tsgxssl -lcrypto_wrapper_nullcrypto -lcrypto_wrapper_openssl
Expand All @@ -171,7 +183,7 @@ Enclave_Edl_Search_Path = --search-path ../Enclave \
--search-path $(SGX_SDK)/include \
--search-path $(WAMR_ROOT)/core/shared/platform/linux-sgx
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/librats/edl --search-path $(SGX_SSL)/include
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/edl --search-path $(SGX_SSL)/include
endif


Expand Down
6 changes: 3 additions & 3 deletions samples/sgx-ra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ $ cd $HOME
$ OS_PLATFORM=ubuntu20.04
$ OS_CODE_NAME=`lsb_release -sc`
$ SGX_PLATFORM=$OS_PLATFORM-server
$ SGX_RELEASE_VERSION=1.17
$ SGX_RELEASE_VERSION=1.22
$ SGX_DRIVER_VERSION=1.41
$ SGX_SDK_VERSION=2.20.100.4
$ SGX_SDK_VERSION=2.25.100.3

# install the dependencies
$ sudo apt-get update
Expand Down Expand Up @@ -53,7 +53,7 @@ $ # Verify that the paths are correctly set
$ which ar as ld objcopy objdump ranlib
$ cd ../
$ git clone https://github.com/intel/intel-sgx-ssl.git
$ wget https://www.openssl.org/source/openssl-1.1.1v.tar.gz -O intel-sgx-ssl/openssl_source/openssl-1.1.1v.tar.gz
$ wget https://www.openssl.org/source/openssl-3.0.14.tar.gz -O intel-sgx-ssl/openssl_source/openssl-3.0.14.tar.gz
Copy link
Collaborator

Choose a reason for hiding this comment

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

When I try to make all, it requires openssl version to be 3.1.x, do you think it's a problem?

$ cd intel-sgx-ssl/Linux
$ source /opt/intel/sgxsdk/environment
$ make all
Expand Down
Loading