Commit dc6cc9e
authored
Never attempt to process an RSA 16K key on Android
Android's Conscrypt does not appear to process RSA 16K keys. It also
does not appropriately clear BoringSSL's error queue, so when you
attempt to import an RSA 16K key, the error may appear elsewhere, which
can produce nonsense errors.
For example, attempting to import an RSA 16K key, then doing
ChaCha20Poly1305 with a bad tag would raise an
`java.security.InvalidKeyException: error:04000080:RSA
routines:OPENSSL_internal:MODULUS_TOO_LARGE`, which is of course an
incorrect exception for Cipher's ChaCha20/Poly1305 to raise.
The "best" fix for this currently is to simply never touch an RSA 16K
key from our unit tests. We don't have direct access to BoringSSL's
error queue, so we can't manage it or inspect it to fix the problem on
the RSA side.
Actual APIs that clear the error queue are somewhat costly. We can
investigate some of those but we are relying on side effects that may
not always hold.
This is the easiest fix so far that doesn't require somewhat undesirable
changes in actual product code.1 parent 92236e1 commit dc6cc9e
3 files changed
Lines changed: 11 additions & 4 deletions
File tree
- src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/SignVerify.cs
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
| 1025 | + | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
| |||
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
1101 | | - | |
| 1101 | + | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| |||
0 commit comments