From aa144a7ac66eb6d02f578a238febf9fe0cad9773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 20 Oct 2006 06:49:45 +0000 Subject: [PATCH] make compile git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18644 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/dh-imath.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/des/dh-imath.c b/lib/des/dh-imath.c index 84ee03536..7bc05b477 100644 --- a/lib/des/dh-imath.c +++ b/lib/des/dh-imath.c @@ -81,14 +81,15 @@ mpz2BN(mpz_t *s) * */ -#definen DH_NUM_TRIES 10 +#define DH_NUM_TRIES 10 static int dh_generate_key(DH *dh) { mpz_t pub, priv_key, g, p; int have_private_key = (dh->priv_key != NULL); - int times = 0; + int codes, times = 0; + mp_result res; if (dh->p == NULL || dh->g == NULL) return 0; @@ -134,13 +135,13 @@ dh_generate_key(DH *dh) if (dh->pub_key == NULL) return 0; - if (DH_check_pubkey(dh, peer_pub_key, &codes) && codes == 0) + if (DH_check_pubkey(dh, dh->pub_key, &codes) && codes == 0) break; if (have_private_key) - reurn 0; + return 0; } - if (i > DH_NUM_TRIES) { + if (times >= DH_NUM_TRIES) { if (!have_private_key && dh->priv_key) { BN_free(dh->priv_key); dh->priv_key = NULL;