summaryrefslogtreecommitdiffstats
path: root/kex.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2000-12-15 23:31:01 +0000
committerKevin Steves <stevesk@pobox.com>2000-12-15 23:31:01 +0000
commit6b875869654af5b5f83f9e360a4d91010b624728 (patch)
treeeea2082a8def6a7fddee7dd21c76dde573d6165d /kex.c
parent48d0d257220f4ef1ce9c916d76ae56860b7dddda (diff)
- provos@cvs.openbsd.org 2000/12/15 10:30:15
[kex.c kex.h sshconnect2.c sshd.c] compute diffie-hellman in parallel between server and client. okay markus@
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kex.c b/kex.c
index 2dbac9b1..3a74fdac 100644
--- a/kex.c
+++ b/kex.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kex.c,v 1.13 2000/11/12 19:50:37 markus Exp $");
+RCSID("$OpenBSD: kex.c,v 1.14 2000/12/15 17:30:14 provos Exp $");
#include "ssh.h"
#include "ssh2.h"
@@ -139,7 +139,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
return 0;
}
-DH *
+void
dh_gen_key(DH *dh)
{
int tries = 0;
@@ -150,7 +150,6 @@ dh_gen_key(DH *dh)
if (tries++ > 10)
fatal("dh_new_group1: too many bad keys: giving up");
} while (!dh_pub_is_valid(dh, dh->pub_key));
- return dh;
}
DH *
@@ -168,9 +167,14 @@ dh_new_group_asc(const char *gen, const char *modulus)
if ((ret = BN_hex2bn(&dh->g, gen)) < 0)
fatal("BN_hex2bn g");
- return (dh_gen_key(dh));
+ return (dh);
}
+/*
+ * This just returns the group, we still need to generate the exchange
+ * value.
+ */
+
DH *
dh_new_group(BIGNUM *gen, BIGNUM *modulus)
{
@@ -182,7 +186,7 @@ dh_new_group(BIGNUM *gen, BIGNUM *modulus)
dh->p = modulus;
dh->g = gen;
- return (dh_gen_key(dh));
+ return (dh);
}
DH *