Commit be7eda5
committed
attestation_policy: unify the PCR path across platforms
Previously, attestation policies had to handle different PCR path formats:
- Azure SNP: input.azsnpvtpm.tpm.pcr01
- Azure TDX: input.aztdxvtpm.tpm.pcr01
- Local TPM: input.tpm.pcr[1]
This change introduces a generic `get_by_path()` helper and rewrites PCR
validation rules to dynamically traverse nested objects based on a
platform-specific path array. As a result, the same set of rules can now
be reused for multiple platforms without duplicating policy logic.
Benefits:
- Removes platform-specific hardcoding from rules
- Simplifies maintenance and extension to future platforms
- Makes PCR verification more consistent and extensible
Signed-off-by: Fangge Jin <[email protected]>1 parent 6266e84 commit be7eda5
1 file changed
+35
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
0 commit comments