Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133535

Better exception messaging in Ucrypto code

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b83
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        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());
                 }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  coffeys Sean Coffey
                  Reporter:
                  coffeys Sean Coffey
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: