-
Bug
-
Resolution: Unresolved
-
P4
-
8, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
DESKeySpec.isWeak doesn't check negative offset and throws ArrayIndexOutOfBoundsException
ACTUAL -
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 8
at java.base/javax.crypto.spec.DESKeySpec.isWeak(DESKeySpec.java:230)
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
byte[] strongKey = {
(byte)0x12, (byte)0x34, (byte)0x56, (byte)0x78,
(byte)0x9A, (byte)0xBC, (byte)0xDE, (byte)0xF0
};
try {
DESKeySpec.isWeak(strongKey, -1);
System.out.println("Error: Negative offset didn't throw InvalidKeyException");
} catch (InvalidKeyException e) {
}
}
---------- END SOURCE ----------
DESKeySpec.isWeak doesn't check negative offset and throws ArrayIndexOutOfBoundsException
ACTUAL -
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 8
at java.base/javax.crypto.spec.DESKeySpec.isWeak(DESKeySpec.java:230)
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
byte[] strongKey = {
(byte)0x12, (byte)0x34, (byte)0x56, (byte)0x78,
(byte)0x9A, (byte)0xBC, (byte)0xDE, (byte)0xF0
};
try {
DESKeySpec.isWeak(strongKey, -1);
System.out.println("Error: Negative offset didn't throw InvalidKeyException");
} catch (InvalidKeyException e) {
}
}
---------- END SOURCE ----------