You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2013/10/23 13:03:21 UTC
svn commit: r1534984 -
/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
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;
}
}