-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encrypt can also be a Dictionary #783
Encrypt can also be a Dictionary #783
Conversation
Codecov ReportBase: 46.33% // Head: 46.32% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## integration #783 +/- ##
=================================================
- Coverage 46.33% 46.32% -0.02%
+ Complexity 1054 1053 -1
=================================================
Files 57 57
Lines 9079 9079
Branches 1612 1609 -3
=================================================
- Hits 4207 4206 -1
- Misses 4333 4335 +2
+ Partials 539 538 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
_encryptDictRef = (PdfIndirectObj) _trailerDict | ||
.get(DICT_KEY_ENCRYPT); // This is at least v. 1.1 | ||
_encrypted = (_encryptDictRef != null); | ||
PdfObject encryptObj = _trailerDict.get(DICT_KEY_ENCRYPT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a solid approach, but the if/else leaves the possibility that the instance returned here isn't "tested" at all. Put another way, what happens when encryptObj
ISN'T an instance of PdfIndirectObj
OR PdfDictionary
? This may be an error that gets picked up elsewhere, but I wonder if there shouldn't be a default condition here that marks an error?
@samalloing I've also created PR #803, which sets things up for this change. I've added you as a reviewer anyway, but the two want merging before trying to merge into integration. BTW this appears to be a duplicate of #743 ? Please confirm and I'll close that PR. |
@samalloing I think I've fixed these issues in #810 where I've added the changes needed to report encryption in the new case. Finally, I've added a couple of examples to the corpora and patched the tests to work. If you could review #810 we can get these merged up. |
Closed as contained in #810 now, thanks @samalloing |
Hi @carlwilson
Encrypt can be also be a PdfDictionary (also used Arlington PDF model to verify)
A testfile: https://github.com/mozilla/pdf.js/blob/master/test/pdfs/issue6010_1.pdf
Sam