Commit 1c2492e
fix: add unpadded init_data hashes to RVPS for bare metal SNP (#23)
Commit f928983 ("feat: add baremetal TDX/SNP and NVIDIA GPU
attestation support") added zero-padded raw hashes to the RVPS
init_data reference values, described as "SHA256(toml) zero-padded
to 48 bytes for baremetal TDX/SNP". However, SNP and TDX store the
init_data hash in different fields with different sizes:
- TDX uses mr_config_id (48 bytes), so the 32-byte SHA-256 hash is
zero-padded to 48 bytes (96 hex chars). The padded format is correct
for TDX.
- SNP uses host_data (32 bytes), so the SHA-256 hash is stored as-is
with no padding (64 hex chars). This is confirmed in the KBS SNP
verifier (deps/verifier/src/snp/mod.rs), which calls
regularize_data(hash, 32, "HOST_DATA", "SNP") and emits
hex::encode(report.host_data) as the init_data claim.
Because the RVPS only contained the padded (96-char) format, the OPA
policy check failed on bare metal SNP: the 64-char init_data from the
attestation report did not match any value in the reference list.
Add $rawHash and $debugRawHash (unpadded) to the RVPS alongside the
existing padded values. This supports both TDX (padded) and SNP
(unpadded) from a single configuration.
Fixes: f928983 ("feat: add baremetal TDX/SNP and NVIDIA GPU attestation support")
Signed-off-by: Jens Freimann <jfreiman@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent ebde8b7 commit 1c2492e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments