diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2000-12-22 01:43:59 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2000-12-22 01:43:59 +0000 |
commit | 46c162204b5a6f7471525c2f75cb2c607c88b83f (patch) | |
tree | 9041b006ab612c18bdb16b606601839a00ca5b2c /sshconnect2.c | |
parent | a074feb65d6f1fcad02e80b751e2287fd6230b09 (diff) |
One way to massive patch. <sigh> It compiles and works under Linux..
And I think I have all the bits right from the OpenBSD tree.
20001222
- Updated RCSID for pty.c
- (bal) OpenBSD CVS Updates:
- markus@cvs.openbsd.org 2000/12/21 15:10:16
[auth-rh-rsa.c hostfile.c hostfile.h sshconnect.c]
print keyfile:line for changed hostkeys, for deraadt@, ok deraadt@
- markus@cvs.openbsd.org 2000/12/20 19:26:56
[authfile.c]
allow ssh -i userkey for root
- markus@cvs.openbsd.org 2000/12/20 19:37:21
[authfd.c authfd.h kex.c sshconnect2.c sshd.c uidswap.c uidswap.h]
fix prototypes; from stevesk@pobox.com
- markus@cvs.openbsd.org 2000/12/20 19:32:08
[sshd.c]
init pointer to NULL; report from Jan.Ivan@cern.ch
- markus@cvs.openbsd.org 2000/12/19 23:17:54
[auth-krb4.c auth-options.c auth-options.h auth-rhosts.c auth-rsa.c
auth1.c auth2-skey.c auth2.c authfd.c authfd.h authfile.c bufaux.c
bufaux.h buffer.c canohost.c channels.c clientloop.c compress.c
crc32.c deattack.c getput.h hmac.c hmac.h hostfile.c kex.c kex.h
key.c key.h log.c login.c match.c match.h mpaux.c mpaux.h packet.c
packet.h radix.c readconf.c rsa.c scp.c servconf.c servconf.h
serverloop.c session.c sftp-server.c ssh-agent.c ssh-dss.c ssh-dss.h
ssh-keygen.c ssh-keyscan.c ssh-rsa.c ssh-rsa.h ssh.c ssh.h uuencode.c
uuencode.h sshconnect1.c sshconnect2.c sshd.c tildexpand.c]
replace 'unsigned bla' with 'u_bla' everywhere. also replace 'char
unsigned' with u_char.
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sshconnect2.c b/sshconnect2.c index ea03622f4..aee547fbe 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: sshconnect2.c,v 1.31 2000/12/15 17:30:14 provos Exp $"); | 26 | RCSID("$OpenBSD: sshconnect2.c,v 1.33 2000/12/20 19:37:22 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/bn.h> | 28 | #include <openssl/bn.h> |
29 | #include <openssl/rsa.h> | 29 | #include <openssl/rsa.h> |
@@ -63,7 +63,7 @@ extern Options options; | |||
63 | * SSH2 key exchange | 63 | * SSH2 key exchange |
64 | */ | 64 | */ |
65 | 65 | ||
66 | unsigned char *session_id2 = NULL; | 66 | u_char *session_id2 = NULL; |
67 | int session_id2_len = 0; | 67 | int session_id2_len = 0; |
68 | 68 | ||
69 | void | 69 | void |
@@ -151,17 +151,17 @@ ssh_dh1_client(Kex *kex, char *host, struct sockaddr *hostaddr, | |||
151 | int i; | 151 | int i; |
152 | #endif | 152 | #endif |
153 | int plen, dlen; | 153 | int plen, dlen; |
154 | unsigned int klen, kout; | 154 | u_int klen, kout; |
155 | char *signature = NULL; | 155 | char *signature = NULL; |
156 | unsigned int slen; | 156 | u_int slen; |
157 | char *server_host_key_blob = NULL; | 157 | char *server_host_key_blob = NULL; |
158 | Key *server_host_key; | 158 | Key *server_host_key; |
159 | unsigned int sbloblen; | 159 | u_int sbloblen; |
160 | DH *dh; | 160 | DH *dh; |
161 | BIGNUM *dh_server_pub = 0; | 161 | BIGNUM *dh_server_pub = 0; |
162 | BIGNUM *shared_secret = 0; | 162 | BIGNUM *shared_secret = 0; |
163 | unsigned char *kbuf; | 163 | u_char *kbuf; |
164 | unsigned char *hash; | 164 | u_char *hash; |
165 | 165 | ||
166 | debug("Sending SSH2_MSG_KEXDH_INIT."); | 166 | debug("Sending SSH2_MSG_KEXDH_INIT."); |
167 | /* generate and send 'e', client DH public key */ | 167 | /* generate and send 'e', client DH public key */ |
@@ -253,7 +253,7 @@ ssh_dh1_client(Kex *kex, char *host, struct sockaddr *hostaddr, | |||
253 | fprintf(stderr, "%02x", (hash[i])&0xff); | 253 | fprintf(stderr, "%02x", (hash[i])&0xff); |
254 | fprintf(stderr, "\n"); | 254 | fprintf(stderr, "\n"); |
255 | #endif | 255 | #endif |
256 | if (key_verify(server_host_key, (unsigned char *)signature, slen, hash, 20) != 1) | 256 | if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) |
257 | fatal("key_verify failed for server_host_key"); | 257 | fatal("key_verify failed for server_host_key"); |
258 | key_free(server_host_key); | 258 | key_free(server_host_key); |
259 | 259 | ||
@@ -295,18 +295,18 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr, | |||
295 | int i; | 295 | int i; |
296 | #endif | 296 | #endif |
297 | int plen, dlen; | 297 | int plen, dlen; |
298 | unsigned int klen, kout; | 298 | u_int klen, kout; |
299 | char *signature = NULL; | 299 | char *signature = NULL; |
300 | unsigned int slen, nbits; | 300 | u_int slen, nbits; |
301 | char *server_host_key_blob = NULL; | 301 | char *server_host_key_blob = NULL; |
302 | Key *server_host_key; | 302 | Key *server_host_key; |
303 | unsigned int sbloblen; | 303 | u_int sbloblen; |
304 | DH *dh; | 304 | DH *dh; |
305 | BIGNUM *dh_server_pub = 0; | 305 | BIGNUM *dh_server_pub = 0; |
306 | BIGNUM *shared_secret = 0; | 306 | BIGNUM *shared_secret = 0; |
307 | BIGNUM *p = 0, *g = 0; | 307 | BIGNUM *p = 0, *g = 0; |
308 | unsigned char *kbuf; | 308 | u_char *kbuf; |
309 | unsigned char *hash; | 309 | u_char *hash; |
310 | 310 | ||
311 | nbits = dh_estimate(kex->enc[MODE_OUT].cipher->key_len * 8); | 311 | nbits = dh_estimate(kex->enc[MODE_OUT].cipher->key_len * 8); |
312 | 312 | ||
@@ -426,7 +426,7 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr, | |||
426 | fprintf(stderr, "%02x", (hash[i])&0xff); | 426 | fprintf(stderr, "%02x", (hash[i])&0xff); |
427 | fprintf(stderr, "\n"); | 427 | fprintf(stderr, "\n"); |
428 | #endif | 428 | #endif |
429 | if (key_verify(server_host_key, (unsigned char *)signature, slen, hash, 20) != 1) | 429 | if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) |
430 | fatal("key_verify failed for server_host_key"); | 430 | fatal("key_verify failed for server_host_key"); |
431 | key_free(server_host_key); | 431 | key_free(server_host_key); |
432 | 432 | ||
@@ -448,7 +448,7 @@ typedef struct Authmethod Authmethod; | |||
448 | 448 | ||
449 | typedef int sign_cb_fn( | 449 | typedef int sign_cb_fn( |
450 | Authctxt *authctxt, Key *key, | 450 | Authctxt *authctxt, Key *key, |
451 | unsigned char **sigp, int *lenp, unsigned char *data, int datalen); | 451 | u_char **sigp, int *lenp, u_char *data, int datalen); |
452 | 452 | ||
453 | struct Authctxt { | 453 | struct Authctxt { |
454 | const char *server_user; | 454 | const char *server_user; |
@@ -475,7 +475,7 @@ int userauth_pubkey(Authctxt *authctxt); | |||
475 | int userauth_passwd(Authctxt *authctxt); | 475 | int userauth_passwd(Authctxt *authctxt); |
476 | int userauth_kbdint(Authctxt *authctxt); | 476 | int userauth_kbdint(Authctxt *authctxt); |
477 | 477 | ||
478 | void authmethod_clear(); | 478 | void authmethod_clear(void); |
479 | Authmethod *authmethod_get(char *authlist); | 479 | Authmethod *authmethod_get(char *authlist); |
480 | Authmethod *authmethod_lookup(const char *name); | 480 | Authmethod *authmethod_lookup(const char *name); |
481 | 481 | ||
@@ -644,7 +644,7 @@ int | |||
644 | sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) | 644 | sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) |
645 | { | 645 | { |
646 | Buffer b; | 646 | Buffer b; |
647 | unsigned char *blob, *signature; | 647 | u_char *blob, *signature; |
648 | int bloblen, slen; | 648 | int bloblen, slen; |
649 | int skip = 0; | 649 | int skip = 0; |
650 | int ret = -1; | 650 | int ret = -1; |
@@ -725,8 +725,8 @@ sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) | |||
725 | } | 725 | } |
726 | 726 | ||
727 | /* sign callback */ | 727 | /* sign callback */ |
728 | int key_sign_cb(Authctxt *authctxt, Key *key, unsigned char **sigp, int *lenp, | 728 | int key_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, int *lenp, |
729 | unsigned char *data, int datalen) | 729 | u_char *data, int datalen) |
730 | { | 730 | { |
731 | return key_sign(key, sigp, lenp, data, datalen); | 731 | return key_sign(key, sigp, lenp, data, datalen); |
732 | } | 732 | } |
@@ -777,8 +777,8 @@ userauth_pubkey_identity(Authctxt *authctxt, char *filename) | |||
777 | } | 777 | } |
778 | 778 | ||
779 | /* sign callback */ | 779 | /* sign callback */ |
780 | int agent_sign_cb(Authctxt *authctxt, Key *key, unsigned char **sigp, int *lenp, | 780 | int agent_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, int *lenp, |
781 | unsigned char *data, int datalen) | 781 | u_char *data, int datalen) |
782 | { | 782 | { |
783 | return ssh_agent_sign(authctxt->agent, key, sigp, lenp, data, datalen); | 783 | return ssh_agent_sign(authctxt->agent, key, sigp, lenp, data, datalen); |
784 | } | 784 | } |
@@ -869,7 +869,7 @@ input_userauth_info_req(int type, int plen, void *ctxt) | |||
869 | char *lang = NULL; | 869 | char *lang = NULL; |
870 | char *prompt = NULL; | 870 | char *prompt = NULL; |
871 | char *response = NULL; | 871 | char *response = NULL; |
872 | unsigned int num_prompts, i; | 872 | u_int num_prompts, i; |
873 | int echo = 0; | 873 | int echo = 0; |
874 | 874 | ||
875 | debug2("input_userauth_info_req"); | 875 | debug2("input_userauth_info_req"); |
@@ -933,7 +933,7 @@ static char *authlist_state = NULL; /* state variable for strtok_r() */ | |||
933 | * finished processing server list to free resources. | 933 | * finished processing server list to free resources. |
934 | */ | 934 | */ |
935 | void | 935 | void |
936 | authmethod_clear() | 936 | authmethod_clear(void) |
937 | { | 937 | { |
938 | if (authlist_current != NULL) { | 938 | if (authlist_current != NULL) { |
939 | xfree(authlist_current); | 939 | xfree(authlist_current); |