crypto: fix large DH generator validation · nodejs/node@32bb554 · GitHub
Skip to content

Commit 32bb554

Browse files
tniessenrichardlau
authored andcommitted
crypto: fix large DH generator validation
Unfortunately, `std::optional<>` implements `operator<` in such a way that this check will fail for very large generators. Since `bn_g` is unsigned, if its value does not fit into a single word, we can be certain that it is at least 2. By only checking the value if it does indeed fit into a word, the check correctly ignores very large generators. Signed-off-by: Tobias Nießen <tniessen@tnie.de> PR-URL: #64092 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 66f6ac0 commit 32bb554

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/crypto/crypto_dh.cc

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)