@tinfoilsh/verifier 1.4.0 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +29 -17
  2. package/dist/document/collateral/collateral.d.ts +76 -0
  3. package/dist/document/collateral/collateral.d.ts.map +1 -0
  4. package/dist/document/collateral/collateral.js +175 -0
  5. package/dist/document/collateral/collateral.js.map +1 -0
  6. package/dist/document/collateral/config.d.ts +24 -0
  7. package/dist/document/collateral/config.d.ts.map +1 -0
  8. package/dist/document/collateral/config.js +46 -0
  9. package/dist/document/collateral/config.js.map +1 -0
  10. package/dist/document/collateral/runtime.d.ts +20 -0
  11. package/dist/document/collateral/runtime.d.ts.map +1 -0
  12. package/dist/document/collateral/runtime.js +37 -0
  13. package/dist/document/collateral/runtime.js.map +1 -0
  14. package/dist/document/collateral/sev.d.ts +13 -0
  15. package/dist/document/collateral/sev.d.ts.map +1 -0
  16. package/dist/document/collateral/sev.js +26 -0
  17. package/dist/document/collateral/sev.js.map +1 -0
  18. package/dist/document/collateral/sigstore.d.ts +19 -0
  19. package/dist/document/collateral/sigstore.d.ts.map +1 -0
  20. package/dist/document/collateral/sigstore.js +31 -0
  21. package/dist/document/collateral/sigstore.js.map +1 -0
  22. package/dist/document/collateral/tdx.d.ts +14 -0
  23. package/dist/document/collateral/tdx.d.ts.map +1 -0
  24. package/dist/document/collateral/tdx.js +44 -0
  25. package/dist/document/collateral/tdx.js.map +1 -0
  26. package/dist/document/document.d.ts +112 -0
  27. package/dist/document/document.d.ts.map +1 -0
  28. package/dist/document/document.js +387 -0
  29. package/dist/document/document.js.map +1 -0
  30. package/dist/errors.d.ts +44 -76
  31. package/dist/errors.d.ts.map +1 -1
  32. package/dist/errors.js +52 -81
  33. package/dist/errors.js.map +1 -1
  34. package/dist/index.d.ts +31 -10
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +70 -10
  37. package/dist/index.js.map +1 -1
  38. package/dist/internal/bytes.d.ts +13 -0
  39. package/dist/internal/bytes.d.ts.map +1 -0
  40. package/dist/internal/bytes.js +37 -0
  41. package/dist/internal/bytes.js.map +1 -0
  42. package/dist/internal/canonical.js +89 -0
  43. package/dist/internal/canonical.js.map +1 -0
  44. package/dist/internal/endorsement/approval.js +467 -0
  45. package/dist/internal/endorsement/approval.js.map +1 -0
  46. package/dist/internal/endorsement/freshness.js +122 -0
  47. package/dist/internal/endorsement/freshness.js.map +1 -0
  48. package/dist/internal/endorsement/provenance.js +256 -0
  49. package/dist/internal/endorsement/provenance.js.map +1 -0
  50. package/dist/internal/endorsement/reference.d.ts +32 -0
  51. package/dist/internal/endorsement/reference.d.ts.map +1 -0
  52. package/dist/internal/endorsement/reference.js +37 -0
  53. package/dist/internal/endorsement/reference.js.map +1 -0
  54. package/dist/internal/endorsement/registry-certificate.js +147 -0
  55. package/dist/internal/endorsement/registry-certificate.js.map +1 -0
  56. package/dist/internal/endorsement/runtime.js +52 -0
  57. package/dist/internal/endorsement/runtime.js.map +1 -0
  58. package/dist/internal/endorsement/time.js +26 -0
  59. package/dist/internal/endorsement/time.js.map +1 -0
  60. package/dist/internal/json/decode.js +151 -0
  61. package/dist/internal/json/decode.js.map +1 -0
  62. package/dist/internal/json/index.d.ts +68 -0
  63. package/dist/internal/json/index.d.ts.map +1 -0
  64. package/dist/internal/json/index.js +486 -0
  65. package/dist/internal/json/index.js.map +1 -0
  66. package/dist/internal/policy/artifact.js +191 -0
  67. package/dist/internal/policy/artifact.js.map +1 -0
  68. package/dist/internal/policy/sev.js +157 -0
  69. package/dist/internal/policy/sev.js.map +1 -0
  70. package/dist/internal/policy/shape.js +31 -0
  71. package/dist/internal/policy/shape.js.map +1 -0
  72. package/dist/internal/policy/tdx.js +55 -0
  73. package/dist/internal/policy/tdx.js.map +1 -0
  74. package/dist/internal/quote/config.js +53 -0
  75. package/dist/internal/quote/config.js.map +1 -0
  76. package/dist/internal/quote/legacy.js +67 -0
  77. package/dist/internal/quote/legacy.js.map +1 -0
  78. package/dist/internal/quote/quote.js +139 -0
  79. package/dist/internal/quote/quote.js.map +1 -0
  80. package/dist/internal/quote/resolve.js +88 -0
  81. package/dist/internal/quote/resolve.js.map +1 -0
  82. package/dist/internal/quote/sev/authenticate.js +125 -0
  83. package/dist/internal/quote/sev/authenticate.js.map +1 -0
  84. package/dist/internal/quote/sev/expectations.js +288 -0
  85. package/dist/internal/quote/sev/expectations.js.map +1 -0
  86. package/dist/internal/quote/sev/identity.js +13 -0
  87. package/dist/internal/quote/sev/identity.js.map +1 -0
  88. package/dist/internal/quote/sev/report.js +224 -0
  89. package/dist/internal/quote/sev/report.js.map +1 -0
  90. package/dist/internal/quote/sev/tcb.js +110 -0
  91. package/dist/internal/quote/sev/tcb.js.map +1 -0
  92. package/dist/internal/quote/sev/vcek.js +299 -0
  93. package/dist/internal/quote/sev/vcek.js.map +1 -0
  94. package/dist/internal/quote/tdx/abi.js +161 -0
  95. package/dist/internal/quote/tdx/abi.js.map +1 -0
  96. package/dist/internal/quote/tdx/authenticate.js +343 -0
  97. package/dist/internal/quote/tdx/authenticate.js.map +1 -0
  98. package/dist/internal/quote/tdx/identity.js +11 -0
  99. package/dist/internal/quote/tdx/identity.js.map +1 -0
  100. package/dist/internal/quote/tdx/pck.js +133 -0
  101. package/dist/internal/quote/tdx/pck.js.map +1 -0
  102. package/dist/internal/quote/tdx/pcs.js +482 -0
  103. package/dist/internal/quote/tdx/pcs.js.map +1 -0
  104. package/dist/internal/rfc3339.js +24 -0
  105. package/dist/internal/rfc3339.js.map +1 -0
  106. package/dist/internal/runtime/config.js +61 -0
  107. package/dist/internal/runtime/config.js.map +1 -0
  108. package/dist/internal/runtime/manifest.js +82 -0
  109. package/dist/internal/runtime/manifest.js.map +1 -0
  110. package/dist/internal/semver.js +124 -0
  111. package/dist/internal/semver.js.map +1 -0
  112. package/dist/internal/sigstore/bundle.js +205 -0
  113. package/dist/internal/sigstore/bundle.js.map +1 -0
  114. package/dist/internal/sigstore/certificate.js +220 -0
  115. package/dist/internal/sigstore/certificate.js.map +1 -0
  116. package/dist/internal/sigstore/certified.js +56 -0
  117. package/dist/internal/sigstore/certified.js.map +1 -0
  118. package/dist/internal/sigstore/keyed.js +556 -0
  119. package/dist/internal/sigstore/keyed.js.map +1 -0
  120. package/dist/internal/sigstore/timestamp.js +421 -0
  121. package/dist/internal/sigstore/timestamp.js.map +1 -0
  122. package/dist/internal/sigstore/trusted-root.js +144 -0
  123. package/dist/internal/sigstore/trusted-root.js.map +1 -0
  124. package/dist/internal/x509/certificate.js +521 -0
  125. package/dist/internal/x509/certificate.js.map +1 -0
  126. package/dist/internal/x509/crl.js +116 -0
  127. package/dist/internal/x509/crl.js.map +1 -0
  128. package/dist/internal/x509/der.js +409 -0
  129. package/dist/internal/x509/der.js.map +1 -0
  130. package/dist/measurement.d.ts +47 -0
  131. package/dist/measurement.d.ts.map +1 -0
  132. package/dist/measurement.js +92 -0
  133. package/dist/measurement.js.map +1 -0
  134. package/dist/trust/amd-genoa-chain.js +4 -0
  135. package/dist/trust/amd-genoa-chain.js.map +1 -0
  136. package/dist/trust/amd-turin-chain.js +4 -0
  137. package/dist/trust/amd-turin-chain.js.map +1 -0
  138. package/dist/trust/intel-sgx-root.js +4 -0
  139. package/dist/trust/intel-sgx-root.js.map +1 -0
  140. package/dist/trust/signing-keys.js +7 -0
  141. package/dist/trust/signing-keys.js.map +1 -0
  142. package/dist/trust/sigstore-trusted-root.js +4 -0
  143. package/dist/trust/sigstore-trusted-root.js.map +1 -0
  144. package/dist/verification.d.ts +134 -0
  145. package/dist/verification.d.ts.map +1 -0
  146. package/dist/verification.js +129 -0
  147. package/dist/verification.js.map +1 -0
  148. package/dist/verifier.d.ts +115 -0
  149. package/dist/verifier.d.ts.map +1 -0
  150. package/dist/verifier.js +565 -0
  151. package/dist/verifier.js.map +1 -0
  152. package/dist/version.js +2 -3
  153. package/dist/version.js.map +1 -1
  154. package/package.json +18 -10
  155. package/dist/attestation.d.ts +0 -14
  156. package/dist/attestation.d.ts.map +0 -1
  157. package/dist/attestation.js +0 -117
  158. package/dist/attestation.js.map +0 -1
  159. package/dist/bundle.d.ts +0 -15
  160. package/dist/bundle.d.ts.map +0 -1
  161. package/dist/bundle.js +0 -134
  162. package/dist/bundle.js.map +0 -1
  163. package/dist/cert-verify.d.ts +0 -30
  164. package/dist/cert-verify.d.ts.map +0 -1
  165. package/dist/cert-verify.js +0 -132
  166. package/dist/cert-verify.js.map +0 -1
  167. package/dist/client.d.ts +0 -17
  168. package/dist/client.d.ts.map +0 -1
  169. package/dist/client.js +0 -135
  170. package/dist/client.js.map +0 -1
  171. package/dist/dcode.d.ts +0 -7
  172. package/dist/dcode.d.ts.map +0 -1
  173. package/dist/dcode.js +0 -35
  174. package/dist/dcode.js.map +0 -1
  175. package/dist/json.d.ts +0 -3
  176. package/dist/json.d.ts.map +0 -1
  177. package/dist/json.js +0 -4
  178. package/dist/json.js.map +0 -1
  179. package/dist/sev/cert-chain.d.ts +0 -22
  180. package/dist/sev/cert-chain.d.ts.map +0 -1
  181. package/dist/sev/cert-chain.js +0 -253
  182. package/dist/sev/cert-chain.js.map +0 -1
  183. package/dist/sev/certs.d.ts +0 -3
  184. package/dist/sev/certs.d.ts.map +0 -1
  185. package/dist/sev/certs.js +0 -77
  186. package/dist/sev/certs.js.map +0 -1
  187. package/dist/sev/constants.d.ts +0 -20
  188. package/dist/sev/constants.d.ts.map +0 -1
  189. package/dist/sev/constants.js +0 -22
  190. package/dist/sev/constants.js.map +0 -1
  191. package/dist/sev/report.d.ts +0 -52
  192. package/dist/sev/report.d.ts.map +0 -1
  193. package/dist/sev/report.js +0 -228
  194. package/dist/sev/report.js.map +0 -1
  195. package/dist/sev/types.d.ts +0 -35
  196. package/dist/sev/types.d.ts.map +0 -1
  197. package/dist/sev/types.js +0 -2
  198. package/dist/sev/types.js.map +0 -1
  199. package/dist/sev/utils.d.ts +0 -7
  200. package/dist/sev/utils.d.ts.map +0 -1
  201. package/dist/sev/utils.js +0 -59
  202. package/dist/sev/utils.js.map +0 -1
  203. package/dist/sev/validation.d.ts +0 -39
  204. package/dist/sev/validation.d.ts.map +0 -1
  205. package/dist/sev/validation.js +0 -324
  206. package/dist/sev/validation.js.map +0 -1
  207. package/dist/sev/verify.d.ts +0 -11
  208. package/dist/sev/verify.d.ts.map +0 -1
  209. package/dist/sev/verify.js +0 -141
  210. package/dist/sev/verify.js.map +0 -1
  211. package/dist/sigstore-trusted-root.d.ts +0 -94
  212. package/dist/sigstore-trusted-root.d.ts.map +0 -1
  213. package/dist/sigstore-trusted-root.js +0 -127
  214. package/dist/sigstore-trusted-root.js.map +0 -1
  215. package/dist/sigstore.d.ts +0 -18
  216. package/dist/sigstore.d.ts.map +0 -1
  217. package/dist/sigstore.js +0 -119
  218. package/dist/sigstore.js.map +0 -1
  219. package/dist/types.d.ts +0 -94
  220. package/dist/types.d.ts.map +0 -1
  221. package/dist/types.js +0 -73
  222. package/dist/types.js.map +0 -1
  223. package/dist/version.d.ts +0 -4
  224. package/dist/version.d.ts.map +0 -1
