From 9ae55e7ee789e2bcb8bfbe9eaed1af4f475e62b6 Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Tue, 22 Apr 2025 21:35:55 +0200 Subject: [PATCH 1/5] Fix Librats EDL Include Given the definition of the LIB_RATS vars, this line should be fixed in this way. --- product-mini/platforms/linux-sgx/enclave-sample/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Makefile b/product-mini/platforms/linux-sgx/enclave-sample/Makefile index 8fd053a5f..3a540bc9f 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Makefile +++ b/product-mini/platforms/linux-sgx/enclave-sample/Makefile @@ -171,7 +171,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 From 10d579cf8a6e6b3b5a6c2bdff522de5c705fe187 Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Tue, 22 Apr 2025 22:06:41 +0200 Subject: [PATCH 2/5] Update Makefile --- .../linux-sgx/enclave-sample/Makefile | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Makefile b/product-mini/platforms/linux-sgx/enclave-sample/Makefile index 3a540bc9f..82f46e900 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Makefile +++ b/product-mini/platforms/linux-sgx/enclave-sample/Makefile @@ -12,7 +12,7 @@ SPEC_TEST ?= 0 # These variables are automatically set by CMakeLists.txt WAMR_BUILD_SGX_IPFS = 0 -WAMR_BUILD_LIB_RATS = 0 +WAMR_BUILD_LIB_RATS = 1 WAMR_BUILD_GLOBAL_HEAP_POOL = 0 WAMR_BUILD_GLOBAL_HEAP_SIZE = 10485760 WAMR_BUILD_STATIC_PGO = 0 @@ -20,7 +20,7 @@ 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_INSTALL_DIR := $(VMLIB_BUILD_DIR)/librats/build LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/librats/include ifeq ($(shell getconf LONG_BIT), 32) @@ -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) @@ -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 \ + -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 From e07859026d378aca97d513c0a592a69db506973b Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Wed, 23 Apr 2025 11:51:29 +0200 Subject: [PATCH 3/5] Update Makefile --- product-mini/platforms/linux-sgx/enclave-sample/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Makefile b/product-mini/platforms/linux-sgx/enclave-sample/Makefile index 82f46e900..f82440bc1 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Makefile +++ b/product-mini/platforms/linux-sgx/enclave-sample/Makefile @@ -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/build -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 From 7daf2d346d45f570f5feddf3258f82a8e193e220 Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Fri, 25 Apr 2025 14:35:31 +0200 Subject: [PATCH 4/5] Update Makefile --- product-mini/platforms/linux-sgx/enclave-sample/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product-mini/platforms/linux-sgx/enclave-sample/Makefile b/product-mini/platforms/linux-sgx/enclave-sample/Makefile index f82440bc1..eaa806011 100644 --- a/product-mini/platforms/linux-sgx/enclave-sample/Makefile +++ b/product-mini/platforms/linux-sgx/enclave-sample/Makefile @@ -12,7 +12,7 @@ SPEC_TEST ?= 0 # These variables are automatically set by CMakeLists.txt WAMR_BUILD_SGX_IPFS = 0 -WAMR_BUILD_LIB_RATS = 1 +WAMR_BUILD_LIB_RATS = 0 WAMR_BUILD_GLOBAL_HEAP_POOL = 0 WAMR_BUILD_GLOBAL_HEAP_SIZE = 10485760 WAMR_BUILD_STATIC_PGO = 0 From 6aa94f0edfa7dc9146d22b0adad5561dde1b1b2e Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Mon, 5 May 2025 21:57:35 +0200 Subject: [PATCH 5/5] Update README.md --- samples/sgx-ra/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/sgx-ra/README.md b/samples/sgx-ra/README.md index 179a074b8..f2b2ee4f0 100644 --- a/samples/sgx-ra/README.md +++ b/samples/sgx-ra/README.md @@ -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 @@ -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 $ cd intel-sgx-ssl/Linux $ source /opt/intel/sgxsdk/environment $ make all