import java.util.zip.ZipEntry;\r
import java.util.zip.ZipInputStream;\r
\r
+import javax.crypto.Cipher;\r
+\r
import org.apache.poi.POIDataSamples;\r
import org.apache.poi.poifs.filesystem.DirectoryNode;\r
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;\r
import org.apache.poi.poifs.filesystem.POIFSFileSystem;\r
import org.apache.poi.util.IOUtils;\r
import org.apache.poi.xssf.XSSFTestDataSamples;\r
+import org.junit.Assume;\r
import org.junit.Test;\r
\r
public class TestDecryptor {\r
\r
@Test\r
public void bug60320() throws IOException, GeneralSecurityException {\r
+ int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");\r
+ Assume.assumeTrue("Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256", maxKeyLen == 2147483647);\r
+\r
InputStream is = POIDataSamples.getPOIFSInstance().openResourceAsStream("60320-protected.xlsx");\r
POIFSFileSystem fs = new POIFSFileSystem(is);\r
is.close();\r
*/\r
@Test\r
public void bug60320CustomEncrypt() throws Exception {\r
+ int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");\r
+ Assume.assumeTrue("Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256", maxKeyLen == 2147483647);\r
+\r
// --- src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java (revision 1766745)\r
// +++ src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java (working copy)\r
// @@ -208,6 +208,13 @@\r