8233801: GCMEmptyIv.java test fails on Solaris 11.4
authorcoffeys
Thu, 21 Nov 2019 11:31:58 +0000
changeset 59199 a096dfdcabde
parent 59198 92c98aa0f801
child 59200 a686b67a59d9
8233801: GCMEmptyIv.java test fails on Solaris 11.4 Reviewed-by: valeriep
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java	Thu Nov 21 11:42:54 2019 +0100
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java	Thu Nov 21 11:31:58 2019 +0000
@@ -324,6 +324,9 @@
         try {
             initialize();
         } catch (PKCS11Exception e) {
+            if (e.getErrorCode() == CKR_MECHANISM_PARAM_INVALID) {
+                throw new InvalidAlgorithmParameterException("Bad params", e);
+            }
             throw new InvalidKeyException("Could not initialize cipher", e);
         }
     }