pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1641716 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
Date Tue, 25 Nov 2014 22:15:25 GMT
Author: lehmi
Date: Tue Nov 25 22:15:24 2014
New Revision: 1641716

URL: http://svn.apache.org/r1641716
Log:
PDFBOX-2522: don't decrypt the cross-reference stream similar to Tilmans fix in the trunk

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java?rev=1641716&r1=1641715&r2=1641716&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
Tue Nov 25 22:15:24 2014
@@ -460,7 +460,13 @@ public abstract class SecurityHandler
      */
     public void decryptStream(COSStream stream, long objNum, long genNum) throws CryptographyException,
IOException
     {
-        if (!decryptMetadata && COSName.METADATA.equals(stream.getDictionaryObject(COSName.TYPE)))
+        COSBase type = stream.getDictionaryObject(COSName.TYPE);
+        if (!decryptMetadata && COSName.METADATA.equals(type))
+        {
+            return;
+        }
+        // "The cross-reference stream shall not be encrypted"
+        if (COSName.XREF.equals(type))
         {
             return;
         }



Mime
View raw message