Commit ca0f577
committed
fix: upgrade to V1 msgpack attestation when v2 events present
Root cause of a live RTMR3-mismatch observed during v2 CVM testing:
`Attestation::into_versioned()` unconditionally wrapped as
`VersionedAttestation::V0`, which SCALE-encodes the payload. But
`RuntimeEvent::version` and `TdxEvent::version` carry `#[codec(skip)]`
(added for V0 binary compat), so the `version` field is dropped on
the wire. The KMS-side decoder then defaults each event to V1, replays
with the V1 digest algorithm, and fails against the guest's V2-extended
RTMR3.
Fix: when any runtime event reports a non-V1 version, force V1 msgpack
encoding (where `version` is a normal serde field and round-trips).
Callers with only V1 events still get V0/SCALE, preserving wire-format
compatibility with existing consumers.
`from_bytes` already detects the encoding by leading byte (msgpack map
prefix -> V1, else SCALE -> V0), so receivers don't need changes.
Verified end-to-end: deployed a CVM with `event_log_version: 2`, boot
now progresses past `get_app_key` without an RTMR3 mismatch; KMS
replay sees `version=V2` and matches the quoted RTMR3.1 parent 5b6b57d commit ca0f577
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
1143 | 1141 | | |
1144 | 1142 | | |
1145 | 1143 | | |
1146 | | - | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1147 | 1150 | | |
1148 | | - | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1149 | 1162 | | |
1150 | 1163 | | |
1151 | 1164 | | |
| |||
0 commit comments