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

Change ByteRange placeholder to allow bigger input #337

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

MatthiasValvekens
Copy link
Owner

Description of the changes

This changes the way the ByteRange array placeholder is calculated to deal with files larger than 100MB. The root cause was a format string (going back to the very first prototype) that aligned everything to 8 digits. We now always allocate 60 bytes of whitespace and put the offsets in there. This fixes #336.

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.

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (99ab33b) 98.76% compared to head (0a66252) 98.80%.
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   98.76%   98.80%   +0.03%     
==========================================
  Files         104      104              
  Lines       14712    14773      +61     
==========================================
+ Hits        14530    14596      +66     
+ Misses        182      177       -5     
Flag Coverage Δ
unittests 98.80% <100.00%> (+0.03%) ⬆️

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

Files Coverage Δ
pyhanko/sign/signers/pdf_byterange.py 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

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

@MatthiasValvekens MatthiasValvekens merged commit 30d272c into master Nov 2, 2023
21 checks passed
@MatthiasValvekens MatthiasValvekens deleted the bugfix/sign-large-files branch November 23, 2023 19:40
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.

Add digital signature is broken for PDF file larger than 100 000 000 bytes
1 participant