diff --git a/tools/pcr0-verifier/Dockerfile b/tools/pcr0-verifier/Dockerfile index d21a6f7..1eb6a84 100644 --- a/tools/pcr0-verifier/Dockerfile +++ b/tools/pcr0-verifier/Dockerfile @@ -41,7 +41,7 @@ RUN amazon-linux-extras enable aws-nitro-enclaves-cli && \ yum clean all COPY --from=op-enclave /app/bundle/rootfs/build/eif.bin /app/eif.bin -COPY extract-pcr0.sh /extract-pcr0.sh -RUN chmod +x /extract-pcr0.sh +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/extract-pcr0.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/tools/pcr0-verifier/README.md b/tools/pcr0-verifier/README.md index a103fb8..19554c1 100644 --- a/tools/pcr0-verifier/README.md +++ b/tools/pcr0-verifier/README.md @@ -1,4 +1,4 @@ -# PCR0 Extractor +# PCR0 Verifier This tool extracts the PCR0 measurement from an op-enclave EIF (Enclave Image Format) file. The PCR0 measurement is a cryptographic hash that represents the initial state of the enclave, which is crucial for attestation and verification purposes. @@ -9,14 +9,14 @@ This tool extracts the PCR0 measurement from an op-enclave EIF (Enclave Image Fo ## Building and Running -1. Build the PCR0 extractor container: +1. Build the PCR0 verifier container: ```bash -docker build -t pcr0-extractor . +docker build -t pcr0-verifier . ``` 2. Run the container to extract the PCR0: ```bash -docker run --rm pcr0-extractor +docker run --rm pcr0-verifier ``` The tool will: @@ -48,4 +48,4 @@ The output will include both the raw PCR0 measurement and instructions for verif ## Note -The PCR0 measurement is specific to the version of the op-enclave EIF being examined. The current version being used is specified in the Dockerfile as `TAG=v0.0.1-rc5`. +The PCR0 measurement is specific to the version of the op-enclave EIF being examined. The current version being used is specified in the Dockerfile as `TAG=v0.0.1-rc5`. You can perform the same measurement on other EIF files by modifying the Dockerfile. diff --git a/tools/pcr0-verifier/entrypoint.sh b/tools/pcr0-verifier/entrypoint.sh index f9a85f9..44aa892 100644 --- a/tools/pcr0-verifier/entrypoint.sh +++ b/tools/pcr0-verifier/entrypoint.sh @@ -17,4 +17,4 @@ echo -e "\n# Then run these commands to verify:" echo "# To register a new PCR0 (requires owner access):" echo "cast send \$SYSTEM_CONFIG_GLOBAL_ADDRESS 'registerPCR0(bytes)' ${PCR0_WITH_PREFIX} --rpc-url \$RPC_URL" echo -e "\n# To check if a PCR0 is valid:" -echo "cast call \$SYSTEM_CONFIG_GLOBAL_ADDRESS 'validPCR0s(bytes32)' 0x\$(cast keccak \${PCR0}) --rpc-url \$RPC_URL" +echo "cast call \$SYSTEM_CONFIG_GLOBAL_ADDRESS 'validPCR0s(bytes32)' \$(cast keccak ${PCR0_WITH_PREFIX}) --rpc-url \$RPC_URL" \ No newline at end of file