diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 50 |
1 files changed, 26 insertions, 24 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.139 2000/12/15 17:30:14 provos Exp $"); | 43 | RCSID("$OpenBSD: sshd.c,v 1.142 2000/12/20 19:37:22 markus Exp $"); |
44 | 44 | ||
45 | #include "xmalloc.h" | 45 | #include "xmalloc.h" |
46 | #include "rsa.h" | 46 | #include "rsa.h" |
@@ -162,18 +162,18 @@ int key_used = 0; | |||
162 | int received_sighup = 0; | 162 | int received_sighup = 0; |
163 | 163 | ||
164 | /* session identifier, used by RSA-auth */ | 164 | /* session identifier, used by RSA-auth */ |
165 | unsigned char session_id[16]; | 165 | u_char session_id[16]; |
166 | 166 | ||
167 | /* same for ssh2 */ | 167 | /* same for ssh2 */ |
168 | unsigned char *session_id2 = NULL; | 168 | u_char *session_id2 = NULL; |
169 | int session_id2_len = 0; | 169 | int session_id2_len = 0; |
170 | 170 | ||
171 | /* record remote hostname or ip */ | 171 | /* record remote hostname or ip */ |
172 | unsigned int utmp_len = MAXHOSTNAMELEN; | 172 | u_int utmp_len = MAXHOSTNAMELEN; |
173 | 173 | ||
174 | /* Prototypes for various functions defined later in this file. */ | 174 | /* Prototypes for various functions defined later in this file. */ |
175 | void do_ssh1_kex(); | 175 | void do_ssh1_kex(void); |
176 | void do_ssh2_kex(); | 176 | void do_ssh2_kex(void); |
177 | 177 | ||
178 | void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *); | 178 | void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *); |
179 | void ssh_dhgex_server(Kex *, Buffer *_kexinit, Buffer *); | 179 | void ssh_dhgex_server(Kex *, Buffer *_kexinit, Buffer *); |
@@ -692,6 +692,8 @@ main(int ac, char **av) | |||
692 | 692 | ||
693 | /* load private host keys */ | 693 | /* load private host keys */ |
694 | sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*)); | 694 | sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*)); |
695 | for(i = 0; i < options.num_host_key_files; i++) | ||
696 | sensitive_data.host_keys[i] = NULL; | ||
695 | sensitive_data.server_key = NULL; | 697 | sensitive_data.server_key = NULL; |
696 | sensitive_data.ssh1_host_key = NULL; | 698 | sensitive_data.ssh1_host_key = NULL; |
697 | sensitive_data.have_ssh1_key = 0; | 699 | sensitive_data.have_ssh1_key = 0; |
@@ -882,7 +884,7 @@ main(int ac, char **av) | |||
882 | */ | 884 | */ |
883 | f = fopen(options.pid_file, "wb"); | 885 | f = fopen(options.pid_file, "wb"); |
884 | if (f) { | 886 | if (f) { |
885 | fprintf(f, "%u\n", (unsigned int) getpid()); | 887 | fprintf(f, "%u\n", (u_int) getpid()); |
886 | fclose(f); | 888 | fclose(f); |
887 | } | 889 | } |
888 | } | 890 | } |
@@ -1172,14 +1174,14 @@ main(int ac, char **av) | |||
1172 | * SSH1 key exchange | 1174 | * SSH1 key exchange |
1173 | */ | 1175 | */ |
1174 | void | 1176 | void |
1175 | do_ssh1_kex() | 1177 | do_ssh1_kex(void) |
1176 | { | 1178 | { |
1177 | int i, len; | 1179 | int i, len; |
1178 | int plen, slen; | 1180 | int plen, slen; |
1179 | BIGNUM *session_key_int; | 1181 | BIGNUM *session_key_int; |
1180 | unsigned char session_key[SSH_SESSION_KEY_LENGTH]; | 1182 | u_char session_key[SSH_SESSION_KEY_LENGTH]; |
1181 | unsigned char cookie[8]; | 1183 | u_char cookie[8]; |
1182 | unsigned int cipher_type, auth_mask, protocol_flags; | 1184 | u_int cipher_type, auth_mask, protocol_flags; |
1183 | u_int32_t rand = 0; | 1185 | u_int32_t rand = 0; |
1184 | 1186 | ||
1185 | /* | 1187 | /* |
@@ -1363,7 +1365,7 @@ do_ssh1_kex() | |||
1363 | * SSH2 key exchange: diffie-hellman-group1-sha1 | 1365 | * SSH2 key exchange: diffie-hellman-group1-sha1 |
1364 | */ | 1366 | */ |
1365 | void | 1367 | void |
1366 | do_ssh2_kex() | 1368 | do_ssh2_kex(void) |
1367 | { | 1369 | { |
1368 | Buffer *server_kexinit; | 1370 | Buffer *server_kexinit; |
1369 | Buffer *client_kexinit; | 1371 | Buffer *client_kexinit; |
@@ -1436,12 +1438,12 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) | |||
1436 | #endif | 1438 | #endif |
1437 | int payload_len, dlen; | 1439 | int payload_len, dlen; |
1438 | int slen; | 1440 | int slen; |
1439 | unsigned char *signature = NULL; | 1441 | u_char *signature = NULL; |
1440 | unsigned char *server_host_key_blob = NULL; | 1442 | u_char *server_host_key_blob = NULL; |
1441 | unsigned int sbloblen; | 1443 | u_int sbloblen; |
1442 | unsigned int klen, kout; | 1444 | u_int klen, kout; |
1443 | unsigned char *kbuf; | 1445 | u_char *kbuf; |
1444 | unsigned char *hash; | 1446 | u_char *hash; |
1445 | BIGNUM *shared_secret = 0; | 1447 | BIGNUM *shared_secret = 0; |
1446 | DH *dh; | 1448 | DH *dh; |
1447 | BIGNUM *dh_client_pub = 0; | 1449 | BIGNUM *dh_client_pub = 0; |
@@ -1565,12 +1567,12 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) | |||
1565 | #endif | 1567 | #endif |
1566 | int payload_len, dlen; | 1568 | int payload_len, dlen; |
1567 | int slen, nbits; | 1569 | int slen, nbits; |
1568 | unsigned char *signature = NULL; | 1570 | u_char *signature = NULL; |
1569 | unsigned char *server_host_key_blob = NULL; | 1571 | u_char *server_host_key_blob = NULL; |
1570 | unsigned int sbloblen; | 1572 | u_int sbloblen; |
1571 | unsigned int klen, kout; | 1573 | u_int klen, kout; |
1572 | unsigned char *kbuf; | 1574 | u_char *kbuf; |
1573 | unsigned char *hash; | 1575 | u_char *hash; |
1574 | BIGNUM *shared_secret = 0; | 1576 | BIGNUM *shared_secret = 0; |
1575 | DH *dh; | 1577 | DH *dh; |
1576 | BIGNUM *dh_client_pub = 0; | 1578 | BIGNUM *dh_client_pub = 0; |