--- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java Fri Jun 29 13:58:16 2018 -0700
+++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java Sat Jun 30 00:33:05 2018 +0000
@@ -123,6 +123,10 @@
* 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 {