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

Issue 623 : Make BaseFont subset prefix generation deterministic #627

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

bsanchezb
Copy link
Contributor

Added a configurable SecureRandom to BaseFont class to make a possibility to generate a deterministic subset prefix.
By default the generated String is still random.

Related Issue: #623

Unit test is provided within the commit. Tested within our implementation using a FixedSecureRandom from BC, and the generated subset prefix is deterministic, as expected.

Some comments:

I do not understand a reason for the method PdfReader.shuffleSubsetNames(). To my opinion, it could be removed, as if you remove it from code, it does not brake any unit tests. Nevertheless, I left this method with the old behavior for backward compatibility.

My solution is pretty simple and straight-forward, so if you have better ideas how it could be implemented, please feel free to make the changes in my original PR.

Best regards,
Aleksandr.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@asturio asturio linked an issue Dec 14, 2021 that may be closed by this pull request
@asturio asturio merged commit c299bdb into LibrePDF:master Dec 14, 2021
@asturio asturio added this to the 1.3.27 milestone Mar 5, 2022
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.

Make BaseFont subset prefix generation deterministic
2 participants