Index: modules/security/src/common/javasrc/javax/crypto/spec/DESKeySpec.java =================================================================== --- modules/security/src/common/javasrc/javax/crypto/spec/DESKeySpec.java (revision 389432) +++ modules/security/src/common/javasrc/javax/crypto/spec/DESKeySpec.java (working copy) @@ -93,9 +93,6 @@ }; - private static final InvalidKeyException INCORRECT_KEY_EXCEPTION = - new InvalidKeyException("The specified key material is incorrect."); - /** * @com.intel.drl.spec_ref */ @@ -112,9 +109,7 @@ throw new NullPointerException("Key material is null."); } if (key.length - offset < DES_KEY_LEN) { - throw INCORRECT_KEY_EXCEPTION; - //new InvalidKeyException( - // "The key material is shorter than 8 bytes"); + throw new InvalidKeyException("The key material is shorter than 8 bytes"); } this.key = new byte[DES_KEY_LEN]; System.arraycopy(key, offset, this.key, 0, DES_KEY_LEN); @@ -134,10 +129,12 @@ */ public static boolean isParityAdjusted(byte[] key, int offset) throws InvalidKeyException { - if (key == null || key.length - offset < DES_KEY_LEN) { - throw INCORRECT_KEY_EXCEPTION; - //throw new InvalidKeyException("Incorrect key material."); + if (key == null) { + throw new InvalidKeyException("Key material is null."); } + if (key.length - offset < DES_KEY_LEN) { + throw new InvalidKeyException("The key material is shorter than 8 bytes"); + } for (int i=offset; i> 1) + ((b & 4) >> 2) @@ -154,10 +151,12 @@ */ public static boolean isWeak(byte[] key, int offset) throws InvalidKeyException { - if (key == null || key.length - offset < DES_KEY_LEN) { - throw INCORRECT_KEY_EXCEPTION; - //throw new InvalidKeyException("Incorrect key material."); + if (key == null) { + throw new InvalidKeyException("Key material is null."); } + if (key.length - offset < DES_KEY_LEN) { + throw new InvalidKeyException("The key material is shorter than 8 bytes"); + } I: for (int i=0; i