Skip to content

Limit dh gen size#6165

Merged
jasnell merged 2 commits intomainfrom
jasnell/tweak-crypto-dh-gen-limit
Feb 25, 2026
Merged

Limit dh gen size#6165
jasnell merged 2 commits intomainfrom
jasnell/tweak-crypto-dh-gen-limit

Conversation

@jasnell
Copy link
Copy Markdown
Collaborator

@jasnell jasnell commented Feb 24, 2026

Not breaking because larger values would have hit CPU and memory limits causing them to fail in other ways.

@jasnell jasnell requested a review from anonrig February 24, 2026 22:59
@jasnell jasnell requested review from a team as code owners February 24, 2026 22:59
@jasnell jasnell enabled auto-merge February 24, 2026 22:59
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

This PR tightens the generator byte-array size check in createDiffieHellman from INT32_MAX to OPENSSL_DH_MAX_MODULUS_BITS / CHAR_BIT (1250 bytes), consistent with the existing key size check. The C++ change looks correct.

Issues (ranked by severity):

  1. Test uses undefined referencesthrows and createDiffieHellman are not imported or destructured. The rest of the file uses assert.throws and crypto.createDiffieHellman. This test will fail at runtime with a ReferenceError rather than actually validating the new limit.

@ask-bonk

This comment was marked as resolved.

Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
@jasnell jasnell disabled auto-merge February 24, 2026 23:07
@jasnell jasnell enabled auto-merge (squash) February 24, 2026 23:08
@codspeed-hq

This comment was marked as outdated.

@jasnell jasnell merged commit c5969db into main Feb 25, 2026
36 of 38 checks passed
@jasnell jasnell deleted the jasnell/tweak-crypto-dh-gen-limit branch February 25, 2026 00:20
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