summaryrefslogtreecommitdiff
path: root/dh.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-09-22 21:05:50 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-09-22 21:05:50 +1000
commitc0815c927e177f27b1bcd6370e4c2b10caf95efe (patch)
treece3ca9f4f2a30ef0281b095dd01ef6c66454a8f1 /dh.c
parentfb16b2411eda857cd358dc4c9c63b66edc217a51 (diff)
- miod@cvs.openbsd.org 2003/09/18 13:02:21
[authfd.c bufaux.c dh.c mac.c ssh-keygen.c] A few signedness fixes for harmless situations; markus@ ok
Diffstat (limited to 'dh.c')
-rw-r--r--dh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dh.c b/dh.c
index 996428b7f..c924efee0 100644
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: dh.c,v 1.24 2003/04/08 20:21:28 itojun Exp $"); 26RCSID("$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 {