Commit dc034a4
crypto: reject ML-KEM/ML-DSA PKCS#8 import without seed in SubtleCrypto
Reject importing ML-KEM and ML-DSA PKCS#8 private keys that do not
include a seed, throwing NotSupportedError.
Also add tests for importing PKCS#8 keys with a mismatched expanded key.
Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/34
PR-URL: #62218
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>1 parent 384a410 commit dc034a4Copy full SHA for dc034a4
5 files changed
+100-56Lines changed: 100 additions & 56 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib/internal/crypto
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+4Lines changed: 4 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1259 | 1259 | |
1260 | 1260 | |
1261 | 1261 | |
| 1262 | + |
| 1263 | + |
| 1264 | + |
| 1265 | + |
1262 | 1266 | |
1263 | 1267 | |
1264 | 1268 | |
|
Collapse file
lib/internal/crypto/ml_dsa.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/ml_dsa.js+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
192 | 192 | |
193 | 193 | |
194 | 194 | |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
195 | 208 | |
196 | 209 | |
197 | 210 | |
|
Collapse file
lib/internal/crypto/ml_kem.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/ml_kem.js+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
182 | 182 | |
183 | 183 | |
184 | 184 | |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
185 | 198 | |
186 | 199 | |
187 | 200 | |
|
Collapse file
test/parallel/test-webcrypto-export-import-ml-dsa.js
Copy file name to clipboardExpand all lines: test/parallel/test-webcrypto-export-import-ml-dsa.js+35-28Lines changed: 35 additions & 28 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
| 15 | + |
15 | 16 | |
16 | 17 | |
17 | 18 | |
| ||
196 | 197 | |
197 | 198 | |
198 | 199 | |
199 | | - |
200 | | - |
201 | | - |
202 | | - |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | | - |
208 | | - |
209 | | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | | - |
215 | | - |
216 | | - |
217 | | - |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
218 | 210 | |
219 | | - |
220 | | - |
221 | | - |
222 | | - |
223 | | - |
224 | | - |
| 211 | + |
225 | 212 | |
| 213 | + |
| 214 | + |
| 215 | + |
226 | 216 | |
227 | 217 | |
228 | 218 | |
229 | | - |
| 219 | + |
230 | 220 | |
231 | 221 | |
232 | | - |
233 | | - |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
234 | 226 | |
235 | 227 | |
236 | 228 | |
| ||
493 | 485 | |
494 | 486 | |
495 | 487 | |
| 488 | + |
496 | 489 | |
497 | 490 | |
498 | 491 | |
| ||
509 | 502 | |
510 | 503 | |
511 | 504 | |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
| 514 | + |
| 515 | + |
| 516 | + |
| 517 | + |
| 518 | + |
Collapse file
test/parallel/test-webcrypto-export-import-ml-kem.js
Copy file name to clipboardExpand all lines: test/parallel/test-webcrypto-export-import-ml-kem.js+35-28Lines changed: 35 additions & 28 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
| 15 | + |
15 | 16 | |
16 | 17 | |
17 | 18 | |
| ||
179 | 180 | |
180 | 181 | |
181 | 182 | |
182 | | - |
183 | | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
188 | | - |
189 | | - |
190 | | - |
191 | | - |
192 | | - |
193 | | - |
194 | | - |
195 | | - |
196 | | - |
197 | | - |
198 | | - |
199 | | - |
200 | | - |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
201 | 193 | |
202 | | - |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | | - |
| 194 | + |
208 | 195 | |
| 196 | + |
| 197 | + |
| 198 | + |
209 | 199 | |
210 | 200 | |
211 | 201 | |
212 | | - |
| 202 | + |
213 | 203 | |
214 | 204 | |
215 | | - |
216 | | - |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
217 | 209 | |
218 | 210 | |
219 | 211 | |
| ||
298 | 290 | |
299 | 291 | |
300 | 292 | |
| 293 | + |
301 | 294 | |
302 | 295 | |
303 | 296 | |
| ||
313 | 306 | |
314 | 307 | |
315 | 308 | |
| 309 | + |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
| 314 | + |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
0 commit comments