JDK-2192273 : Missing CKR_ values in PKCS11Exception
  • Type: Backport
  • Backport of: JDK-6944361
  • Component: security-libs
  • Sub-Component: javax.crypto:pkcs11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2010-04-28
  • Updated: 2010-12-06
  • Resolved: 2010-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7Fixed OpenJDK6Fixed
Comments
SUGGESTED FIX # HG changeset patch # User andrew # Date 1271408053 -3600 # Node ID c3a035784a3a27c2fe77691f67ecd5f07bbc19d4 # Parent 4684c385160e5a763436773e24013a967b38da14 6944361: Missing CKR_ values in PKCS11Exception Summary: Allow native NSS errors to be observed and correctly reported Reviewed-by: wetmore, valeriep --- a/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java Wed Mar 26 17:38:26 2008 +0300 +++ b/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java Fri Apr 16 09:54:13 2010 +0100 @@ -148,6 +148,7 @@ public class PKCS11Exception extends Exc 0x00000115, 0x00000120, 0x00000121, + 0x00000130, 0x00000150, 0x00000160, 0x00000170, @@ -156,6 +157,7 @@ public class PKCS11Exception extends Exc 0x00000191, 0x000001A0, 0x000001A1, + 0x00000200, 0x80000000, }; String[] errorMessages = new String[] { @@ -234,6 +236,7 @@ public class PKCS11Exception extends Exc "CKR_WRAPPING_KEY_TYPE_INCONSISTENT", "CKR_RANDOM_SEED_NOT_SUPPORTED", "CKR_RANDOM_NO_RNG", + "CKR_DOMAIN_PARAMS_INVALID", "CKR_BUFFER_TOO_SMALL", "CKR_SAVED_STATE_INVALID", "CKR_INFORMATION_SENSITIVE", @@ -242,6 +245,7 @@ public class PKCS11Exception extends Exc "CKR_CRYPTOKI_ALREADY_INITIALIZED", "CKR_MUTEX_BAD", "CKR_MUTEX_NOT_LOCKED", + "CKR_FUNCTION_REJECTED", "CKR_VENDOR_DEFINED", }; errorMap = new HashMap<Long,String>(); --- a/src/share/classes/sun/security/x509/X509Key.java Wed Mar 26 17:38:26 2008 +0300 +++ b/src/share/classes/sun/security/x509/X509Key.java Fri Apr 16 09:54:13 2010 +0100 @@ -171,7 +171,7 @@ public class X509Key implements PublicKe in.data.getUnalignedBitString()); } catch (InvalidKeyException e) { - throw new IOException("subject key, " + e.getMessage()); + throw new IOException("subject key, " + e.getMessage(), e); } if (in.data.available() != 0) @@ -224,7 +224,7 @@ public class X509Key implements PublicKe } catch (NoSuchAlgorithmException e) { // Return generic X509Key with opaque key data (see below) } catch (InvalidKeySpecException e) { - throw new InvalidKeyException(e.getMessage()); + throw new InvalidKeyException(e.getMessage(), e); } /*
29-04-2010

PUBLIC COMMENTS See http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/c3a035784a3a
29-04-2010

EVALUATION A fine backport.
28-04-2010