cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [2/5] cassandra git commit: Revert "ninja-fix an assert in CipherFactory, and added tests for it"
Date Thu, 06 Aug 2015 14:08:49 GMT
Revert "ninja-fix an assert in CipherFactory, and added tests for it"

This reverts commit f54580d0715a9189ba1658ad036e7d19cecdc3c8.


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f8ccb39e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f8ccb39e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f8ccb39e

Branch: refs/heads/cassandra-3.0
Commit: f8ccb39ec4884023693925b3982d23a864a8d717
Parents: 0dd50a6
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Thu Aug 6 15:22:03 2015 +0200
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Thu Aug 6 16:08:05 2015 +0200

----------------------------------------------------------------------
 .../org/apache/cassandra/security/CipherFactory.java    |  2 +-
 .../apache/cassandra/security/CipherFactoryTest.java    | 12 ------------
 2 files changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8ccb39e/src/java/org/apache/cassandra/security/CipherFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/security/CipherFactory.java b/src/java/org/apache/cassandra/security/CipherFactory.java
index 7c1495a..0ff9867 100644
--- a/src/java/org/apache/cassandra/security/CipherFactory.java
+++ b/src/java/org/apache/cassandra/security/CipherFactory.java
@@ -109,7 +109,7 @@ public class CipherFactory
 
     public Cipher getDecryptor(String transformation, String keyAlias, byte[] iv) throws
IOException
     {
-        assert iv != null && iv.length > 0 : "trying to decrypt, but the initialization
vector is empty";
+        assert iv != null || iv.length > 0 : "trying to decrypt, but the initialization
vector is empty";
         return buildCipher(transformation, keyAlias, iv, Cipher.DECRYPT_MODE);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8ccb39e/test/unit/org/apache/cassandra/security/CipherFactoryTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/security/CipherFactoryTest.java b/test/unit/org/apache/cassandra/security/CipherFactoryTest.java
index bb6f7ce..4239973 100644
--- a/test/unit/org/apache/cassandra/security/CipherFactoryTest.java
+++ b/test/unit/org/apache/cassandra/security/CipherFactoryTest.java
@@ -84,16 +84,4 @@ public class CipherFactoryTest
         Cipher c2 = cipherFactory.buildCipher(encryptionOptions.cipher, EncryptionContextGenerator.KEY_ALIAS_2,
nextIV(), Cipher.DECRYPT_MODE);
         Assert.assertFalse(c1 == c2);
     }
-
-    @Test(expected = AssertionError.class)
-    public void getDecryptor_NullIv() throws IOException
-    {
-        cipherFactory.getDecryptor(encryptionOptions.cipher, encryptionOptions.key_alias,
null);
-    }
-
-    @Test(expected = AssertionError.class)
-    public void getDecryptor_EmptyIv() throws IOException
-    {
-        cipherFactory.getDecryptor(encryptionOptions.cipher, encryptionOptions.key_alias,
new byte[0]);
-    }
 }


Mime
View raw message