summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2000-12-22 01:43:59 +0000
committerBen Lindstrom <mouring@eviladmin.org>2000-12-22 01:43:59 +0000
commit46c162204b5a6f7471525c2f75cb2c607c88b83f (patch)
tree9041b006ab612c18bdb16b606601839a00ca5b2c /sshd.c
parenta074feb65d6f1fcad02e80b751e2287fd6230b09 (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 'sshd.c')
-rw-r--r--sshd.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/sshd.c b/sshd.c
index b5d66acdb..e10e530f5 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.139 2000/12/15 17:30:14 provos Exp $"); 43RCSID("$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;
162int received_sighup = 0; 162int received_sighup = 0;
163 163
164/* session identifier, used by RSA-auth */ 164/* session identifier, used by RSA-auth */
165unsigned char session_id[16]; 165u_char session_id[16];
166 166
167/* same for ssh2 */ 167/* same for ssh2 */
168unsigned char *session_id2 = NULL; 168u_char *session_id2 = NULL;
169int session_id2_len = 0; 169int session_id2_len = 0;
170 170
171/* record remote hostname or ip */ 171/* record remote hostname or ip */
172unsigned int utmp_len = MAXHOSTNAMELEN; 172u_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. */
175void do_ssh1_kex(); 175void do_ssh1_kex(void);
176void do_ssh2_kex(); 176void do_ssh2_kex(void);
177 177
178void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *); 178void ssh_dh1_server(Kex *, Buffer *_kexinit, Buffer *);
179void ssh_dhgex_server(Kex *, Buffer *_kexinit, Buffer *); 179void 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 */
1174void 1176void
1175do_ssh1_kex() 1177do_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 */
1365void 1367void
1366do_ssh2_kex() 1368do_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;