poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 58133] New: Agile encryption: "This file may have been tampered with or corrupted and the contents should not be trusted"
Date Mon, 13 Jul 2015 11:07:43 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=58133

            Bug ID: 58133
           Summary: Agile encryption: "This file may have been tampered
                    with or corrupted and the contents should not be
                    trusted"
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POIFS
          Assignee: dev@poi.apache.org
          Reporter: jason@plutext.org

Using trunk of today (latest commit 2f8aa558b344f5e891e99cd020a0305d9a6e8e62),
opening in Word 2010 a docx encrypted using POI gives the prompt:

"This file may have been tampered with or corrupted and the contents should not
be trusted.  Do you wish to continue opening this file?"

This is the first time I've tried doing this, so I'm not sure whether this is a
regression or not.

Code to repro:

         POIFSFileSystem fs = new POIFSFileSystem();
         EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile);

         Encryptor enc = info.getEncryptor();
         enc.confirmPassword("foobaa");

         OPCPackage opc = OPCPackage.open(new File(inputfilepath),
PackageAccess.READ_WRITE);
         OutputStream os = enc.getDataStream(fs);
         opc.save(os);
         opc.close();

         FileOutputStream fos = new FileOutputStream(new File(outputfilepath));
         fs.writeFilesystem(fos);
         fos.close();   

Input a simple hello world docx (I created one in Word 2010).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message