summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-02-29 20:15:08 +1100
committerDarren Tucker <dtucker@zip.com.au>2004-02-29 20:15:08 +1100
commiteffc84ce5b304a0cef62b13e72172847b6f03ceb (patch)
tree5951f0739084239587667b6a58538906d20ab33e
parentc56c7ef592e9dded048faa1443049679aacc0421 (diff)
- dtucker@cvs.openbsd.org 2004/02/27 22:49:27
[dh.c] Reset bit counter at the right time, fixes debug output in the case where the DH group is rejected. ok markus@
-rw-r--r--ChangeLog6
-rw-r--r--dh.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 20b1d8e6..f510abfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
[dh.c]
Make /etc/moduli line buffer big enough for 8kbit primes, in case anyone
ever uses one. ok markus@
+ - dtucker@cvs.openbsd.org 2004/02/27 22:49:27
+ [dh.c]
+ Reset bit counter at the right time, fixes debug output in the case where
+ the DH group is rejected. ok markus@
20040226
- (bal) KNF our sshlogin.c even if the code looks nothing like upstream
@@ -816,4 +820,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3263 2004/02/29 09:13:34 dtucker Exp $
+$Id: ChangeLog,v 1.3264 2004/02/29 09:15:08 dtucker Exp $
diff --git a/dh.c b/dh.c
index 0790aff7..afd1e05d 100644
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: dh.c,v 1.28 2004/02/27 22:44:56 dtucker Exp $");
+RCSID("$OpenBSD: dh.c,v 1.29 2004/02/27 22:49:27 dtucker Exp $");
#include "xmalloc.h"
@@ -197,7 +197,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
void
dh_gen_key(DH *dh, int need)
{
- int i, bits_set = 0, tries = 0;
+ int i, bits_set, tries = 0;
if (dh->p == NULL)
fatal("dh_gen_key: dh->p == NULL");
@@ -214,7 +214,7 @@ dh_gen_key(DH *dh, int need)
fatal("dh_gen_key: BN_rand failed");
if (DH_generate_key(dh) == 0)
fatal("DH_generate_key");
- for (i = 0; i <= BN_num_bits(dh->priv_key); i++)
+ for (i = 0, bits_set = 0; i <= BN_num_bits(dh->priv_key); i++)
if (BN_is_bit_set(dh->priv_key, i))
bits_set++;
debug2("dh_gen_key: priv key bits set: %d/%d",