Commit 270aaf8
committed
fix: address copilot review on v1 digest encoding and v2 fallback
- pin v1 digest event_type encoding to little-endian (to_le_bytes)
so the on-wire format is platform-independent. x86 (dstack's only
target) produces identical bytes, so existing RTMR3 values and
verifiers are unaffected. the 2024 spec called out to_ne_bytes
explicitly, but a stable wire format should not depend on the
host platform.
- fix the EventLogVersion::V2 doc comment in dstack-types: it listed
event_type 134217730 (0x08000002), but v1 and v2 share the same
event_type 134217729 (0x08000001). the version is distinguished by
the EventLogVersion field / json version key, not event_type.
- replace canonical_event_json_v2's .unwrap_or_default() with
.or_panic(). silently returning "" on serialization failure would
produce sha384("") as the digest, which is both wrong and hard to
debug. the input is a well-formed json!{} literal so serialization
cannot actually fail; or_panic makes that invariant explicit without
tripping the expect_used clippy lint.1 parent 374f3d3 commit 270aaf8
4 files changed
Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | | - | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments