Skip to content

guard ecdh session key length in the jce pgp decryptor - #2383

Closed
rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:jce-ecdh-session-key-guard
Closed

guard ecdh session key length in the jce pgp decryptor#2383
rootvector2 wants to merge 1 commit into
bcgit:mainfrom
rootvector2:jce-ecdh-session-key-guard

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

the jce ecdh path derives pLen from enc[0]/enc[1] before its checkRange and outside the try that reports PGPException, so a truncated ECDH encrypted session key leaves recoverSessionData as an ArrayIndexOutOfBoundsException; spotted checking 0e75fc4 against the twin it fixed, whose release note records the jce side as already covered.

@ligefeiBouncycastle
ligefeiBouncycastle self-requested a review August 1, 2026 05:52
@ligefeiBouncycastle

Copy link
Copy Markdown
Collaborator

Thank you for this PR. Several days ago I found the same issue in bc part and fix it. It's now up on https://www.bouncycastle.org/betas if you want to try the revision.

@rootvector2

Copy link
Copy Markdown
Contributor Author

thanks for taking this — I see it landed on main as 2664618, will give the beta a try.

hubot pushed a commit that referenced this pull request Aug 4, 2026
… OpenPGP ECDH session-key guard: that work is github PR #2383, while #2375 is a different contributor's OpenPGP brainpool key-pair generator
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