diff options
Diffstat (limited to 'kexdh.c')
-rw-r--r-- | kexdh.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: kexdh.c,v 1.6 2001/06/23 15:12:18 itojun Exp $"); | 26 | RCSID("$OpenBSD: kexdh.c,v 1.7 2001/09/17 19:27:15 stevesk Exp $"); |
27 | 27 | ||
28 | #include <openssl/crypto.h> | 28 | #include <openssl/crypto.h> |
29 | #include <openssl/bn.h> | 29 | #include <openssl/bn.h> |
@@ -44,7 +44,7 @@ kex_dh_hash( | |||
44 | char *server_version_string, | 44 | char *server_version_string, |
45 | char *ckexinit, int ckexinitlen, | 45 | char *ckexinit, int ckexinitlen, |
46 | char *skexinit, int skexinitlen, | 46 | char *skexinit, int skexinitlen, |
47 | char *serverhostkeyblob, int sbloblen, | 47 | u_char *serverhostkeyblob, int sbloblen, |
48 | BIGNUM *client_dh_pub, | 48 | BIGNUM *client_dh_pub, |
49 | BIGNUM *server_dh_pub, | 49 | BIGNUM *server_dh_pub, |
50 | BIGNUM *shared_secret) | 50 | BIGNUM *shared_secret) |
@@ -94,7 +94,7 @@ kexdh_client(Kex *kex) | |||
94 | BIGNUM *dh_server_pub = NULL, *shared_secret = NULL; | 94 | BIGNUM *dh_server_pub = NULL, *shared_secret = NULL; |
95 | DH *dh; | 95 | DH *dh; |
96 | Key *server_host_key; | 96 | Key *server_host_key; |
97 | char *server_host_key_blob = NULL, *signature = NULL; | 97 | u_char *server_host_key_blob = NULL, *signature = NULL; |
98 | u_char *kbuf, *hash; | 98 | u_char *kbuf, *hash; |
99 | u_int klen, kout, slen, sbloblen; | 99 | u_int klen, kout, slen, sbloblen; |
100 | int dlen, plen; | 100 | int dlen, plen; |
@@ -174,7 +174,7 @@ kexdh_client(Kex *kex) | |||
174 | BN_free(dh_server_pub); | 174 | BN_free(dh_server_pub); |
175 | DH_free(dh); | 175 | DH_free(dh); |
176 | 176 | ||
177 | if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) | 177 | if (key_verify(server_host_key, signature, slen, hash, 20) != 1) |
178 | fatal("key_verify failed for server_host_key"); | 178 | fatal("key_verify failed for server_host_key"); |
179 | key_free(server_host_key); | 179 | key_free(server_host_key); |
180 | xfree(signature); | 180 | xfree(signature); |
@@ -257,7 +257,7 @@ kexdh_server(Kex *kex) | |||
257 | kex->server_version_string, | 257 | kex->server_version_string, |
258 | buffer_ptr(&kex->peer), buffer_len(&kex->peer), | 258 | buffer_ptr(&kex->peer), buffer_len(&kex->peer), |
259 | buffer_ptr(&kex->my), buffer_len(&kex->my), | 259 | buffer_ptr(&kex->my), buffer_len(&kex->my), |
260 | (char *)server_host_key_blob, sbloblen, | 260 | server_host_key_blob, sbloblen, |
261 | dh_client_pub, | 261 | dh_client_pub, |
262 | dh->pub_key, | 262 | dh->pub_key, |
263 | shared_secret | 263 | shared_secret |
@@ -280,9 +280,9 @@ kexdh_server(Kex *kex) | |||
280 | 280 | ||
281 | /* send server hostkey, DH pubkey 'f' and singed H */ | 281 | /* send server hostkey, DH pubkey 'f' and singed H */ |
282 | packet_start(SSH2_MSG_KEXDH_REPLY); | 282 | packet_start(SSH2_MSG_KEXDH_REPLY); |
283 | packet_put_string((char *)server_host_key_blob, sbloblen); | 283 | packet_put_string(server_host_key_blob, sbloblen); |
284 | packet_put_bignum2(dh->pub_key); /* f */ | 284 | packet_put_bignum2(dh->pub_key); /* f */ |
285 | packet_put_string((char *)signature, slen); | 285 | packet_put_string(signature, slen); |
286 | packet_send(); | 286 | packet_send(); |
287 | 287 | ||
288 | xfree(signature); | 288 | xfree(signature); |