You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/05/21 10:43:55 UTC
svn commit: r1877998 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Author: tilman
Date: Thu May 21 10:43:54 2020
New Revision: 1877998
URL: http://svn.apache.org/viewvc?rev=1877998&view=rev
Log:
PDFBOX-4839: if no owner password is set, use the user password instead
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java?rev=1877998&r1=1877997&r2=1877998&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java Thu May 21 10:43:54 2020
@@ -326,6 +326,12 @@ public class StandardSecurityHandler ext
userPassword = "";
}
+ // If no owner password is set, use the user password instead.
+ if (ownerPassword.isEmpty())
+ {
+ ownerPassword = userPassword;
+ }
+
int permissionInt = policy.getPermissions().getPermissionBytes();
encryptionDictionary.setPermissions(permissionInt);