diff options
Diffstat (limited to 'kexgex.c')
-rw-r--r-- | kexgex.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "includes.h" | 26 | #include "includes.h" |
27 | RCSID("$OpenBSD: kexgex.c,v 1.2 2001/04/03 23:32:12 markus Exp $"); | 27 | RCSID("$OpenBSD: kexgex.c,v 1.3 2001/04/04 09:48:34 markus Exp $"); |
28 | 28 | ||
29 | #include <openssl/bn.h> | 29 | #include <openssl/bn.h> |
30 | 30 | ||
@@ -228,6 +228,8 @@ kexgex_client(Kex *kex) | |||
228 | dh_server_pub, | 228 | dh_server_pub, |
229 | shared_secret | 229 | shared_secret |
230 | ); | 230 | ); |
231 | /* have keys, free DH */ | ||
232 | DH_free(dh); | ||
231 | xfree(server_host_key_blob); | 233 | xfree(server_host_key_blob); |
232 | BN_free(dh_server_pub); | 234 | BN_free(dh_server_pub); |
233 | 235 | ||
@@ -242,14 +244,10 @@ kexgex_client(Kex *kex) | |||
242 | kex->session_id = xmalloc(kex->session_id_len); | 244 | kex->session_id = xmalloc(kex->session_id_len); |
243 | memcpy(kex->session_id, hash, kex->session_id_len); | 245 | memcpy(kex->session_id, hash, kex->session_id_len); |
244 | } | 246 | } |
245 | |||
246 | kex_derive_keys(kex, hash, shared_secret); | 247 | kex_derive_keys(kex, hash, shared_secret); |
247 | BN_clear_free(shared_secret); | 248 | BN_clear_free(shared_secret); |
248 | 249 | ||
249 | kex_send_newkeys(); | 250 | kex_finish(kex); |
250 | |||
251 | /* have keys, free DH */ | ||
252 | DH_free(dh); | ||
253 | } | 251 | } |
254 | 252 | ||
255 | /* server */ | 253 | /* server */ |
@@ -391,14 +389,13 @@ kexgex_server(Kex *kex) | |||
391 | packet_send(); | 389 | packet_send(); |
392 | xfree(signature); | 390 | xfree(signature); |
393 | xfree(server_host_key_blob); | 391 | xfree(server_host_key_blob); |
392 | /* have keys, free DH */ | ||
393 | DH_free(dh); | ||
394 | 394 | ||
395 | kex_derive_keys(kex, hash, shared_secret); | 395 | kex_derive_keys(kex, hash, shared_secret); |
396 | BN_clear_free(shared_secret); | 396 | BN_clear_free(shared_secret); |
397 | 397 | ||
398 | kex_send_newkeys(); | 398 | kex_finish(kex); |
399 | |||
400 | /* have keys, free DH */ | ||
401 | DH_free(dh); | ||
402 | } | 399 | } |
403 | 400 | ||
404 | void | 401 | void |