Files
mpc/pkg
zeekay be7fa85a9b kms/release: wire cc/attest chain verifier into Release path
Red Final N1 fix. Release() previously called only Attestation.Verify(nonce)
and ReleasePolicy.Permits() before sealing the session key. Neither step
performs the actual SEV-SNP / TDX / NRAS chain verification — AMD KDS
lookup, ARK→ASK→VCEK chain, NRAS JWT — leaving the #222 go-sev-guest
verifier as dead code on the release path. A worker that fabricates a
CompositeAttestation envelope whose Verify(nonce) returns true and whose
RIM/HW/issuer membership matches policy could harvest a session key
without ever presenting AMD-signed evidence.

Wire-in:
  - kms.CompositeAttestation gains VerifyEvidence(ctx, opts...) returning
    []*attest.VerifiedReport. *attestation.CompositeAttestation already
    implements this method (composite.go:320 → attest.Dispatch per blob).
  - ReleaseRequest gains optional Ctx + AttestOptions for context plumbing
    + per-call policy (e.g. attest.WithExpectedReportData(nonce[:])).
  - Release() calls VerifyEvidence between the cheap nonce check and the
    policy permit step. Any chain failure → ErrAttestationChain joined
    with ErrPolicyRefused via errors.Join. No silent acceptance.
  - New sentinel ErrAttestationChain.

Tests (go test -v -short -race -count=1 -timeout 60s ./pkg/kms/...):
  - all 14 existing TestRelease_/TestNonce_/TestAAD_ remain green
  - NEW TestRelease_RefusesOnChainFailure: Verify(nonce)=true but
    VerifyEvidence returns ErrChainInvalid → MUST surface
    ErrAttestationChain wrapped under ErrPolicyRefused
  - NEW TestRelease_AcceptsOnChainPass: paired happy-path so the
    chain-step is the only difference, not a wiring regression

Also pulled in cherry-pick of canonical go-sev-guest sums (c4f1e22) so
cc/attest builds reproducibly outside the dirty local cache.
2026-04-28 08:47:09 -07:00
..
2026-04-28 00:58:33 -07:00
2024-09-21 20:52:40 +07:00
2025-08-02 22:27:51 -05:00