Skip to content

Commit

Permalink
Adds MRENCLAVE and digest information to SGX build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
italo-sampaio committed Nov 22, 2024
1 parent 2e8d75f commit f29528c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions firmware/build/build-sgx
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,20 @@ BUILD_CMD="\$SGX_ENVSETUP && make clean $BUILD_TARGET CHECKPOINT=$1 TARGET_DIFFI
DOCKER_USER="$(id -u):$(id -g)"

docker run -t --rm --user $DOCKER_USER -w /hsm2/firmware/src/sgx -v ${HSM_ROOT}:/hsm2 ${DOCKER_IMAGE} /bin/bash -c "$BUILD_CMD"

if [[ $? -ne 0 ]]; then
echo "Build failed"
exit 1
fi

HOST_BIN=$HSM_ROOT/firmware/src/sgx/bin/hsmsgx
ENCLAVE_BIN=$HSM_ROOT/firmware/src/sgx/bin/hsmsgx_enclave.signed

echo "*******************"
echo "Build successful."
echo "$(realpath $HOST_BIN --relative-to=$HSM_ROOT):"
sha256sum $HOST_BIN | cut -d ' ' -f 1
echo ""
echo "$(realpath $ENCLAVE_BIN --relative-to=$HSM_ROOT):"
$BUILD_ROOT/extract-mrenclave $ENCLAVE_BIN
echo "*******************"

0 comments on commit f29528c

Please sign in to comment.