Repository navigation
Merge 2.2 and 2.4 in 3.0 - #1817
Merged
Merged
Conversation
Guard the registerFamily insertion path with a contains check so that calling registerFamily with the same familyName/fullName pair more than once does not grow the family list unboundedly and slow down font lookup. Add a package-private getRegisteredFamily accessor and a unit test to cover the deduplication invariant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Guard the registerFamily insertion path with a contains check so that calling registerFamily with the same familyName/fullName pair more than once does not grow the family list unboundedly and slow down font lookup. Apply the fix and add a unit test to both openpdf-core-legacy and openpdf-core-modern modules, covering the deduplication invariant via a package-private getRegisteredFamily accessor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…1630) * fix: prevent /P permissions overflow from corrupting decryption key PdfNumber#intValue() narrowed the underlying double with a plain (int) cast. Some PDF producers write the /Encrypt dictionary's /P (permissions) entry using its unsigned 32-bit decimal representation instead of the equivalent signed value (e.g. 4294965956 instead of -1340) - both encode the identical 4-byte value, and this is spec-legal. Java's narrowing double-to-int conversion saturates rather than wraps for an out-of-range value, so such a /P value was misread as Integer.MAX_VALUE instead of -1340. That corrupted the encryption key the standard security handler derives, so its own recomputed /U check failed for every password - including a correct, empty one - and PdfReader reported BadPasswordException for a document that was never actually password-protected. Route the cast through long first, which reproduces the expected low-order-32-bit truncation instead of clamping. Add PdfNumberTest covering the truncation directly, and DecryptUnsignedPermissionsTest, a PdfReader-level regression test using a crafted PDF whose /P is written this way with an empty user password. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test: use PdfReader.isOwnerPasswordUsed() instead of reflection DecryptUnsignedPermissionsTest reached PdfReader's private ownerPasswordUsed field via reflection (setAccessible), which Codacy flagged as a high-severity visibility-alteration issue, plus a medium issue for wrapping the reflection exceptions in a raw RuntimeException. PdfReader already exposes a public isOwnerPasswordUsed() getter that returns the same field, so the reflection is unnecessary. Calling it directly returns the identical value and removes both findings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…1632) * fix: prevent /P permissions overflow from corrupting decryption key PdfNumber#intValue() narrowed the underlying double with a plain (int) cast. Some PDF producers write the /Encrypt dictionary's /P (permissions) entry using its unsigned 32-bit decimal representation instead of the equivalent signed value (e.g. 4294965956 instead of -1340) - both encode the identical 4-byte value, and this is spec-legal. Java's narrowing double-to-int conversion saturates rather than wraps for an out-of-range value, so such a /P value was misread as Integer.MAX_VALUE instead of -1340. That corrupted the encryption key the standard security handler derives, so its own recomputed /U check failed for every password - including a correct, empty one - and PdfReader reported BadPasswordException for a document that was never actually password-protected. Route the cast through long first, which reproduces the expected low-order-32-bit truncation instead of clamping. Applied identically to both the legacy (com.lowagie) and modern (org.openpdf) copies of PdfNumber, since this branch ships both. Add PdfNumberTest covering the truncation directly, and DecryptUnsignedPermissionsTest, a PdfReader-level regression test using a crafted PDF whose /P is written this way with an empty user password, to both modules. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test: use PdfReader.isOwnerPasswordUsed() instead of reflection DecryptUnsignedPermissionsTest reached PdfReader's private ownerPasswordUsed field via reflection (setAccessible), which Codacy flagged as a high-severity visibility-alteration issue, plus a medium issue for wrapping the reflection exceptions in a raw RuntimeException. PdfReader already exposes a public isOwnerPasswordUsed() getter that returns the same field, so the reflection is unnecessary. Calling it directly returns the identical value and removes both findings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
- Update bouncycastle, assertj and fop - Update central-publishing-maven-plugin - createRelease.sh from preview release-branch
- Update org.verapdf:validation-model 1.28.1 -> 1.30.4 - Only one mockito version used: 5.25.0 (upgraded)
- createRelease.sh from preview release-branch - Update org.verapdf:validation-model 1.28.1 -> 1.30.4 - Update central-publishing-maven-plugin 0.8.0 -> 0.12.0 - Update bouncycastle 1.81 -> 1.87 - Update fop 2.11 -> 2.12 - Update assertj 3.27.4 -> 3.27.7 - Update mockito to only one version: 5.25.0
… merge-2.2-2.4-in-3.0 # Conflicts: # README.md # openpdf-core/pom.xml # openpdf-core/src/main/java/org/openpdf/text/pdf/PdfNumber.java # openpdf-core/src/test/java/org/openpdf/text/FontFactoryImpTest.java # openpdf-core/src/test/java/org/openpdf/text/pdf/PdfNumberTest.java # openpdf-core/src/test/java/org/openpdf/text/pdf/encryption/DecryptUnsignedPermissionsTest.java # openpdf-fonts-extra/pom.xml # openpdf-html/pom.xml # openpdf-kotlin/pom.xml # openpdf-renderer/pom.xml # pdf-swing/pom.xml # pdf-toolbox/pom.xml # pom.xml
Not up to standards ⛔
|
…2.2-2.4-in-3.0 # Conflicts: # openpdf-core-legacy/pom.xml # openpdf-core-legacy/src/main/java/com/lowagie/text/FontFactoryImp.java # openpdf-core-legacy/src/main/java/com/lowagie/text/pdf/PdfNumber.java # openpdf-core/pom.xml # openpdf-core/src/main/java/org/openpdf/text/FontFactoryImp.java # openpdf-core/src/main/java/org/openpdf/text/pdf/PdfNumber.java # openpdf-fonts-extra/pom.xml # openpdf-html/pom.xml # openpdf-kotlin/pom.xml # openpdf-renderer/pom.xml # pdf-swing/pom.xml # pdf-toolbox/pom.xml # pom.xml
asturio
force-pushed
the
merge-2.2-2.4-in-3.0
branch
from
December 4, 2026 16:06
a81dd34 to
321b0f9
Compare
From other branches
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Just a Merge so we can get rid of the merged branches.