-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8681255
commit ba177b0
Showing
3 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
echo "Starting PCR0 extraction..." | ||
echo "Checking if EIF file exists:" | ||
ls -l /app/eif.bin | ||
|
||
echo "Command used: nitro-cli describe-eif --eif-path /app/eif.bin" | ||
echo "PCR0 measurement:" | ||
nitro-cli describe-eif --eif-path /app/eif.bin | tee /dev/stderr | jq -r ".Measurements.PCR0" | ||
PCR0=$(nitro-cli describe-eif --eif-path /app/eif.bin | tee /dev/stderr | jq -r ".Measurements.PCR0") | ||
PCR0_WITH_PREFIX="0x${PCR0}" | ||
|
||
echo -e "\nTo verify against SystemConfigGlobal contract, run:" | ||
echo "# First set your environment variables:" | ||
echo "export SYSTEM_CONFIG_GLOBAL_ADDRESS=<contract_address>" | ||
echo "export RPC_URL=<rpc_url>" | ||
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)' \$(cast keccak ${PCR0_WITH_PREFIX}) --rpc-url \$RPC_URL" |