Skip to content
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

Fix issues with object importing and tolerate unpadded empty strings in encrypted documents #414

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

MatthiasValvekens
Copy link
Owner

Description of the changes

  • Make object importer more resilient

    • Correctly copy references to the root object
    • Deal with deep object graphs in a more stack-safe manner (we now only
      recurse within top-level objects, those usually are not that deep)
  • When decrypting strings and streams using one of PDF's AES-CBC-based crypt filters, if the plaintext is empty after decryption, do not reject it for lack of padding.

See #412.

Checklist

Please go over this checklist to increase the chances of your PR being worked on in a timely manner. Deviations are allowed with proper justification (see previous section).

  • I have read the project's CoC and contribution guidelines.
  • I understand and agree to the terms in the Developer Certificate of Origin as applied to this contribution.
  • All new code in this PR has full test coverage.

For bug fixes (delete if not applicable)

  • My changes do not affect any public API or CLI semantics.
  • My PR adds regression tests (i.e. tests that fail if the bug fix is not applied).
  • All new code in this PR has full test coverage.

 - Correctly copy references to the root object
 - Deal with deep object graphs in a more stack-safe manner (we now only
   recurse within top-level objects, those usually are not that deep)

See #412
@MatthiasValvekens
Copy link
Owner Author

@redfast00, you might want to throw your files at this one.

@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.83%. Comparing base (6177c1f) to head (a605c21).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #414   +/-   ##
=======================================
  Coverage   98.83%   98.83%           
=======================================
  Files         113      113           
  Lines       16265    16298   +33     
=======================================
+ Hits        16075    16108   +33     
  Misses        190      190           
Flag Coverage Δ
unittests 98.83% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MatthiasValvekens MatthiasValvekens merged commit 6871e2b into master Mar 27, 2024
21 checks passed
@MatthiasValvekens MatthiasValvekens deleted the bugfix/crypt-import-bugfixes branch April 27, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants