From 676e3f298bbf46d729abeeb2dc55ce69a44fa04a Mon Sep 17 00:00:00 2001 From: BillyWooo Date: Sun, 20 Oct 2024 10:59:58 +0200 Subject: [PATCH] Makefile build flag is not passed inside enclave-runtime (#3138) * build flag is not passed inside enclave-runtime; add some log info * typo --- tee-worker/bitacross/service/src/enclave/tls_ra.rs | 2 +- tee-worker/identity/Makefile | 2 +- tee-worker/identity/enclave-runtime/Makefile | 4 ++++ tee-worker/identity/enclave-runtime/src/lib.rs | 5 +++++ tee-worker/identity/service/src/enclave/tls_ra.rs | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tee-worker/bitacross/service/src/enclave/tls_ra.rs b/tee-worker/bitacross/service/src/enclave/tls_ra.rs index 318f6a22e8..f7ff454ecb 100644 --- a/tee-worker/bitacross/service/src/enclave/tls_ra.rs +++ b/tee-worker/bitacross/service/src/enclave/tls_ra.rs @@ -47,7 +47,7 @@ pub fn enclave_run_state_provisioning_server( loop { match listener.accept() { Ok((socket, addr)) => { - info!("[MU-RA-Server] a worker at {} is requesting key provisiong", addr); + info!("[MU-RA-Server] a worker at {} is requesting key provisioning", addr); // there is some race condition, lets wait until local state gets updated (signers are registered and updated locally through indirect calls) std::thread::sleep(Duration::from_secs(3)); let result = enclave_api.run_state_provisioning_server( diff --git a/tee-worker/identity/Makefile b/tee-worker/identity/Makefile index b3ebf1e1d5..6129a87c84 100755 --- a/tee-worker/identity/Makefile +++ b/tee-worker/identity/Makefile @@ -233,7 +233,7 @@ endif enclave: @echo @echo "Building the enclave" - $(MAKE) -C ./enclave-runtime/ + $(MAKE) -C ./enclave-runtime/ RA_METHOD=$(RA_METHOD) WORKER_DEV=$(WORKER_DEV) .git/hooks/pre-commit: .githooks/pre-commit @echo "Installing git hooks" diff --git a/tee-worker/identity/enclave-runtime/Makefile b/tee-worker/identity/enclave-runtime/Makefile index 5db83ad36c..9f17b83590 100644 --- a/tee-worker/identity/enclave-runtime/Makefile +++ b/tee-worker/identity/enclave-runtime/Makefile @@ -48,6 +48,10 @@ ifeq ($(WORKER_DEV), 1) ADDITIONAL_FEATURES := $(ADDITIONAL_FEATURES),development endif +ifeq ($(RA_METHOD), dcap) + ADDITIONAL_FEATURES := $(ADDITIONAL_FEATURES),dcap +endif + ifeq ($(WORKER_ENV_DATA_PROVIDERS_CONFIG), 1) ADDITIONAL_FEATURES := $(ADDITIONAL_FEATURES),env-data-providers-config endif diff --git a/tee-worker/identity/enclave-runtime/src/lib.rs b/tee-worker/identity/enclave-runtime/src/lib.rs index 9531f372da..c587781fb0 100644 --- a/tee-worker/identity/enclave-runtime/src/lib.rs +++ b/tee-worker/identity/enclave-runtime/src/lib.rs @@ -148,6 +148,11 @@ pub unsafe extern "C" fn init( } ); + #[cfg(feature = "dcap")] + info!(" DCAP is enabled within enclave"); + #[cfg(not(feature = "dcap"))] + info!(" DCAP is disabled within enclave"); + let mu_ra_url = match String::decode(&mut slice::from_raw_parts(mu_ra_addr, mu_ra_addr_size as usize)) .map_err(Error::Codec) diff --git a/tee-worker/identity/service/src/enclave/tls_ra.rs b/tee-worker/identity/service/src/enclave/tls_ra.rs index 83e4f4d0a1..78d4559e7a 100644 --- a/tee-worker/identity/service/src/enclave/tls_ra.rs +++ b/tee-worker/identity/service/src/enclave/tls_ra.rs @@ -46,7 +46,7 @@ pub fn enclave_run_state_provisioning_server( loop { match listener.accept() { Ok((socket, addr)) => { - info!("[MU-RA-Server] a worker at {} is requesting key provisiong", addr); + info!("[MU-RA-Server] a worker at {} is requesting key provisioning", addr); let result = enclave_api.run_state_provisioning_server( socket.as_raw_fd(),