fix for JDK 1.5 CipherInputStream
@@ -60,17 +60,32 @@ private void testModes(String algo, String[] transforms, boolean authenticated)
testWriteReadEmpty(cipherName, key, authenticated, false, true);
}
+
+
if (authenticated)
{
+ boolean aeadAvailable = false;
+ try
+ {
+ this.getClass().getClassLoader().loadClass("javax.crypto.spec.GCMParameterSpec");
+ aeadAvailable = true;
+ }
+ catch (ClassNotFoundException e)
+ {
+ }
+
testTamperedRead(cipherName, key, true, true);
- testTamperedRead(cipherName, key, true, false);
testTruncatedRead(cipherName, key, true, true);
- testTruncatedRead(cipherName, key, true, false);
testTamperedWrite(cipherName, key, true, true);
+ if (aeadAvailable)
+ {
+ testTamperedRead(cipherName, key, true, false);
+ testTruncatedRead(cipherName, key, true, false);
testTamperedWrite(cipherName, key, true, false);
}
}
}
+ }
private InputStream createInputStream(byte[] data, Cipher cipher, boolean useBc)
{
