poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <n...@torchbox.com>
Subject Re: Password protected word documents
Date Wed, 11 Feb 2004 10:56:28 GMT
On Tue, 10 Feb 2004, Ryan Ackley wrote:
> Go for it if you need it for yourself.

Turned out to be a really easy fix (a patch is below in case anyone else 
needs to do this in the mean time)

> fill out a feature request in bugzilla. I will definitely put it in, I
> just need you to do that so I don't forget.

Done

Nick



--- WordDocument.java.sav       2004-02-11 10:31:16.000000000 +0000
+++ WordDocument.java   	2004-02-11 10:33:11.000000000 +0000
@@ -279,6 +279,13 @@
       int parPlcSize = LittleEndian.getInt(_header, 0x106);
       boolean useTable1 = (info & 0x200) != 0;
 
+      // Check to see if it's encrypted
+      // Looking for bit with 0x0100 in short at 0xa (returns 256 if set)
+      if((info & 0x0100) == 256) {
+         // Encrypted document found
+         throw new IOException("The document is encrypted");
+      }
+
       //process the text and formatting properties
       processComplexFile(useTable1, charPLC, charPlcSize, parPLC, 
parPlcSize);
   }




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


Mime
View raw message