You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andrea Vacondio (JIRA)" <ji...@apache.org> on 2012/11/26 20:32:58 UTC

[jira] [Created] (PDFBOX-1453) NPE saving modified encrypted document

Andrea Vacondio created PDFBOX-1453:
---------------------------------------

             Summary: NPE saving modified encrypted document
                 Key: PDFBOX-1453
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1453
             Project: PDFBox
          Issue Type: Bug
          Components: Writing
    Affects Versions: 1.7.1
            Reporter: Andrea Vacondio


I posted this on the mailing list but got no answer. I'm describing here some behaviors that are triggering NPE when saving a modified pdf document.
What I'm trying to do is to open an encrypted document, modify it, save it back (I attached my test project). The three tests I made they all end up with a NPE but they work if I turn on setAllSecurityToBeRemoved (and I don't want security to be removed).

First test: 
1- input is a doc encrypted with owner pwd having the modify permission on. 
2- The document is loaded and decrypted using owner pwd. 
3- permissions.isOwnerPermission() is true which is correct 
4- permissions.canModify() is true which is correct 
5- modify the doc and save throws a NPE which is NOT correct

Second test 
1- input is a doc encrypted with owner pwd having the modify permission on. 
2- The document is loaded but not decrypted 
3- permissions.isOwnerPermission() is true, why? I didn't provide any owner pwd I should not have owner permissions. 
4- permissions.canModify() is true which is correct 
5- modify the doc and save throws a NPE which is NOT correct

Third test 
1- input is a doc encrypted with owner pwd having NO permission. 
2- The document is loaded and decrypted using owner pwd. 
3- permissions.isOwnerPermission() is true which is correct
 4- permissions.canModify() is true, why? I can modify the doc because I have owner permission but the Modify should be off.
 5- modify the doc and save throws a NPE which is NOT correct 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PDFBOX-1453) NPE saving modified encrypted document

Posted by "Andrea Vacondio (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Vacondio updated PDFBOX-1453:
------------------------------------

    Attachment: TestEnc.zip

Test project
                
> NPE saving modified encrypted document
> --------------------------------------
>
>                 Key: PDFBOX-1453
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1453
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 1.7.1
>            Reporter: Andrea Vacondio
>         Attachments: TestEnc.zip
>
>
> I posted this on the mailing list but got no answer. I'm describing here some behaviors that are triggering NPE when saving a modified pdf document.
> What I'm trying to do is to open an encrypted document, modify it, save it back (I attached my test project). The three tests I made they all end up with a NPE but they work if I turn on setAllSecurityToBeRemoved (and I don't want security to be removed).
> First test: 
> 1- input is a doc encrypted with owner pwd having the modify permission on. 
> 2- The document is loaded and decrypted using owner pwd. 
> 3- permissions.isOwnerPermission() is true which is correct 
> 4- permissions.canModify() is true which is correct 
> 5- modify the doc and save throws a NPE which is NOT correct
> Second test 
> 1- input is a doc encrypted with owner pwd having the modify permission on. 
> 2- The document is loaded but not decrypted 
> 3- permissions.isOwnerPermission() is true, why? I didn't provide any owner pwd I should not have owner permissions. 
> 4- permissions.canModify() is true which is correct 
> 5- modify the doc and save throws a NPE which is NOT correct
> Third test 
> 1- input is a doc encrypted with owner pwd having NO permission. 
> 2- The document is loaded and decrypted using owner pwd. 
> 3- permissions.isOwnerPermission() is true which is correct
>  4- permissions.canModify() is true, why? I can modify the doc because I have owner permission but the Modify should be off.
>  5- modify the doc and save throws a NPE which is NOT correct 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira