Commit 32bb554
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
0 commit comments