fix bug on TCB change for installing VMs

This commit is contained in:
ghe0 2025-04-04 17:29:19 +00:00
parent f0407edacc
commit 7fb7904418

@ -103,9 +103,9 @@ echo_blue "Verifying AMD signature in attestation report..."
chip_id_hash=$( snpguest display report "$server_report" \
| grep "Chip ID:" -A 4 | tail -3 | tr '\n' ' ' | sed 's/\s//g' \
| md5sum | awk '{ print $1 }')
microcode=$( snpguest display report "$server_report" |
grep "Launch TCB:" -A 6 | grep "Microcode:" | awk '{ print $2 }' )
vcek_path="${cert_dir}/${chip_id_hash}-${microcode}.vcek.pem"
tcb_hash=$(grep -e "Committed TCB" -e "Reported TCB" -A 10 "$server_report" |
md5sum | awk '{ print $1 }')
vcek_path="${cert_dir}/${chip_id_hash}-${tcb_hash}.vcek.pem"
amd_certs_dir="${cert_dir}/amd_certs_${server}"
mkdir -p "$amd_certs_dir"