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

Avoid parsing encrypted object streams early and correctly parse object streams upon decryption #385

Merged
merged 2 commits into from
Feb 15, 2025

Conversation

StephanvanSchaik
Copy link
Contributor

OK, after testing upstream to make sure lopdf works for issue #369, I realized some things were still missing.

The first commit makes sure that Reader::read() does not try to parse object streams when the document is encrypted, thus leaving them intact for Document::decrypt() such that it can parse the object streams after decrypting the streams.

The second commit fixes #382. I was somehow missing a continue after checking that the stream is not an object stream as well as the part to actually add the newly parsed objects.

I tested this branch to make sure this all works for the document provided in issue #369 and everything looks good now.

@StephanvanSchaik StephanvanSchaik changed the title Skip encrypted reader Avoid parsing encrypted object streams early and correctly parse object streams upon decryption Feb 14, 2025
@J-F-Liu J-F-Liu merged commit 1bbfa67 into J-F-Liu:main Feb 15, 2025
8 checks passed
@StephanvanSchaik StephanvanSchaik deleted the skip-encrypted-reader branch February 15, 2025 14:52
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.

2 participants