diff options
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java | 6 | ||||
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java index 19dc34b84e..e17e2dcb81 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java @@ -29,12 +29,15 @@ import java.security.GeneralSecurityException; import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import javax.crypto.Cipher;
+
import org.apache.poi.POIDataSamples;
import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.XSSFTestDataSamples;
+import org.junit.Assume;
import org.junit.Test;
public class TestDecryptor {
@@ -161,6 +164,9 @@ public class TestDecryptor { @Test
public void bug60320() throws IOException, GeneralSecurityException {
+ int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
+ Assume.assumeTrue("Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256", maxKeyLen == 2147483647);
+
InputStream is = POIDataSamples.getPOIFSInstance().openResourceAsStream("60320-protected.xlsx");
POIFSFileSystem fs = new POIFSFileSystem(is);
is.close();
diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java index f3e6c97e4c..4a411cc3d9 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java @@ -394,6 +394,9 @@ public class TestEncryptor { */
@Test
public void bug60320CustomEncrypt() throws Exception {
+ int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
+ Assume.assumeTrue("Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256", maxKeyLen == 2147483647);
+
// --- src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java (revision 1766745)
// +++ src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java (working copy)
// @@ -208,6 +208,13 @@
|