[jira] [Commented] (ODFTOOLKIT-402) ZipException on encrypted files: only DEFLATED entries can have EXT descriptor
[ https://issues.apache.org/jira/browse/ODFTOOLKIT-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14742038#comment-14742038 ] Svante Schubert commented on ODFTOOLKIT-402: Could you take a another look into the validator? The same problem still occurs in the validator, I have added a test validateEncryptedODT() to the project. If we only use ZipFile in opposite to ZipInputStream is there still a way of in-memory storing of the document? As the mimetype is the first file in the ZIP without compression, there is no "data-descriptor" allowed. Could we avoid this descriptor somehow? http://stackoverflow.com/questions/15738312/how-to-fix-org-apache-commons-compress-archivers-zip-unsupportedzipfeatureexcept > ZipException on encrypted files: only DEFLATED entries can have EXT descriptor > -- > > Key: ODFTOOLKIT-402 > URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-402 > Project: ODF Toolkit > Issue Type: Bug > Components: odfdom >Reporter: Damjan Jovanovic > Attachments: helloEncrypted.odt, use-zipfile.patch > > > Any encrypted ODF file written by LibreOffice reproducibly fails to open: > Document document = Document.loadDocument(new File(args[0]), "abc"); > due to an exception produced early in parsing the ZIP file. The exception is > masked by the NullPointerException in the exception handler as per > ODFTOOLKIT-401, but if that is patched, the original exception is this: > java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor > at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:309) > at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121) > at ReadZip.entriesToMap(ReadZip.java:64) > at org.odftoolkit.odfdom.pkg.ZipHelper.entriesToMap(ZipHelper.java:87) > at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:443) > at > org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:422) > at org.odftoolkit.odfdom.pkg.OdfPackage.(OdfPackage.java:250) > at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:405) > at org.odftoolkit.simple.Document.loadDocument(Document.java:351) > at local.Main.main(Main.java:21) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (ODFTOOLKIT-402) ZipException on encrypted files: only DEFLATED entries can have EXT descriptor
[ https://issues.apache.org/jira/browse/ODFTOOLKIT-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14650727#comment-14650727 ] Svante Schubert commented on ODFTOOLKIT-402: My oversight, there is no exception catched, but still the problem occurs. Added a regression test with the given document to the validator project: org.odftoolkit.odfvalidator.InvalidPackageTest @Test public void validatePackage4() { String output = ; try { String name = helloEncrypted.odt; output = doValidation(name, null); } catch (Throwable t) { StringWriter errors = new StringWriter(); t.printStackTrace(new PrintWriter(errors)); Assert.fail(t.toString() + \n + errors.toString()); } Assert.assertTrue(!output.contains(Fatal) !output.contains(xception)); java.util.logging.Logger.getLogger(getClass().getName()).info(Test result:\n+ output); } And used @Ignore for the existing tests to debug only the latter. No further test document needed for this issue ;) ZipException on encrypted files: only DEFLATED entries can have EXT descriptor -- Key: ODFTOOLKIT-402 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-402 Project: ODF Toolkit Issue Type: Bug Components: odfdom Reporter: Damjan Jovanovic Attachments: helloEncrypted.odt, use-zipfile.patch Any encrypted ODF file written by LibreOffice reproducibly fails to open: Document document = Document.loadDocument(new File(args[0]), abc); due to an exception produced early in parsing the ZIP file. The exception is masked by the NullPointerException in the exception handler as per ODFTOOLKIT-401, but if that is patched, the original exception is this: java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:309) at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121) at ReadZip.entriesToMap(ReadZip.java:64) at org.odftoolkit.odfdom.pkg.ZipHelper.entriesToMap(ZipHelper.java:87) at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:443) at org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:422) at org.odftoolkit.odfdom.pkg.OdfPackage.init(OdfPackage.java:250) at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:405) at org.odftoolkit.simple.Document.loadDocument(Document.java:351) at local.Main.main(Main.java:21) -- This message was sent by Atlassian JIRA (v6.3.4#6332)