pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1660934 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Date Thu, 19 Feb 2015 16:45:26 GMT
Author: tilman
Date: Thu Feb 19 16:45:26 2015
New Revision: 1660934

URL: http://svn.apache.org/r1660934
Log:
PDFBOX-2576: make field local, remove trailing comments

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=1660934&r1=1660933&r2=1660934&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
Thu Feb 19 16:45:26 2015
@@ -73,9 +73,7 @@ public final class StandardSecurityHandl
     private static final String[] HASHES_2B = new String[] {"SHA-256", "SHA-384", "SHA-512"};
 
     private static final int DEFAULT_VERSION = 1;
-    private static final int DEFAULT_REVISION = 3;
 
-    private int revision = DEFAULT_REVISION;
     private StandardProtectionPolicy policy;
 
     /**
@@ -319,7 +317,7 @@ public final class StandardSecurityHandl
             encryptionDictionary = new PDEncryption();
         }
         version = computeVersionNumber();
-        revision = computeRevisionNumber();
+        int revision = computeRevisionNumber();
         encryptionDictionary.setFilter(FILTER);
         encryptionDictionary.setVersion(version);
         encryptionDictionary.setRevision(revision);
@@ -558,8 +556,8 @@ public final class StandardSecurityHandl
         else if( encRevision == 3 || encRevision == 4)
         {
             byte[] iterationKey = new byte[ rc4Key.length ];
-            byte[] otemp = new byte[ owner.length ]; //sm
-            System.arraycopy( owner, 0, otemp, 0, owner.length ); //sm
+            byte[] otemp = new byte[ owner.length ];
+            System.arraycopy( owner, 0, otemp, 0, owner.length );
             
             for( int i=19; i>=0; i-- )
             {
@@ -569,9 +567,9 @@ public final class StandardSecurityHandl
                     iterationKey[j] = (byte)(iterationKey[j] ^ (byte)i);
                 }
                 rc4.setKey( iterationKey );
-                result.reset();  //sm
-                rc4.write( otemp, result ); //sm
-                otemp = result.toByteArray(); //sm
+                result.reset();
+                rc4.write( otemp, result );
+                otemp = result.toByteArray();
             }
         }
         return result.toByteArray();



Mime
View raw message