diff options
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: kex.c,v 1.13 2000/11/12 19:50:37 markus Exp $"); | 26 | RCSID("$OpenBSD: kex.c,v 1.14 2000/12/15 17:30:14 provos Exp $"); |
27 | 27 | ||
28 | #include "ssh.h" | 28 | #include "ssh.h" |
29 | #include "ssh2.h" | 29 | #include "ssh2.h" |
@@ -139,7 +139,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub) | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | DH * | 142 | void |
143 | dh_gen_key(DH *dh) | 143 | dh_gen_key(DH *dh) |
144 | { | 144 | { |
145 | int tries = 0; | 145 | int tries = 0; |
@@ -150,7 +150,6 @@ dh_gen_key(DH *dh) | |||
150 | if (tries++ > 10) | 150 | if (tries++ > 10) |
151 | fatal("dh_new_group1: too many bad keys: giving up"); | 151 | fatal("dh_new_group1: too many bad keys: giving up"); |
152 | } while (!dh_pub_is_valid(dh, dh->pub_key)); | 152 | } while (!dh_pub_is_valid(dh, dh->pub_key)); |
153 | return dh; | ||
154 | } | 153 | } |
155 | 154 | ||
156 | DH * | 155 | DH * |
@@ -168,9 +167,14 @@ dh_new_group_asc(const char *gen, const char *modulus) | |||
168 | if ((ret = BN_hex2bn(&dh->g, gen)) < 0) | 167 | if ((ret = BN_hex2bn(&dh->g, gen)) < 0) |
169 | fatal("BN_hex2bn g"); | 168 | fatal("BN_hex2bn g"); |
170 | 169 | ||
171 | return (dh_gen_key(dh)); | 170 | return (dh); |
172 | } | 171 | } |
173 | 172 | ||
173 | /* | ||
174 | * This just returns the group, we still need to generate the exchange | ||
175 | * value. | ||
176 | */ | ||
177 | |||
174 | DH * | 178 | DH * |
175 | dh_new_group(BIGNUM *gen, BIGNUM *modulus) | 179 | dh_new_group(BIGNUM *gen, BIGNUM *modulus) |
176 | { | 180 | { |
@@ -182,7 +186,7 @@ dh_new_group(BIGNUM *gen, BIGNUM *modulus) | |||
182 | dh->p = modulus; | 186 | dh->p = modulus; |
183 | dh->g = gen; | 187 | dh->g = gen; |
184 | 188 | ||
185 | return (dh_gen_key(dh)); | 189 | return (dh); |
186 | } | 190 | } |
187 | 191 | ||
188 | DH * | 192 | DH * |