AMD SEV-SNP guest attestation: device access, extended report retrieval with certificate buffer caching, and offline ECDSA-P384 signature verification.
- Retrieves an extended attestation report (raw report + certificate table) from the SEV-SNP guest device
- Parses the report into a protobuf and extracts the endorsement key (VCEK or VLEK) from the certificate table
- Determines the AMD product line (Milan, Genoa, Turin) from the endorsement key's x509 extensions
- Verifies the endorsement key's certificate chain against embedded AMD root certificates (ASK + ARK)
- Verifies the ECDSA-P384 report signature directly against the original raw bytes
- Checks that the report data matches the expected value
// Basic offline verification:
report, err := sevsnp.VerifyEvidence(blob, expectedReportData, time.Now())
// With optional revocation checker (checks endorsement key against a CRL):
report, err := sevsnp.VerifyEvidence(blob, expectedReportData, time.Now(), revChecker)
// report.Measurement — 384-bit launch measurement
// report.Policy, report.Vmpl, report.ReportData, etc.The optional RevocationChecker callback is invoked after certificate chain verification to check the endorsement key (VCEK/VLEK) against a CRL. Pass nil or omit to skip revocation checking.
dev, err := sevsnp.Open()
defer dev.Close()
blob, report, err := dev.Attest(reportData, vmpl) // combined get + verify
blob, err := dev.GetEvidence(reportData, vmpl) // get onlyrawReport, certTable, err := sevsnp.SplitEvidence(blob)VerifyEvidence implements its own verification flow instead of using verify.SnpAttestation from go-sev-guest (v0.14.1) to work around three library issues:
-
Unknown policy bits —
abi.ReportToProtorejects reports with policy bits the library doesn't recognize (e.g. bit 25 = PageSwapDisable on AWS). Workaround: mask unknown bits before parsing, restore original value afterward. -
Malformed ASK/ARK in certificate table — some hypervisors (AWS Nitro) populate the extended report's certificate table with entries that
x509.ParseCertificaterejects. Workaround: resolve the endorsement key directly and verify against pre-parsed AMD root certs embedded in the binary. -
Signature over reconstructed bytes — the library reconstructs raw bytes from the sanitized protobuf for signature verification, but the sanitized policy differs from what the hardware signed. Workaround: verify the signature against the original raw report bytes.
These workarounds can be revisited when go-sev-guest ships a release including PR #181.
GetEvidence caches the certificate table size after the first call. The go-sev-guest library performs two ioctls per call (probe for cert size + actual attestation) with a ~2s self-throttle between them. By caching the size, subsequent calls use a single ioctl, eliminating one PSP firmware round-trip and one throttle delay.
AMD root certificates (ASK + ARK) for all supported product lines are parsed at init time from PEM bundles shipped with go-sev-guest:
| Product line | Signing keys |
|---|---|
| Milan | VCEK, VLEK |
| Genoa | VCEK, VLEK |
| Turin | VCEK, VLEK |