Skip to content

Issue 623 : Make BaseFont subset prefix generation deterministic#627

Merged
asturio merged 1 commit intoLibrePDF:masterfrom
bsanchezb:pr-623
Dec 14, 2021
Merged

Issue 623 : Make BaseFont subset prefix generation deterministic#627
asturio merged 1 commit intoLibrePDF:masterfrom
bsanchezb:pr-623

Conversation

@bsanchezb
Copy link
Copy Markdown
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
Copy Markdown

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