Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b83
-
generic
-
generic
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142058 | emb-9 | Sean Coffey | P4 | Resolved | Fixed | team |
JDK-8156416 | 8u111 | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8149057 | 8u102 | Sean Coffey | P4 | Resolved | Fixed | b02 |
JDK-8162282 | emb-8u111 | Sean Coffey | P4 | Resolved | Fixed | b01 |
Description
Some areas of exception handling in Ucrypto could be improved to give more information back to end user.
e.g. :
--- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
+++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
@@ -204,9 +204,11 @@
// Make sure the proper opmode uses the proper key
if (doEncrypt && (!(newKey instanceof RSAPublicKey))) {
- throw new InvalidKeyException("RSAPublicKey required for encryption");
+ throw new InvalidKeyException("RSAPublicKey required for encryption." +
+ " Received: " + newKey.getClass().getName());
} else if (!doEncrypt && (!(newKey instanceof RSAPrivateCrtKey))) {
- throw new InvalidKeyException("RSAPrivateCrtKey required for decryption");
+ throw new InvalidKeyException("RSAPrivateCrtKey required for decryption." +
+ " Received: " + newKey.getClass().getName());
}
e.g. :
--- a/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
+++ b/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java
@@ -204,9 +204,11 @@
// Make sure the proper opmode uses the proper key
if (doEncrypt && (!(newKey instanceof RSAPublicKey))) {
- throw new InvalidKeyException("RSAPublicKey required for encryption");
+ throw new InvalidKeyException("RSAPublicKey required for encryption." +
+ " Received: " + newKey.getClass().getName());
} else if (!doEncrypt && (!(newKey instanceof RSAPrivateCrtKey))) {
- throw new InvalidKeyException("RSAPrivateCrtKey required for decryption");
+ throw new InvalidKeyException("RSAPrivateCrtKey required for decryption." +
+ " Received: " + newKey.getClass().getName());
}
Attachments
Issue Links
- backported by
-
JDK-8142058 Better exception messaging in Ucrypto code
- Resolved
-
JDK-8149057 Better exception messaging in Ucrypto code
- Resolved
-
JDK-8156416 Better exception messaging in Ucrypto code
- Resolved
-
JDK-8162282 Better exception messaging in Ucrypto code
- Resolved
- relates to
-
JDK-8132082 Let OracleUcrypto accept RSAPrivateKey
- Closed