From c766b403509d9140d03d404baaa2371c9b97df47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 20 Oct 2006 06:56:57 +0000 Subject: [PATCH] (dh_compute_key): fix signness test git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18645 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/dh-imath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/des/dh-imath.c b/lib/des/dh-imath.c index 7bc05b477..c900e35b8 100644 --- a/lib/des/dh-imath.c +++ b/lib/des/dh-imath.c @@ -173,7 +173,7 @@ dh_compute_key(unsigned char *shared, const BIGNUM * pub, DH *dh) BN2mpz(&peer_pub, pub); /* check if peers pubkey is reasonable */ - if (MP_SIGN(&peer_pub) != 1 + if (MP_SIGN(&peer_pub) == MP_NEG || mp_int_compare(&peer_pub, &p) >= 0 || mp_int_compare_value(&peer_pub, 1) <= 0) {