pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1647097 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Date Sun, 21 Dec 2014 06:45:37 GMT
Author: tilman
Date: Sun Dec 21 06:45:37 2014
New Revision: 1647097

URL: http://svn.apache.org/r1647097
Log:
PDFBOX-2576: avoid inner assignment

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java?rev=1647097&r1=1647096&r2=1647097&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Sun Dec 21 06:45:37 2014
@@ -431,12 +431,15 @@ public final class StandardSecurityHandl
                 
                 // Algorithm 10: compute "Perms" value
                 byte[] perms = new byte[16];
-                perms[0] = (byte)permissionInt;
-                perms[1] = (byte)(permissionInt >>> 8);
-                perms[2] = (byte)(permissionInt >>> 16);
-                perms[3] = (byte)(permissionInt >>> 24);
-                perms[4] = perms[5] = perms[6] = perms[7] = (byte)0xFF;
-                perms[8] = 'T';    // we always use EncryptMetadata == true
+                perms[0] = (byte) permissionInt;
+                perms[1] = (byte) (permissionInt >>> 8);
+                perms[2] = (byte) (permissionInt >>> 16);
+                perms[3] = (byte) (permissionInt >>> 24);
+                perms[4] = (byte) 0xFF;
+                perms[5] = (byte) 0xFF;
+                perms[6] = (byte) 0xFF;
+                perms[7] = (byte) 0xFF;
+                perms[8] = 'T';    // we always encrypt Metadata
                 perms[9] = 'a';
                 perms[10] = 'd';
                 perms[11] = 'b';



Mime
View raw message