Commit 9afa965
committed
Honor requested key usages in RSA generateKey
- msrcryptoRsa.generateKeyPair previously ignored the caller's requested
usages (the usages: null || ... was a dead no-op) and forced a fixed pair,
unlike AES/ECDH/ECDSA and RSA importKey which preserve p.usages.
- It now filters the requested usages into the half each applies to:
verify/sign for RSASSA-PKCS1-v1_5 and RSA-PSS; encrypt/wrapKey (public) and
decrypt/unwrapKey (private) for RSA-OAEP/RSAES. Defaults to all valid usages
when none are requested.
- Fixes generating an RSA-OAEP key with ["wrapKey","unwrapKey"] producing a
key that could not be used with subtle.wrapKey (rejected InvalidAccessError).1 parent 1e9eabf commit 9afa965
2 files changed
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
10 | 24 | | |
11 | 25 | | |
12 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
472 | | - | |
473 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
474 | 483 | | |
475 | 484 | | |
476 | 485 | | |
| |||
481 | 490 | | |
482 | 491 | | |
483 | 492 | | |
484 | | - | |
| 493 | + | |
485 | 494 | | |
486 | 495 | | |
487 | 496 | | |
| |||
490 | 499 | | |
491 | 500 | | |
492 | 501 | | |
493 | | - | |
| 502 | + | |
494 | 503 | | |
495 | 504 | | |
496 | 505 | | |
| |||
0 commit comments