pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1651725 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Date Wed, 14 Jan 2015 16:35:52 GMT
Author: tilman
Date: Wed Jan 14 16:35:52 2015
New Revision: 1651725

URL: http://svn.apache.org/r1651725
Log:
PDFBOX-2576: avoid "local variable hides a field" warning

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=1651725&r1=1651724&r2=1651725&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
Wed Jan 14 16:35:52 2015
@@ -740,12 +740,12 @@ public final class StandardSecurityHandl
                                       boolean encryptMetadata) throws IOException
     {
         ByteArrayOutputStream result = new ByteArrayOutputStream();
-        byte[] encryptionKey = computeEncryptedKey( password, owner, null, null, null, permissions,
+        byte[] encKey = computeEncryptedKey( password, owner, null, null, null, permissions,
                 id, encRevision, length, encryptMetadata, true );
         
         if( encRevision == 2 )
         {
-            rc4.setKey( encryptionKey );
+            rc4.setKey( encKey );
             rc4.write( ENCRYPT_PADDING, result );
         }
         else if( encRevision == 3 || encRevision == 4 )
@@ -756,10 +756,10 @@ public final class StandardSecurityHandl
             md.update( id );
             result.write( md.digest() );
 
-            byte[] iterationKey = new byte[ encryptionKey.length ];
+            byte[] iterationKey = new byte[ encKey.length ];
             for( int i=0; i<20; i++ )
             {
-                System.arraycopy( encryptionKey, 0, iterationKey, 0, iterationKey.length
);
+                System.arraycopy( encKey, 0, iterationKey, 0, iterationKey.length );
                 for( int j=0; j< iterationKey.length; j++ )
                 {
                     iterationKey[j] = (byte)(iterationKey[j] ^ i);



Mime
View raw message