diff options
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: dh.c,v 1.24 2003/04/08 20:21:28 itojun Exp $"); | 26 | RCSID("$OpenBSD: dh.c,v 1.25 2003/09/18 13:02:21 miod Exp $"); |
27 | 27 | ||
28 | #include "xmalloc.h" | 28 | #include "xmalloc.h" |
29 | 29 | ||
@@ -198,7 +198,7 @@ dh_gen_key(DH *dh, int need) | |||
198 | 198 | ||
199 | if (dh->p == NULL) | 199 | if (dh->p == NULL) |
200 | fatal("dh_gen_key: dh->p == NULL"); | 200 | fatal("dh_gen_key: dh->p == NULL"); |
201 | if (2*need >= BN_num_bits(dh->p)) | 201 | if (need > INT_MAX / 2 || 2 * need >= BN_num_bits(dh->p)) |
202 | fatal("dh_gen_key: group too small: %d (2*need %d)", | 202 | fatal("dh_gen_key: group too small: %d (2*need %d)", |
203 | BN_num_bits(dh->p), 2*need); | 203 | BN_num_bits(dh->p), 2*need); |
204 | do { | 204 | do { |