commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1534984 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
Date Wed, 23 Oct 2013 11:03:21 GMT
Author: bodewig
Date: Wed Oct 23 11:03:21 2013
New Revision: 1534984

URL: http://svn.apache.org/r1534984
Log:
Jörg's solution is a lot simpler

Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java?rev=1534984&r1=1534983&r2=1534984&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
Wed Oct 23 11:03:21 2013
@@ -19,9 +19,8 @@ package org.apache.commons.compress.arch
 
 import java.io.File;
 import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
 import javax.crypto.Cipher;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
 import org.apache.commons.compress.AbstractTestCase;
 
 public class SevenZFileTest extends AbstractTestCase {
@@ -113,15 +112,7 @@ public class SevenZFileTest extends Abst
         }
     }
 
-    private static boolean isStrongCryptoAvailable() {
-        try {
-            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
-            cipher.init(Cipher.DECRYPT_MODE,
-                        new SecretKeySpec(new byte[32], "AES"),
-                        new IvParameterSpec(new byte[16]));
-            return true;
-        } catch (Exception e) {
-        }
-        return false;
+    private static boolean isStrongCryptoAvailable() throws NoSuchAlgorithmException {
+        return Cipher.getMaxAllowedKeyLength("AES/ECB/PKCS5Padding") >= 256;
     }
 }



Mime
View raw message