From 8e24a897d706156f84c3ba50055d4ccad406151d Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Tue, 12 Oct 2010 04:27:13 +0200 Subject: [PATCH] make code match comment --- lib/hcrypto/dh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hcrypto/dh.c b/lib/hcrypto/dh.c index 7d65292ad..43e1d6ac1 100644 --- a/lib/hcrypto/dh.c +++ b/lib/hcrypto/dh.c @@ -304,7 +304,7 @@ DH_check_pubkey(const DH *dh, const BIGNUM *pub_key, int *codes) if (!BN_set_word(bn, 2)) goto out; - if (BN_cmp(bn, pub_key) == 0) { + if (BN_cmp(bn, dh->g) == 0) { unsigned i, n = BN_num_bits(pub_key); unsigned bits = 0; @@ -312,7 +312,7 @@ DH_check_pubkey(const DH *dh, const BIGNUM *pub_key, int *codes) if (BN_is_bit_set(pub_key, i)) bits++; - if (bits > 1) { + if (bits < 2) { *codes |= DH_CHECK_PUBKEY_TOO_SMALL; goto out; }