@@ -1,324 +0,0 @@
1
- import { Report } from './report.js';
2
- import { CertificateChain } from './cert-chain.js';
3
- import { tcbFromInt, tcbMeetsMinimum, bytesToHex } from './utils.js';
4
- import { ReportSigner } from './constants.js';
5
- import { uint8ArrayEqual } from '@freedomofpress/crypto-browser';
6
- import { AttestationError } from '../errors.js';
7
- // Default validation options
8
- export const defaultValidationOptions = {
9
- guestPolicy: {
10
- abiMinor: 0,
11
- abiMajor: 0,
12
- smt: true,
13
- migrateMa: false,
14
- debug: false,
15
- singleSocket: false,
16
- cxlAllowed: false,
17
- memAes256Xts: false,
18
- raplDis: false,
19
- ciphertextHidingDram: false,
20
- pageSwapDisabled: false,
21
- },
22
- minimumGuestSvn: 0,
23
- minimumBuild: 21,
24
- minimumVersion: (1 << 8) | 55, // 1.55
25
- minimumTcb: {
26
- blSpl: 0x7,
27
- teeSpl: 0,
28
- snpSpl: 0xe,
29
- ucodeSpl: 0x48,
30
- },
31
- minimumLaunchTcb: {
32
- blSpl: 0x7,
33
- teeSpl: 0,
34
- snpSpl: 0xe,
35
- ucodeSpl: 0x48,
36
- },
37
- permitProvisionalFirmware: false,
38
- platformInfo: {
39
- smtEnabled: true,
40
- tsmeEnabled: true,
41
- eccEnabled: false,
42
- raplDisabled: false,
43
- ciphertextHidingDramEnabled: false,
44
- aliasCheckComplete: false,
45
- tioEnabled: false,
46
- },
47
- requireAuthorKey: false,
48
- requireIdBlock: false,
49
- };
50
- /**
51
- * Validate policy with security-aware checks.
52
- *
53
- * Logic:
54
- * - Check ABI version compatibility
55
- * - Reject unauthorized capabilities (report has them, required doesn't allow)
56
- * - Reject missing required restrictions/features
57
- *
58
- * @param reportPolicy - The policy from the attestation report
59
- * @param required - The required policy constraints
60
- * @throws Error if validation fails
61
- */
62
- function validatePolicy(reportPolicy, required) {
63
- // ABI version check - required version must not be greater than report version
64
- if (comparePolicyVersions(required, reportPolicy) > 0) {
65
- throw new AttestationError(`Required ABI version (${required.abiMajor}.${required.abiMinor}) is greater than report's ABI version (${reportPolicy.abiMajor}.${reportPolicy.abiMinor})`);
66
- }
67
- // Unauthorized capabilities (report has them enabled, but required doesn't allow)
68
- if (!required.migrateMa && reportPolicy.migrateMa) {
69
- throw new AttestationError('Security policy violation: Migration agent is enabled but not allowed');
70
- }
71
- if (!required.debug && reportPolicy.debug) {
72
- throw new AttestationError('Security policy violation: Debug mode is enabled but not allowed. The enclave must have debug disabled for production use');
73
- }
74
- if (!required.smt && reportPolicy.smt) {
75
- throw new AttestationError('Security policy violation: Simultaneous multithreading (SMT) is enabled but not allowed');
76
- }
77
- if (!required.cxlAllowed && reportPolicy.cxlAllowed) {
78
- throw new AttestationError('Security policy violation: CXL (Compute Express Link) is enabled but not allowed');
79
- }
80
- if (!required.memAes256Xts && reportPolicy.memAes256Xts) {
81
- throw new AttestationError('Security policy violation: AES-256-XTS memory encryption mode is enabled but not allowed');
82
- }
83
- // Required restrictions/features (report lacks what required mandates)
84
- if (required.singleSocket && !reportPolicy.singleSocket) {
85
- throw new AttestationError('Security policy violation: Single socket mode is required but not enabled');
86
- }
87
- if (required.memAes256Xts && !reportPolicy.memAes256Xts) {
88
- throw new AttestationError('Security policy violation: AES-256-XTS memory encryption mode is required but not enabled');
89
- }
90
- if (required.raplDis && !reportPolicy.raplDis) {
91
- throw new AttestationError('Security policy violation: RAPL (power monitoring) must be disabled but is enabled');
92
- }
93
- if (required.ciphertextHidingDram && !reportPolicy.ciphertextHidingDram) {
94
- throw new AttestationError('Security policy violation: DRAM ciphertext hiding is required but not enabled');
95
- }
96
- if (required.pageSwapDisabled && !reportPolicy.pageSwapDisabled) {
97
- throw new AttestationError('Security policy violation: Page swap must be disabled but is enabled');
98
- }
99
- }
100
- /**
101
- * Compare policy ABI versions.
102
- *
103
- * @param required - Required policy
104
- * @param report - Report policy
105
- * @returns > 0 if required version is greater than report version,
106
- * = 0 if versions are equal,
107
- * < 0 if required version is less than report version
108
- */
109
- function comparePolicyVersions(required, report) {
110
- // Compare major version first
111
- if (required.abiMajor !== report.abiMajor) {
112
- return required.abiMajor - report.abiMajor;
113
- }
114
- // If major versions are equal, compare minor versions
115
- return required.abiMinor - report.abiMinor;
116
- }
117
- function tcbPartsToString(tcb) {
118
- return `TCBParts(bootloader=${tcb.blSpl}, tee=${tcb.teeSpl}, snp=${tcb.snpSpl}, microcode=${tcb.ucodeSpl})`;
119
- }
120
- /**
121
- * Validate the supplied SEV-SNP attestation report according to options.
122
- *
123
- * @param report - The attestation report to validate
124
- * @param chain - The certificate chain
125
- * @param options - Validation options
126
- * @throws Error if validation fails
127
- */
128
- export function validateReport(report, chain, options) {
129
- // Policy constraints
130
- if (options.guestPolicy) {
131
- validatePolicy(report.policyParsed, options.guestPolicy);
132
- }
133
- if (options.minimumGuestSvn !== undefined) {
134
- if (report.guestSvn < options.minimumGuestSvn) {
135
- throw new AttestationError(`Guest SVN ${report.guestSvn} is less than minimum required ${options.minimumGuestSvn}`);
136
- }
137
- }
138
- if (options.minimumBuild !== undefined) {
139
- if (report.currentBuild < options.minimumBuild) {
140
- throw new AttestationError(`Current SNP firmware build number ${report.currentBuild} is less than minimum required ${options.minimumBuild}`);
141
- }
142
- if (report.committedBuild < options.minimumBuild) {
143
- throw new AttestationError(`Committed SNP firmware build number ${report.committedBuild} is less than minimum required ${options.minimumBuild}`);
144
- }
145
- }
146
- if (options.minimumVersion !== undefined) {
147
- const currentVersion = (report.currentMajor << 8) | report.currentMinor;
148
- const committedVersion = (report.committedMajor << 8) | report.committedMinor;
149
- if (currentVersion < options.minimumVersion) {
150
- throw new AttestationError(`Current SNP firmware version ${report.currentMajor}.${report.currentMinor} is less than minimum required ${options.minimumVersion >> 8}.${options.minimumVersion & 0xff}`);
151
- }
152
- if (committedVersion < options.minimumVersion) {
153
- throw new AttestationError(`Committed SNP firmware version ${report.committedMajor}.${report.committedMinor} is less than minimum required ${options.minimumVersion >> 8}.${options.minimumVersion & 0xff}`);
154
- }
155
- }
156
- // TCB requirements
157
- if (options.minimumTcb) {
158
- const currentTcbParts = tcbFromInt(report.currentTcb);
159
- const committedTcbParts = tcbFromInt(report.committedTcb);
160
- const reportedTcbParts = tcbFromInt(report.reportedTcb);
161
- if (!tcbMeetsMinimum(currentTcbParts, options.minimumTcb)) {
162
- throw new AttestationError(`Current TCB ${tcbPartsToString(currentTcbParts)} does not meet minimum requirements ${tcbPartsToString(options.minimumTcb)}`);
163
- }
164
- if (!tcbMeetsMinimum(committedTcbParts, options.minimumTcb)) {
165
- throw new AttestationError(`Committed TCB ${tcbPartsToString(committedTcbParts)} does not meet minimum requirements ${tcbPartsToString(options.minimumTcb)}`);
166
- }
167
- if (!tcbMeetsMinimum(reportedTcbParts, options.minimumTcb)) {
168
- throw new AttestationError(`Reported TCB ${tcbPartsToString(reportedTcbParts)} does not meet minimum requirements ${tcbPartsToString(options.minimumTcb)}`);
169
- }
170
- }
171
- // VCEK-specific TCB check
172
- chain.validateVcekTcb(tcbFromInt(report.reportedTcb));
173
- if (options.minimumLaunchTcb) {
174
- const launchTcbParts = tcbFromInt(report.launchTcb);
175
- if (!tcbMeetsMinimum(launchTcbParts, options.minimumLaunchTcb)) {
176
- throw new AttestationError(`Launch TCB ${tcbPartsToString(launchTcbParts)} does not meet minimum requirements ${tcbPartsToString(options.minimumLaunchTcb)}`);
177
- }
178
- }
179
- // Field equality checks
180
- if (options.reportData) {
181
- if (report.reportData.length !== 64) {
182
- throw new AttestationError(`Report data length is ${report.reportData.length}, expected 64 bytes`);
183
- }
184
- if (!uint8ArrayEqual(report.reportData, options.reportData)) {
185
- throw new AttestationError(`Report data mismatch: got ${bytesToHex(report.reportData)}, expected ${bytesToHex(options.reportData)}`);
186
- }
187
- }
188
- if (options.hostData) {
189
- if (report.hostData.length !== 32) {
190
- throw new AttestationError(`Host data length is ${report.hostData.length}, expected 32 bytes`);
191
- }
192
- if (!uint8ArrayEqual(report.hostData, options.hostData)) {
193
- throw new AttestationError(`Host data mismatch: got ${bytesToHex(report.hostData)}, expected ${bytesToHex(options.hostData)}`);
194
- }
195
- }
196
- if (options.measurement) {
197
- if (report.measurement.length !== 48) {
198
- throw new AttestationError(`Measurement length is ${report.measurement.length}, expected 48 bytes`);
199
- }
200
- if (!uint8ArrayEqual(report.measurement, options.measurement)) {
201
- throw new AttestationError(`Measurement mismatch: got ${bytesToHex(report.measurement)}, expected ${bytesToHex(options.measurement)}`);
202
- }
203
- }
204
- if (options.chipId) {
205
- if (report.chipId.length !== 64) {
206
- throw new AttestationError(`Chip ID length is ${report.chipId.length}, expected 64 bytes`);
207
- }
208
- if (!uint8ArrayEqual(report.chipId, options.chipId)) {
209
- throw new AttestationError(`Chip ID mismatch: got ${bytesToHex(report.chipId)}, expected ${bytesToHex(options.chipId)}`);
210
- }
211
- }
212
- if (options.imageId) {
213
- if (report.imageId.length !== 16) {
214
- throw new AttestationError(`Image ID length is ${report.imageId.length}, expected 16 bytes`);
215
- }
216
- if (!uint8ArrayEqual(report.imageId, options.imageId)) {
217
- throw new AttestationError(`Image ID mismatch: got ${bytesToHex(report.imageId)}, expected ${bytesToHex(options.imageId)}`);
218
- }
219
- }
220
- if (options.familyId) {
221
- if (report.familyId.length !== 16) {
222
- throw new AttestationError(`Family ID length is ${report.familyId.length}, expected 16 bytes`);
223
- }
224
- if (!uint8ArrayEqual(report.familyId, options.familyId)) {
225
- throw new AttestationError(`Family ID mismatch: got ${bytesToHex(report.familyId)}, expected ${bytesToHex(options.familyId)}`);
226
- }
227
- }
228
- if (options.reportId) {
229
- if (report.reportId.length !== 32) {
230
- throw new AttestationError(`Report ID length is ${report.reportId.length}, expected 32 bytes`);
231
- }
232
- if (!uint8ArrayEqual(report.reportId, options.reportId)) {
233
- throw new AttestationError(`Report ID mismatch: got ${bytesToHex(report.reportId)}, expected ${bytesToHex(options.reportId)}`);
234
- }
235
- }
236
- if (options.reportIdMa) {
237
- if (report.reportIdMa.length !== 32) {
238
- throw new AttestationError(`Report ID MA length is ${report.reportIdMa.length}, expected 32 bytes`);
239
- }
240
- if (!uint8ArrayEqual(report.reportIdMa, options.reportIdMa)) {
241
- throw new AttestationError(`Report ID MA mismatch: got ${bytesToHex(report.reportIdMa)}, expected ${bytesToHex(options.reportIdMa)}`);
242
- }
243
- }
244
- // VCEK-specific CHIP_ID ↔ HWID equality check
245
- if (report.signerInfoParsed.signingKey === ReportSigner.VcekReportSigner) {
246
- if (report.signerInfoParsed.maskChipKey && report.chipId.some(b => b !== 0)) {
247
- throw new AttestationError('Invalid attestation report: chip ID masking is enabled but chip ID field is not zeroed');
248
- }
249
- if (!report.signerInfoParsed.maskChipKey) {
250
- chain.validateVcekHwid(report.chipId);
251
- }
252
- }
253
- // Platform info check
254
- if (options.platformInfo) {
255
- validatePlatformInfo(report.platformInfoParsed, options.platformInfo);
256
- }
257
- // VMPL check
258
- if (options.vmpl !== undefined) {
259
- if (!(0 <= report.vmpl && report.vmpl <= 3)) {
260
- throw new AttestationError(`VMPL ${report.vmpl} is not in valid range 0-3`);
261
- }
262
- if (report.vmpl !== options.vmpl) {
263
- throw new AttestationError(`VMPL mismatch: got ${report.vmpl}, expected ${options.vmpl}`);
264
- }
265
- }
266
- // Provisional firmware check - we only support permitProvisionalFirmware = false
267
- if (options.permitProvisionalFirmware) {
268
- throw new AttestationError('Unsupported option: Provisional firmware validation is not yet implemented');
269
- }
270
- // When permitProvisionalFirmware = false, committed and current values must be equal
271
- if (report.committedBuild !== report.currentBuild) {
272
- throw new AttestationError(`Firmware version mismatch: Committed build (${report.committedBuild}) does not match current build (${report.currentBuild}). This may indicate provisional firmware`);
273
- }
274
- if (report.committedMinor !== report.currentMinor) {
275
- throw new AttestationError(`Firmware version mismatch: Committed minor version (${report.committedMinor}) does not match current (${report.currentMinor})`);
276
- }
277
- if (report.committedMajor !== report.currentMajor) {
278
- throw new AttestationError(`Firmware version mismatch: Committed major version (${report.committedMajor}) does not match current (${report.currentMajor})`);
279
- }
280
- if (report.committedTcb !== report.currentTcb) {
281
- throw new AttestationError(`Firmware version mismatch: Committed TCB does not match current TCB. This may indicate provisional firmware`);
282
- }
283
- // ID-block / author key requirements
284
- if (options.requireAuthorKey || options.requireIdBlock) {
285
- throw new AttestationError('Unsupported option: ID-block and author key validation is not yet implemented');
286
- }
287
- }
288
- /**
289
- * Validate platform info with security-aware checks.
290
- *
291
- * Logic:
292
- * - If report has a feature enabled that required doesn't allow -> FAIL
293
- * - If report lacks a feature that required mandates -> FAIL
294
- *
295
- * @param reportInfo - Platform info from the attestation report
296
- * @param required - Required platform info constraints
297
- * @throws Error if validation fails
298
- */
299
- function validatePlatformInfo(reportInfo, required) {
300
- // Unauthorized features (report has it enabled, but required doesn't allow it)
301
- if (reportInfo.smtEnabled && !required.smtEnabled) {
302
- throw new AttestationError('Platform policy violation: SMT (simultaneous multithreading) is enabled but not allowed');
303
- }
304
- // Required features (report lacks something that required mandates)
305
- if (!reportInfo.eccEnabled && required.eccEnabled) {
306
- throw new AttestationError('Platform policy violation: ECC memory is required but not enabled');
307
- }
308
- if (!reportInfo.tsmeEnabled && required.tsmeEnabled) {
309
- throw new AttestationError('Platform policy violation: TSME (transparent SME) is required but not enabled');
310
- }
311
- if (!reportInfo.raplDisabled && required.raplDisabled) {
312
- throw new AttestationError('Platform policy violation: RAPL (power monitoring) must be disabled but is enabled');
313
- }
314
- if (!reportInfo.ciphertextHidingDramEnabled && required.ciphertextHidingDramEnabled) {
315
- throw new AttestationError('Platform policy violation: DRAM ciphertext hiding is required but not enabled');
316
- }
317
- if (!reportInfo.aliasCheckComplete && required.aliasCheckComplete) {
318
- throw new AttestationError('Platform policy violation: Memory alias check is required but has not completed');
319
- }
320
- if (!reportInfo.tioEnabled && required.tioEnabled) {
321
- throw new AttestationError('Platform policy violation: TIO (trusted I/O) is required but not enabled');
322
- }
323
- }
324
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/sev/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA4ChD,8BAA8B;AAC9B,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,WAAW,EAAE;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,GAAG,EAAE,IAAI;QACT,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;QACd,oBAAoB,EAA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AI,gBAAgB,CAAC,oFAAoF,CAAC,CAAC;IACnH,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,2BAA2B,IAAI,QAAQ,CAAC,2BAA2B,EAAE,CAAC;QACpF,MAAM,IAAI,gBAAgB,CAAC,+EAA+E,CAAC,CAAC;IAC9G,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,kBAAkB,IAAI,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QAClE,MAAM,IAAI,gBAAgB,CAAC,iFAAiF,CAAC,CAAC;IAChH,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QAClD,MAAM,IAAI,gBAAgB,CAAC,0EAA0E,CAAC,CAAC;IACzG,CAAC;AACH,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Report } from './report.js';
2
- import type { CertificateChain } from './cert-chain.js';
3
- /**
4
- * Verify attestation report with the certificate chain.
5
- *
6
- * @param chain - The certificate chain (ARK > ASK > VCEK)
7
- * @param report - The attestation report
8
- * @returns True if verification succeeds
9
- */
10
- export declare function verifyAttestation(chain: CertificateChain, report: Report): Promise<boolean>;
11
- //# sourceMappingURL=verify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/sev/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+ExD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAgBlB"}
@@ -1,141 +0,0 @@
1
- import { POLICY_RESERVED_1_BIT } from './constants.js';
2
- import { KeyTypes, HashAlgorithms } from '@freedomofpress/crypto-browser';
3
- import { AttestationError, wrapOrThrow } from '../errors.js';
4
- /**
5
- * Verify the attestation report signature using VCEK's public key.
6
- *
7
- * @param vcekPublicKey - The VCEK public key
8
- * @param report - The attestation report
9
- * @returns True if signature is valid
10
- * @throws Error if validation fails
11
- */
12
- async function verifyReportSignature(vcekPublicKey, report) {
13
- // Validate Report Format
14
- if (report.version < 2) {
15
- throw new AttestationError(`Unsupported attestation report version ${report.version}. Minimum required version is 2`);
16
- }
17
- // Check reserved bit must be 1
18
- if (!(report.policy & (1n << BigInt(POLICY_RESERVED_1_BIT)))) {
19
- throw new AttestationError('Invalid attestation report: Policy field has invalid reserved bit');
20
- }
21
- // Check policy bits 63-26 must be zero
22
- if (report.policy >> 26n) {
23
- throw new AttestationError('Invalid attestation report: Policy field has non-zero reserved bits');
24
- }
25
- // Check signature algorithm must be ECDSA
26
- if (report.signatureAlgo !== 1) { // 1 = SignEcdsaP384Sha384
27
- throw new AttestationError(`Unsupported signature algorithm (${report.signatureAlgo}). Only ECDSA P-384 with SHA-384 (algorithm 1) is supported`);
28
- }
29
- // Convert the signature from AMD's little-endian format to WebCrypto raw format
30
- // The signature in the report is in raw R||S format in AMD's little-endian format
31
- // Each component is 72 bytes (0x48) for P384, zero-extended
32
- // WebCrypto expects raw format: R || S as big-endian, each padded to curve size (48 bytes for P-384)
33
- // Reverse bytes to convert from little-endian to big-endian
34
- const rBytesLE = report.signature.slice(0, 0x48);
35
- const sBytesLE = report.signature.slice(0x48, 0x90);
36
- const rBytesBE = reverseBytes(rBytesLE);
37
- const sBytesBE = reverseBytes(sBytesLE);
38
- // Strip leading zeros and convert to BigInt for normalization
39
- const r = bytesToBigInt(stripLeadingZeros(rBytesBE));
40
- const s = bytesToBigInt(stripLeadingZeros(sBytesBE));
41
- // Convert back to fixed 48-byte arrays (P-384 curve size)
42
- const rRaw = bigIntToFixedBytes(r, 48);
43
- const sRaw = bigIntToFixedBytes(s, 48);
44
- // Create raw signature: R || S
45
- const rawSignature = new Uint8Array(96);
46
- rawSignature.set(rRaw, 0);
47
- rawSignature.set(sRaw, 48);
48
- // Get the signed data - slice to ensure we have the correct view
49
- const signedData = report.signedData.slice();
50
- try {
51
- const isValid = await crypto.subtle.verify({ name: KeyTypes.Ecdsa, hash: HashAlgorithms.SHA384 }, vcekPublicKey, rawSignature, signedData);
52
- return isValid;
53
- }
54
- catch (e) {
55
- wrapOrThrow(e, AttestationError, 'Failed to verify attestation report signature using VCEK public key');
56
- }
57
- }
58
- /**
59
- * Verify attestation report with the certificate chain.
60
- *
61
- * @param chain - The certificate chain (ARK > ASK > VCEK)
62
- * @param report - The attestation report
63
- * @returns True if verification succeeds
64
- */
65
- export async function verifyAttestation(chain, report) {
66
- // Verify certificate chain
67
- const isChainValid = await chain.verifyChain();
68
- if (!isChainValid) {
69
- throw new AttestationError('AMD certificate chain verification failed: The chain from ARK to ASK to VCEK could not be verified');
70
- }
71
- // Get the CryptoKey from VCEK certificate
72
- // (EC P-384 key type is validated in validateVcekFormat during chain verification)
73
- const vcekPublicKey = await chain.vcekPublicKey;
74
- const isSignatureValid = await verifyReportSignature(vcekPublicKey, report);
75
- if (!isSignatureValid) {
76
- throw new AttestationError('Attestation report signature is invalid: The report was not signed by the expected VCEK key');
77
- }
78
- return true;
79
- }
80
- /**
81
- * Reverse the bytes in a bytes array.
82
- *
83
- * @param bytes - The bytes array to reverse
84
- * @returns The reversed bytes array
85
- */
86
- function reverseBytes(bytes) {
87
- return new Uint8Array([...bytes].reverse());
88
- }
89
- /**
90
- * Strip leading zeros from a bytes array.
91
- *
92
- * @param bytes - The bytes array to strip
93
- * @returns The bytes array without leading zeros
94
- */
95
- function stripLeadingZeros(bytes) {
96
- let start = 0;
97
- while (start < bytes.length && bytes[start] === 0) {
98
- start++;
99
- }
100
- if (start === bytes.length) {
101
- return new Uint8Array([0]);
102
- }
103
- return bytes.slice(start);
104
- }
105
- /**
106
- * Convert a bytes array to a bigint.
107
- *
108
- * @param bytes - The bytes array to convert
109
- * @returns The bigint
110
- */
111
- function bytesToBigInt(bytes) {
112
- if (bytes.length === 0) {
113
- return 0n;
114
- }
115
- let result = 0n;
116
- for (const byte of bytes) {
117
- result = (result << 8n) | BigInt(byte);
118
- }
119
- return result;
120
- }
121
- /**
122
- * Convert a bigint to a fixed-size bytes array (big-endian, zero-padded).
123
- *
124
- * @param value - The bigint to convert
125
- * @param size - The desired size in bytes
126
- * @returns The bytes array
127
- */
128
- function bigIntToFixedBytes(value, size) {
129
- let hex = value.toString(16);
130
- if (hex.length % 2) {
131
- hex = '0' + hex;
132
- }
133
- const bytes = new Uint8Array(size);
134
- const hexBytes = hex.length / 2;
135
- const startOffset = size - hexBytes;
136
- for (let i = 0; i < hexBytes; i++) {
137
- bytes[startOffset + i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
138
- }
139
- return bytes;
140
- }
141
- //# sourceMappingURL=verify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/sev/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;GAOG;AACH,KAAK,UAAU,qBAAqB,CAClC,aAAwB,EACxB,MAAc;IAEd,yBAAyB;IACzB,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,gBAAgB,CAAC,0CAA0C,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC;IACxH,CAAC;IAED,+BAA+B;IAC/B,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,gBAAgB,CAAC,mEAAmE,CAAC,CAAC;IAClG,CAAC;IAED,uCAAuC;IACvC,IAAI,MAAM,CAAC,MAAM,IAAI,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C,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,94 +0,0 @@
1
- declare const _default: {
2
- mediaType: string;
3
- tlogs: {
4
- baseUrl: string;
5
- hashAlgorithm: string;
6
- publicKey: {
7
- rawBytes: string;
8
- keyDetails: string;
9
- validFor: {
10
- start: string;
11
- };
12
- };
13
- logId: {
14
- keyId: string;
15
- };
16
- }[];
17
- certificateAuthorities: ({
18
- subject: {
19
- organization: string;
20
- commonName: string;
21
- };
22
- uri: string;
23
- certChain: {
24
- certificates: {
25
- rawBytes: string;
26
- }[];
27
- };
28
- validFor: {
29
- start: string;
30
- end: string;
31
- };
32
- } | {
33
- subject: {
34
- organization: string;
35
- commonName: string;
36
- };
37
- uri: string;
38
- certChain: {
39
- certificates: {
40
- rawBytes: string;
41
- }[];
42
- };
43
- validFor: {
44
- start: string;
45
- end?: undefined;
46
- };
47
- })[];
48
- ctlogs: ({
49
- baseUrl: string;
50
- hashAlgorithm: string;
51
- publicKey: {
52
- rawBytes: string;
53
- keyDetails: string;
54
- validFor: {
55
- start: string;
56
- end: string;
57
- };
58
- };
59
- logId: {
60
- keyId: string;
61
- };
62
- } | {
63
- baseUrl: string;
64
- hashAlgorithm: string;
65
- publicKey: {
66
- rawBytes: string;
67
- keyDetails: string;
68
- validFor: {
69
- start: string;
70
- end?: undefined;
71
- };
72
- };
73
- logId: {
74
- keyId: string;
75
- };
76
- })[];
77
- timestampAuthorities: {
78
- subject: {
79
- organization: string;
80
- commonName: string;
81
- };
82
- uri: string;
83
- certChain: {
84
- certificates: {
85
- rawBytes: string;
86
- }[];
87
- };
88
- validFor: {
89
- start: string;
90
- };
91
- }[];
92
- };
93
- export default _default;
94
- //# sourceMappingURL=sigstore-trusted-root.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sigstore-trusted-root.d.ts","sourceRoot":"","sources":["../src/sigstore-trusted-root.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA6HE"}