mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8205720: KeyFactory#getKeySpec and translateKey thorws NullPointerException with Invalid key
Updated SunRsaSign provider to check and throw InvalidKeyException for null key algo/format/encoding Reviewed-by: xuelei
This commit is contained in:
parent
11184615a8
commit
ecc5979769
4 changed files with 33 additions and 21 deletions
|
@ -123,6 +123,10 @@ public final class RSAPrivateCrtKeyImpl
|
|||
* Construct a key from its encoding. Called from newKey above.
|
||||
*/
|
||||
RSAPrivateCrtKeyImpl(byte[] encoded) throws InvalidKeyException {
|
||||
if (encoded == null || encoded.length == 0) {
|
||||
throw new InvalidKeyException("Missing key encoding");
|
||||
}
|
||||
|
||||
decode(encoded);
|
||||
RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue