From 4adb907371925d48ff3cd42cedbd644080b064c2 Mon Sep 17 00:00:00 2001
From: david_page <david_page@localhost>
Date: Mon, 15 Oct 2007 17:37:06 +0000
Subject: [PATCH] no issue CryptoManager Add a single-byte version number prefix to the ciphertext prologue to allow for configurable options (e.g., signed hash in the backup stream). The current version produced and accepted is 0x01.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/CryptoManagerTestCase.java | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/CryptoManagerTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/CryptoManagerTestCase.java
index a9a304c..727532e 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/CryptoManagerTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/CryptoManagerTestCase.java
@@ -202,6 +202,7 @@
// default (preferred) AES/CBC/PKCS5Padding 128bit key.
paramList.add(new CipherParameters(null, null, null, 128, 128));
// custom
+// TODO: https://opends.dev.java.net/issues/show_bug.cgi?id=2448
// TODO: paramList.add(new CipherParameters("Blowfish", "CFB", "NoPadding", 448, 64));
paramList.add(new CipherParameters("Blowfish", "CFB", "NoPadding", 128, 64));
paramList.add(new CipherParameters("RC4", null, null, 104, 0));
@@ -306,8 +307,8 @@
try {
Method m = Arrays.class.getMethod("copyOfRange", (new byte[16]).getClass(),
Integer.TYPE, Integer.TYPE);
- final byte[] keyID = (byte[])m.invoke(null, cipherText, 0, 16);
- final byte[] keyID2 = (byte[])m.invoke(null, cipherText2, 0, 16);
+ final byte[] keyID = (byte[])m.invoke(null, cipherText, 1, 16);
+ final byte[] keyID2 = (byte[])m.invoke(null, cipherText2, 1, 16);
assertEquals(keyID, keyID2);
}
catch (NoSuchMethodException ex) {
@@ -427,8 +428,8 @@
// 1. Test for distinct keys.
final byte[] keyID = new byte[16];
final byte[] keyID2 = new byte[16];
- System.arraycopy(cipherText, 0, keyID, 0, 16);
- System.arraycopy(cipherText2, 0, keyID2, 0, 16);
+ System.arraycopy(cipherText, 1, keyID, 0, 16);
+ System.arraycopy(cipherText2, 1, keyID2, 0, 16);
assertTrue(! Arrays.equals(keyID, keyID2));
// 2. Confirm ciphertext produced using the compromised key can still be
@@ -440,8 +441,7 @@
// using a compromised key can no longer be decrypted.
for (Entry e : searchOp.getSearchEntries()) {
TestCaseUtils.applyModifications(
- "dn: " + e.getDN().toNormalizedString(),
- "changetype: delete");
+ "dn: " + e.getDN().toNormalizedString(), "changetype: delete");
}
Thread.sleep(1000); // Clearing the cache is asynchronous.
try {
--
Gitblit v1.10.0