summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--auth-rhosts.c5
-rw-r--r--authfile.c3
-rw-r--r--canohost.c3
-rw-r--r--cli.c13
-rw-r--r--clientloop.c28
-rw-r--r--compress.c3
-rw-r--r--hmac.c4
-rw-r--r--hostfile.h5
-rw-r--r--kex.c4
-rw-r--r--mpaux.c4
-rw-r--r--packet.c6
-rw-r--r--pty.c8
-rw-r--r--readpass.c3
-rw-r--r--scp.c6
-rw-r--r--serverloop.c18
-rw-r--r--session.c3
-rw-r--r--ssh-dss.c3
-rw-r--r--ssh-rsa.c3
-rw-r--r--ssh.c10
-rw-r--r--sshconnect.c6
-rw-r--r--sshconnect1.c10
-rw-r--r--sshd.c10
-rw-r--r--tildexpand.c3
-rw-r--r--uuencode.c4
25 files changed, 100 insertions, 73 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a0dfbdfa..fe8c42829 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,12 @@
25 [clientloop.c] 25 [clientloop.c]
26 remove confusing callback code 26 remove confusing callback code
27 - (djm) Add CVS Id's to files that we have missed 27 - (djm) Add CVS Id's to files that we have missed
28 - (bal) OpenBSD Sync (more):
29 - itojun@cvs.openbsd.org 2001/02/08 19:30:52
30 sync with netbsd tree changes.
31 - more strict prototypes, include necessary headers
32 - use paths.h/pathnames.h decls
33 - size_t typecase to int -> u_long
28 34
2920010208 3520010208
30 - (djm) Don't delete external askpass program in make uninstall target. 36 - (djm) Don't delete external askpass program in make uninstall target.
@@ -3678,4 +3684,4 @@
3678 - Wrote replacements for strlcpy and mkdtemp 3684 - Wrote replacements for strlcpy and mkdtemp
3679 - Released 1.0pre1 3685 - Released 1.0pre1
3680 3686
3681$Id: ChangeLog,v 1.704 2001/02/09 01:55:35 djm Exp $ 3687$Id: ChangeLog,v 1.705 2001/02/09 02:11:24 mouring Exp $
diff --git a/auth-rhosts.c b/auth-rhosts.c
index d8d10ffc9..9b018c9d9 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rhosts.c,v 1.20 2001/02/03 10:08:36 markus Exp $"); 17RCSID("$OpenBSD: auth-rhosts.c,v 1.21 2001/02/08 19:30:51 itojun Exp $");
18 18
19#include "packet.h" 19#include "packet.h"
20#include "xmalloc.h" 20#include "xmalloc.h"
@@ -23,6 +23,7 @@ RCSID("$OpenBSD: auth-rhosts.c,v 1.20 2001/02/03 10:08:36 markus Exp $");
23#include "log.h" 23#include "log.h"
24#include "servconf.h" 24#include "servconf.h"
25#include "canohost.h" 25#include "canohost.h"
26#include "auth.h"
26 27
27/* 28/*
28 * This function processes an rhosts-style file (.rhosts, .shosts, or 29 * This function processes an rhosts-style file (.rhosts, .shosts, or
@@ -188,7 +189,7 @@ auth_rhosts(struct passwd *pw, const char *client_user)
188 189
189 /* If not logging in as superuser, try /etc/hosts.equiv and shosts.equiv. */ 190 /* If not logging in as superuser, try /etc/hosts.equiv and shosts.equiv. */
190 if (pw->pw_uid != 0) { 191 if (pw->pw_uid != 0) {
191 if (check_rhosts_file("/etc/hosts.equiv", hostname, ipaddr, client_user, 192 if (check_rhosts_file(_PATH_RHOSTS_EQUIV, hostname, ipaddr, client_user,
192 pw->pw_name)) { 193 pw->pw_name)) {
193 packet_send_debug("Accepted for %.100s [%.100s] by /etc/hosts.equiv.", 194 packet_send_debug("Accepted for %.100s [%.100s] by /etc/hosts.equiv.",
194 hostname, ipaddr); 195 hostname, ipaddr);
diff --git a/authfile.c b/authfile.c
index 8d39e32e4..aa898c725 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: authfile.c,v 1.26 2001/01/28 22:27:05 stevesk Exp $"); 39RCSID("$OpenBSD: authfile.c,v 1.27 2001/02/08 19:30:51 itojun Exp $");
40 40
41#include <openssl/err.h> 41#include <openssl/err.h>
42#include <openssl/evp.h> 42#include <openssl/evp.h>
@@ -49,6 +49,7 @@ RCSID("$OpenBSD: authfile.c,v 1.26 2001/01/28 22:27:05 stevesk Exp $");
49#include "key.h" 49#include "key.h"
50#include "ssh.h" 50#include "ssh.h"
51#include "log.h" 51#include "log.h"
52#include "authfile.h"
52 53
53/* Version identification string for identity files. */ 54/* Version identification string for identity files. */
54static const char authfile_id_string[] = 55static const char authfile_id_string[] =
diff --git a/canohost.c b/canohost.c
index 87f56054b..8f4bebda2 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,11 +12,12 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.20 2001/02/03 10:08:37 markus Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.21 2001/02/08 19:30:51 itojun Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
19#include "log.h" 19#include "log.h"
20#include "canohost.h"
20 21
21void check_ip_options(int socket, char *ipaddr); 22void check_ip_options(int socket, char *ipaddr);
22 23
diff --git a/cli.c b/cli.c
index 67a718b7c..6152a810e 100644
--- a/cli.c
+++ b/cli.c
@@ -1,8 +1,9 @@
1#include "includes.h" 1#include "includes.h"
2RCSID("$OpenBSD: cli.c,v 1.7 2001/02/04 15:32:23 stevesk Exp $"); 2RCSID("$OpenBSD: cli.c,v 1.8 2001/02/08 19:30:51 itojun Exp $");
3 3
4#include "xmalloc.h" 4#include "xmalloc.h"
5#include "log.h" 5#include "log.h"
6#include "cli.h"
6 7
7static int cli_input = -1; 8static int cli_input = -1;
8static int cli_output = -1; 9static int cli_output = -1;
@@ -31,7 +32,7 @@ cli_open(int from_stdin)
31 cli_input = STDIN_FILENO; 32 cli_input = STDIN_FILENO;
32 cli_output = STDERR_FILENO; 33 cli_output = STDERR_FILENO;
33 } else { 34 } else {
34 cli_input = cli_output = open("/dev/tty", O_RDWR); 35 cli_input = cli_output = open(_PATH_TTY, O_RDWR);
35 if (cli_input < 0) 36 if (cli_input < 0)
36 fatal("You have no controlling tty. Cannot read passphrase."); 37 fatal("You have no controlling tty. Cannot read passphrase.");
37 } 38 }
@@ -42,7 +43,7 @@ cli_open(int from_stdin)
42} 43}
43 44
44static void 45static void
45cli_close() 46cli_close(void)
46{ 47{
47 if (!cli_from_stdin && cli_input >= 0) 48 if (!cli_from_stdin && cli_input >= 0)
48 close(cli_input); 49 close(cli_input);
@@ -53,13 +54,13 @@ cli_close()
53} 54}
54 55
55void 56void
56intrcatch() 57intrcatch(int sig)
57{ 58{
58 intr = 1; 59 intr = 1;
59} 60}
60 61
61static void 62static void
62cli_echo_disable() 63cli_echo_disable(void)
63{ 64{
64 sigemptyset(&nset); 65 sigemptyset(&nset);
65 sigaddset(&nset, SIGTSTP); 66 sigaddset(&nset, SIGTSTP);
@@ -82,7 +83,7 @@ cli_echo_disable()
82} 83}
83 84
84static void 85static void
85cli_echo_restore() 86cli_echo_restore(void)
86{ 87{
87 if (echo_modified != 0) { 88 if (echo_modified != 0) {
88 tcsetattr(cli_input, TCSANOW, &otio); 89 tcsetattr(cli_input, TCSANOW, &otio);
diff --git a/clientloop.c b/clientloop.c
index d57b300de..e892c1abd 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.48 2001/02/06 22:43:02 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.49 2001/02/08 19:30:51 itojun Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -133,7 +133,7 @@ int session_ident = -1;
133/* Returns the user\'s terminal to normal mode if it had been put in raw mode. */ 133/* Returns the user\'s terminal to normal mode if it had been put in raw mode. */
134 134
135void 135void
136leave_raw_mode() 136leave_raw_mode(void)
137{ 137{
138 if (!in_raw_mode) 138 if (!in_raw_mode)
139 return; 139 return;
@@ -147,7 +147,7 @@ leave_raw_mode()
147/* Puts the user\'s terminal in raw mode. */ 147/* Puts the user\'s terminal in raw mode. */
148 148
149void 149void
150enter_raw_mode() 150enter_raw_mode(void)
151{ 151{
152 struct termios tio; 152 struct termios tio;
153 153
@@ -173,7 +173,7 @@ enter_raw_mode()
173/* Restores stdin to blocking mode. */ 173/* Restores stdin to blocking mode. */
174 174
175void 175void
176leave_non_blocking() 176leave_non_blocking(void)
177{ 177{
178 if (in_non_blocking_mode) { 178 if (in_non_blocking_mode) {
179 (void) fcntl(fileno(stdin), F_SETFL, 0); 179 (void) fcntl(fileno(stdin), F_SETFL, 0);
@@ -185,7 +185,7 @@ leave_non_blocking()
185/* Puts stdin terminal in non-blocking mode. */ 185/* Puts stdin terminal in non-blocking mode. */
186 186
187void 187void
188enter_non_blocking() 188enter_non_blocking(void)
189{ 189{
190 in_non_blocking_mode = 1; 190 in_non_blocking_mode = 1;
191 (void) fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); 191 (void) fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
@@ -227,7 +227,7 @@ signal_handler(int sig)
227 */ 227 */
228 228
229double 229double
230get_current_time() 230get_current_time(void)
231{ 231{
232 struct timeval tv; 232 struct timeval tv;
233 gettimeofday(&tv, NULL); 233 gettimeofday(&tv, NULL);
@@ -241,7 +241,7 @@ get_current_time()
241 */ 241 */
242 242
243void 243void
244client_check_initial_eof_on_stdin() 244client_check_initial_eof_on_stdin(void)
245{ 245{
246 int len; 246 int len;
247 char buf[1]; 247 char buf[1];
@@ -295,7 +295,7 @@ client_check_initial_eof_on_stdin()
295 */ 295 */
296 296
297void 297void
298client_make_packets_from_stdin_data() 298client_make_packets_from_stdin_data(void)
299{ 299{
300 u_int len; 300 u_int len;
301 301
@@ -326,7 +326,7 @@ client_make_packets_from_stdin_data()
326 */ 326 */
327 327
328void 328void
329client_check_window_change() 329client_check_window_change(void)
330{ 330{
331 struct winsize ws; 331 struct winsize ws;
332 332
@@ -760,7 +760,7 @@ client_process_output(fd_set * writeset)
760 */ 760 */
761 761
762void 762void
763client_process_buffered_input_packets() 763client_process_buffered_input_packets(void)
764{ 764{
765 dispatch_run(DISPATCH_NONBLOCK, &quit_pending, NULL); 765 dispatch_run(DISPATCH_NONBLOCK, &quit_pending, NULL);
766} 766}
@@ -1195,7 +1195,7 @@ client_input_channel_req(int type, int plen, void *ctxt)
1195} 1195}
1196 1196
1197void 1197void
1198client_init_dispatch_20() 1198client_init_dispatch_20(void)
1199{ 1199{
1200 dispatch_init(&dispatch_protocol_error); 1200 dispatch_init(&dispatch_protocol_error);
1201 dispatch_set(SSH2_MSG_CHANNEL_CLOSE, &channel_input_oclose); 1201 dispatch_set(SSH2_MSG_CHANNEL_CLOSE, &channel_input_oclose);
@@ -1209,7 +1209,7 @@ client_init_dispatch_20()
1209 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust); 1209 dispatch_set(SSH2_MSG_CHANNEL_WINDOW_ADJUST, &channel_input_window_adjust);
1210} 1210}
1211void 1211void
1212client_init_dispatch_13() 1212client_init_dispatch_13(void)
1213{ 1213{
1214 dispatch_init(NULL); 1214 dispatch_init(NULL);
1215 dispatch_set(SSH_MSG_CHANNEL_CLOSE, &channel_input_close); 1215 dispatch_set(SSH_MSG_CHANNEL_CLOSE, &channel_input_close);
@@ -1228,14 +1228,14 @@ client_init_dispatch_13()
1228 &x11_input_open : &deny_input_open); 1228 &x11_input_open : &deny_input_open);
1229} 1229}
1230void 1230void
1231client_init_dispatch_15() 1231client_init_dispatch_15(void)
1232{ 1232{
1233 client_init_dispatch_13(); 1233 client_init_dispatch_13();
1234 dispatch_set(SSH_MSG_CHANNEL_CLOSE, &channel_input_ieof); 1234 dispatch_set(SSH_MSG_CHANNEL_CLOSE, &channel_input_ieof);
1235 dispatch_set(SSH_MSG_CHANNEL_CLOSE_CONFIRMATION, & channel_input_oclose); 1235 dispatch_set(SSH_MSG_CHANNEL_CLOSE_CONFIRMATION, & channel_input_oclose);
1236} 1236}
1237void 1237void
1238client_init_dispatch() 1238client_init_dispatch(void)
1239{ 1239{
1240 if (compat20) 1240 if (compat20)
1241 client_init_dispatch_20(); 1241 client_init_dispatch_20();
diff --git a/compress.c b/compress.c
index 1871bc8cc..e8539baf0 100644
--- a/compress.c
+++ b/compress.c
@@ -12,11 +12,12 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: compress.c,v 1.12 2001/01/21 19:05:48 markus Exp $"); 15RCSID("$OpenBSD: compress.c,v 1.13 2001/02/08 19:30:51 itojun Exp $");
16 16
17#include "log.h" 17#include "log.h"
18#include "buffer.h" 18#include "buffer.h"
19#include "zlib.h" 19#include "zlib.h"
20#include "compress.h"
20 21
21static z_stream incoming_stream; 22static z_stream incoming_stream;
22static z_stream outgoing_stream; 23static z_stream outgoing_stream;
diff --git a/hmac.c b/hmac.c
index e440d6117..831dd243a 100644
--- a/hmac.c
+++ b/hmac.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: hmac.c,v 1.6 2001/01/21 19:05:49 markus Exp $"); 26RCSID("$OpenBSD: hmac.c,v 1.7 2001/02/08 19:30:51 itojun Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29#include "getput.h" 29#include "getput.h"
@@ -31,6 +31,8 @@ RCSID("$OpenBSD: hmac.c,v 1.6 2001/01/21 19:05:49 markus Exp $");
31 31
32#include <openssl/hmac.h> 32#include <openssl/hmac.h>
33 33
34#include "hmac.h"
35
34u_char * 36u_char *
35hmac( 37hmac(
36 EVP_MD *evp_md, 38 EVP_MD *evp_md,
diff --git a/hostfile.h b/hostfile.h
index e1f5d164a..346bcd9ba 100644
--- a/hostfile.h
+++ b/hostfile.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.h,v 1.6 2001/01/29 01:58:16 niklas Exp $ */ 1/* $OpenBSD: hostfile.h,v 1.7 2001/02/08 19:30:51 itojun Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -14,6 +14,9 @@
14#ifndef HOSTFILE_H 14#ifndef HOSTFILE_H
15#define HOSTFILE_H 15#define HOSTFILE_H
16 16
17int
18auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n);
19
17/* 20/*
18 * Checks whether the given host is already in the list of our known hosts. 21 * Checks whether the given host is already in the list of our known hosts.
19 * Returns HOST_OK if the host is known and has the specified key, HOST_NEW 22 * Returns HOST_OK if the host is known and has the specified key, HOST_NEW
diff --git a/kex.c b/kex.c
index 754ced8eb..7c1326ed0 100644
--- a/kex.c
+++ b/kex.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: kex.c,v 1.19 2001/02/04 15:32:23 stevesk Exp $"); 26RCSID("$OpenBSD: kex.c,v 1.20 2001/02/08 19:30:51 itojun Exp $");
27 27
28#include <openssl/crypto.h> 28#include <openssl/crypto.h>
29#include <openssl/bio.h> 29#include <openssl/bio.h>
@@ -200,6 +200,7 @@ dh_new_group1(void)
200 return (dh_new_group_asc(gen, group1)); 200 return (dh_new_group_asc(gen, group1));
201} 201}
202 202
203#ifdef DEBUG_KEX
203void 204void
204dump_digest(u_char *digest, int len) 205dump_digest(u_char *digest, int len)
205{ 206{
@@ -211,6 +212,7 @@ dump_digest(u_char *digest, int len)
211 } 212 }
212 fprintf(stderr, "\n"); 213 fprintf(stderr, "\n");
213} 214}
215#endif
214 216
215u_char * 217u_char *
216kex_hash( 218kex_hash(
diff --git a/mpaux.c b/mpaux.c
index 6b586ec04..0c486275f 100644
--- a/mpaux.c
+++ b/mpaux.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: mpaux.c,v 1.15 2000/12/19 23:17:57 markus Exp $"); 16RCSID("$OpenBSD: mpaux.c,v 1.16 2001/02/08 19:30:52 itojun Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include "getput.h" 19#include "getput.h"
@@ -21,6 +21,8 @@ RCSID("$OpenBSD: mpaux.c,v 1.15 2000/12/19 23:17:57 markus Exp $");
21 21
22#include <openssl/md5.h> 22#include <openssl/md5.h>
23 23
24#include "mpaux.h"
25
24void 26void
25compute_session_id(u_char session_id[16], 27compute_session_id(u_char session_id[16],
26 u_char cookie[8], 28 u_char cookie[8],
diff --git a/packet.c b/packet.c
index 5a024fa9b..956e711ec 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.48 2001/02/04 15:32:24 stevesk Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.49 2001/02/08 19:30:52 itojun Exp $");
41 41
42#include "xmalloc.h" 42#include "xmalloc.h"
43#include "buffer.h" 43#include "buffer.h"
@@ -455,7 +455,7 @@ packet_put_bignum2(BIGNUM * value)
455 */ 455 */
456 456
457void 457void
458packet_send1() 458packet_send1(void)
459{ 459{
460 char buf[8], *cp; 460 char buf[8], *cp;
461 int i, padding, len; 461 int i, padding, len;
@@ -529,7 +529,7 @@ packet_send1()
529 * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue) 529 * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue)
530 */ 530 */
531void 531void
532packet_send2() 532packet_send2(void)
533{ 533{
534 u_char *macbuf = NULL; 534 u_char *macbuf = NULL;
535 char *cp; 535 char *cp;
diff --git a/pty.c b/pty.c
index 83b219b90..e71bceb80 100644
--- a/pty.c
+++ b/pty.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: pty.c,v 1.20 2001/01/21 19:05:53 markus Exp $"); 15RCSID("$OpenBSD: pty.c,v 1.22 2001/02/08 19:30:52 itojun Exp $");
16 16
17#ifdef HAVE_UTIL_H 17#ifdef HAVE_UTIL_H
18# include <util.h> 18# include <util.h>
@@ -217,7 +217,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
217 217
218 /* First disconnect from the old controlling tty. */ 218 /* First disconnect from the old controlling tty. */
219#ifdef TIOCNOTTY 219#ifdef TIOCNOTTY
220 fd = open("/dev/tty", O_RDWR | O_NOCTTY); 220 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
221 if (fd >= 0) { 221 if (fd >= 0) {
222 (void) ioctl(fd, TIOCNOTTY, NULL); 222 (void) ioctl(fd, TIOCNOTTY, NULL);
223 close(fd); 223 close(fd);
@@ -230,7 +230,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
230 * Verify that we are successfully disconnected from the controlling 230 * Verify that we are successfully disconnected from the controlling
231 * tty. 231 * tty.
232 */ 232 */
233 fd = open("/dev/tty", O_RDWR | O_NOCTTY); 233 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
234 if (fd >= 0) { 234 if (fd >= 0) {
235 error("Failed to disconnect from controlling tty."); 235 error("Failed to disconnect from controlling tty.");
236 close(fd); 236 close(fd);
@@ -262,7 +262,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
262#endif /* USE_VHANGUP */ 262#endif /* USE_VHANGUP */
263 } 263 }
264 /* Verify that we now have a controlling tty. */ 264 /* Verify that we now have a controlling tty. */
265 fd = open("/dev/tty", O_WRONLY); 265 fd = open(_PATH_TTY, O_WRONLY);
266 if (fd < 0) 266 if (fd < 0)
267 error("open /dev/tty failed - could not set controlling tty: %.100s", 267 error("open /dev/tty failed - could not set controlling tty: %.100s",
268 strerror(errno)); 268 strerror(errno));
diff --git a/readpass.c b/readpass.c
index fe158d549..3d73af747 100644
--- a/readpass.c
+++ b/readpass.c
@@ -32,10 +32,11 @@
32 */ 32 */
33 33
34#include "includes.h" 34#include "includes.h"
35RCSID("$OpenBSD: readpass.c,v 1.13 2001/01/21 19:05:54 markus Exp $"); 35RCSID("$OpenBSD: readpass.c,v 1.14 2001/02/08 19:30:52 itojun Exp $");
36 36
37#include "xmalloc.h" 37#include "xmalloc.h"
38#include "cli.h" 38#include "cli.h"
39#include "readpass.h"
39 40
40/* 41/*
41 * Reads a passphrase from /dev/tty with echo turned off. Returns the 42 * Reads a passphrase from /dev/tty with echo turned off. Returns the
diff --git a/scp.c b/scp.c
index 14d8a8af8..0095d6ff8 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.55 2001/02/08 14:38:54 deraadt Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.56 2001/02/08 19:30:52 itojun Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -219,11 +219,13 @@ int pflag, iamremote, iamrecursive, targetshouldbedirectory;
219#define CMDNEEDS 64 219#define CMDNEEDS 64
220char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ 220char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
221 221
222int main(int, char *[]);
222int response(void); 223int response(void);
223void rsource(char *, struct stat *); 224void rsource(char *, struct stat *);
224void sink(int, char *[]); 225void sink(int, char *[]);
225void source(int, char *[]); 226void source(int, char *[]);
226void tolocal(int, char *[]); 227void tolocal(int, char *[]);
228char *cleanhostname(char *);
227void toremote(char *, int, char *[]); 229void toremote(char *, int, char *[]);
228void usage(void); 230void usage(void);
229 231
@@ -1110,7 +1112,7 @@ updateprogressmeter(int ignore)
1110} 1112}
1111 1113
1112int 1114int
1113foregroundproc() 1115foregroundproc(void)
1114{ 1116{
1115 static pid_t pgrp = -1; 1117 static pid_t pgrp = -1;
1116 int ctty_pgrp; 1118 int ctty_pgrp;
diff --git a/serverloop.c b/serverloop.c
index 024c54bc3..c8187ab20 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: serverloop.c,v 1.45 2001/02/04 15:32:25 stevesk Exp $"); 38RCSID("$OpenBSD: serverloop.c,v 1.46 2001/02/08 19:30:52 itojun Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "packet.h" 41#include "packet.h"
@@ -119,7 +119,7 @@ sigchld_handler2(int sig)
119 * to the client. 119 * to the client.
120 */ 120 */
121void 121void
122make_packets_from_stderr_data() 122make_packets_from_stderr_data(void)
123{ 123{
124 int len; 124 int len;
125 125
@@ -148,7 +148,7 @@ make_packets_from_stderr_data()
148 * client. 148 * client.
149 */ 149 */
150void 150void
151make_packets_from_stdout_data() 151make_packets_from_stdout_data(void)
152{ 152{
153 int len; 153 int len;
154 154
@@ -352,7 +352,7 @@ process_output(fd_set * writeset)
352 * This is used when the program terminates. 352 * This is used when the program terminates.
353 */ 353 */
354void 354void
355drain_output() 355drain_output(void)
356{ 356{
357 /* Send any buffered stdout data to the client. */ 357 /* Send any buffered stdout data to the client. */
358 if (buffer_len(&stdout_buffer) > 0) { 358 if (buffer_len(&stdout_buffer) > 0) {
@@ -377,7 +377,7 @@ drain_output()
377} 377}
378 378
379void 379void
380process_buffered_input_packets() 380process_buffered_input_packets(void)
381{ 381{
382 dispatch_run(DISPATCH_NONBLOCK, NULL, NULL); 382 dispatch_run(DISPATCH_NONBLOCK, NULL, NULL);
383} 383}
@@ -882,7 +882,7 @@ server_input_global_request(int type, int plen, void *ctxt)
882} 882}
883 883
884void 884void
885server_init_dispatch_20() 885server_init_dispatch_20(void)
886{ 886{
887 debug("server_init_dispatch_20"); 887 debug("server_init_dispatch_20");
888 dispatch_init(&dispatch_protocol_error); 888 dispatch_init(&dispatch_protocol_error);
@@ -898,7 +898,7 @@ server_init_dispatch_20()
898 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request); 898 dispatch_set(SSH2_MSG_GLOBAL_REQUEST, &server_input_global_request);
899} 899}
900void 900void
901server_init_dispatch_13() 901server_init_dispatch_13(void)
902{ 902{
903 debug("server_init_dispatch_13"); 903 debug("server_init_dispatch_13");
904 dispatch_init(NULL); 904 dispatch_init(NULL);
@@ -913,7 +913,7 @@ server_init_dispatch_13()
913 dispatch_set(SSH_MSG_PORT_OPEN, &channel_input_port_open); 913 dispatch_set(SSH_MSG_PORT_OPEN, &channel_input_port_open);
914} 914}
915void 915void
916server_init_dispatch_15() 916server_init_dispatch_15(void)
917{ 917{
918 server_init_dispatch_13(); 918 server_init_dispatch_13();
919 debug("server_init_dispatch_15"); 919 debug("server_init_dispatch_15");
@@ -921,7 +921,7 @@ server_init_dispatch_15()
921 dispatch_set(SSH_MSG_CHANNEL_CLOSE_CONFIRMATION, &channel_input_oclose); 921 dispatch_set(SSH_MSG_CHANNEL_CLOSE_CONFIRMATION, &channel_input_oclose);
922} 922}
923void 923void
924server_init_dispatch() 924server_init_dispatch(void)
925{ 925{
926 if (compat20) 926 if (compat20)
927 server_init_dispatch_20(); 927 server_init_dispatch_20();
diff --git a/session.c b/session.c
index dcbf70f31..92fb31e09 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.52 2001/02/03 10:08:37 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.55 2001/02/08 19:30:52 itojun Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -56,6 +56,7 @@ RCSID("$OpenBSD: session.c,v 1.52 2001/02/03 10:08:37 markus Exp $");
56#include "login.h" 56#include "login.h"
57#include "serverloop.h" 57#include "serverloop.h"
58#include "canohost.h" 58#include "canohost.h"
59#include "session.h"
59 60
60#ifdef WITH_IRIX_PROJECT 61#ifdef WITH_IRIX_PROJECT
61#include <proj.h> 62#include <proj.h>
diff --git a/ssh-dss.c b/ssh-dss.c
index 11513e678..adc8f983e 100644
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: ssh-dss.c,v 1.5 2001/02/04 15:32:25 stevesk Exp $"); 26RCSID("$OpenBSD: ssh-dss.c,v 1.6 2001/02/08 19:30:52 itojun Exp $");
27 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/evp.h> 29#include <openssl/evp.h>
@@ -34,6 +34,7 @@ RCSID("$OpenBSD: ssh-dss.c,v 1.5 2001/02/04 15:32:25 stevesk Exp $");
34#include "compat.h" 34#include "compat.h"
35#include "log.h" 35#include "log.h"
36#include "key.h" 36#include "key.h"
37#include "ssh-dss.h"
37 38
38#define INTBLOB_LEN 20 39#define INTBLOB_LEN 20
39#define SIGBLOB_LEN (2*INTBLOB_LEN) 40#define SIGBLOB_LEN (2*INTBLOB_LEN)
diff --git a/ssh-rsa.c b/ssh-rsa.c
index 2dc341066..9de0e7b08 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: ssh-rsa.c,v 1.5 2001/01/21 19:05:58 markus Exp $"); 26RCSID("$OpenBSD: ssh-rsa.c,v 1.6 2001/02/08 19:30:52 itojun Exp $");
27 27
28#include <openssl/evp.h> 28#include <openssl/evp.h>
29#include <openssl/err.h> 29#include <openssl/err.h>
@@ -33,6 +33,7 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.5 2001/01/21 19:05:58 markus Exp $");
33#include "buffer.h" 33#include "buffer.h"
34#include "bufaux.h" 34#include "bufaux.h"
35#include "key.h" 35#include "key.h"
36#include "ssh-rsa.h"
36 37
37/* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */ 38/* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */
38int 39int
diff --git a/ssh.c b/ssh.c
index 730ff382c..1d7582333 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: ssh.c,v 1.88 2001/02/04 15:32:26 stevesk Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.93 2001/02/08 19:30:52 itojun Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/err.h> 45#include <openssl/err.h>
@@ -145,12 +145,12 @@ int subsystem_flag = 0;
145/* Prints a help message to the user. This function never returns. */ 145/* Prints a help message to the user. This function never returns. */
146 146
147void 147void
148usage() 148usage(void)
149{ 149{
150 fprintf(stderr, "Usage: %s [options] host [command]\n", __progname); 150 fprintf(stderr, "Usage: %s [options] host [command]\n", __progname);
151 fprintf(stderr, "Options:\n"); 151 fprintf(stderr, "Options:\n");
152 fprintf(stderr, " -l user Log in using this user name.\n"); 152 fprintf(stderr, " -l user Log in using this user name.\n");
153 fprintf(stderr, " -n Redirect input from /dev/null.\n"); 153 fprintf(stderr, " -n Redirect input from " _PATH_DEVNULL ".\n");
154 fprintf(stderr, " -A Enable authentication agent forwarding.\n"); 154 fprintf(stderr, " -A Enable authentication agent forwarding.\n");
155 fprintf(stderr, " -a Disable authentication agent forwarding.\n"); 155 fprintf(stderr, " -a Disable authentication agent forwarding.\n");
156#ifdef AFS 156#ifdef AFS
@@ -724,7 +724,7 @@ x11_get_proto(char *proto, int proto_len, char *data, int data_len)
724 724
725 if (options.xauth_location) { 725 if (options.xauth_location) {
726 /* Try to get Xauthority information for the display. */ 726 /* Try to get Xauthority information for the display. */
727 snprintf(line, sizeof line, "%.100s list %.200s 2>/dev/null", 727 snprintf(line, sizeof line, "%.100s list %.200s 2>" _PATH_DEVNULL,
728 options.xauth_location, getenv("DISPLAY")); 728 options.xauth_location, getenv("DISPLAY"));
729 f = popen(line, "r"); 729 f = popen(line, "r");
730 if (f && fgets(line, sizeof(line), f) && 730 if (f && fgets(line, sizeof(line), f) &&
@@ -1019,7 +1019,7 @@ ssh_session2(void)
1019 int in, out, err; 1019 int in, out, err;
1020 1020
1021 if (stdin_null_flag) { 1021 if (stdin_null_flag) {
1022 in = open("/dev/null", O_RDONLY); 1022 in = open(_PATH_DEVNULL, O_RDONLY);
1023 } else { 1023 } else {
1024 in = dup(STDIN_FILENO); 1024 in = dup(STDIN_FILENO);
1025 } 1025 }
diff --git a/sshconnect.c b/sshconnect.c
index d9683b3f5..10f52a073 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.93 2001/02/04 15:32:26 stevesk Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.95 2001/02/08 19:30:52 itojun Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -322,7 +322,7 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
322 * identification string. 322 * identification string.
323 */ 323 */
324void 324void
325ssh_exchange_identification() 325ssh_exchange_identification(void)
326{ 326{
327 char buf[256], remote_version[256]; /* must be same size! */ 327 char buf[256], remote_version[256]; /* must be same size! */
328 int remote_major, remote_minor, i, mismatch; 328 int remote_major, remote_minor, i, mismatch;
@@ -431,7 +431,7 @@ read_yes_or_no(const char *prompt, int defval)
431 if (isatty(STDIN_FILENO)) 431 if (isatty(STDIN_FILENO))
432 f = stdin; 432 f = stdin;
433 else 433 else
434 f = fopen("/dev/tty", "rw"); 434 f = fopen(_PATH_TTY, "rw");
435 435
436 if (f == NULL) 436 if (f == NULL)
437 return 0; 437 return 0;
diff --git a/sshconnect1.c b/sshconnect1.c
index 80b769b47..c33ac5035 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.22 2001/02/03 10:08:37 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.24 2001/02/08 19:30:52 itojun Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/evp.h> 19#include <openssl/evp.h>
@@ -56,7 +56,7 @@ extern char *__progname;
56 * authenticate using the agent. 56 * authenticate using the agent.
57 */ 57 */
58int 58int
59try_agent_authentication() 59try_agent_authentication(void)
60{ 60{
61 int type; 61 int type;
62 char *comment; 62 char *comment;
@@ -380,7 +380,7 @@ try_rhosts_rsa_authentication(const char *local_user, RSA * host_key)
380 380
381#ifdef KRB4 381#ifdef KRB4
382int 382int
383try_kerberos_authentication() 383try_kerberos_authentication(void)
384{ 384{
385 KTEXT_ST auth; /* Kerberos data */ 385 KTEXT_ST auth; /* Kerberos data */
386 char *reply; 386 char *reply;
@@ -497,7 +497,7 @@ try_kerberos_authentication()
497 497
498#ifdef AFS 498#ifdef AFS
499int 499int
500send_kerberos_tgt() 500send_kerberos_tgt(void)
501{ 501{
502 CREDENTIALS *creds; 502 CREDENTIALS *creds;
503 char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ]; 503 char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ];
@@ -616,7 +616,7 @@ send_afs_tokens(void)
616 * Note that the client code is not tied to s/key or TIS. 616 * Note that the client code is not tied to s/key or TIS.
617 */ 617 */
618int 618int
619try_challenge_reponse_authentication() 619try_challenge_reponse_authentication(void)
620{ 620{
621 int type, i; 621 int type, i;
622 int payload_len; 622 int payload_len;
diff --git a/sshd.c b/sshd.c
index e32911299..22eabcda8 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.163 2001/02/04 23:56:23 deraadt Exp $"); 43RCSID("$OpenBSD: sshd.c,v 1.165 2001/02/08 19:30:53 itojun Exp $");
44 44
45#include <openssl/dh.h> 45#include <openssl/dh.h>
46#include <openssl/bn.h> 46#include <openssl/bn.h>
@@ -211,7 +211,7 @@ sighup_handler(int sig)
211 * Restarts the server. 211 * Restarts the server.
212 */ 212 */
213void 213void
214sighup_restart() 214sighup_restart(void)
215{ 215{
216 log("Received SIGHUP; restarting."); 216 log("Received SIGHUP; restarting.");
217 close_listen_socks(); 217 close_listen_socks();
@@ -774,7 +774,7 @@ main(int ac, char **av)
774 774
775 /* Disconnect from the controlling tty. */ 775 /* Disconnect from the controlling tty. */
776#ifdef TIOCNOTTY 776#ifdef TIOCNOTTY
777 fd = open("/dev/tty", O_RDWR | O_NOCTTY); 777 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
778 if (fd >= 0) { 778 if (fd >= 0) {
779 (void) ioctl(fd, TIOCNOTTY, NULL); 779 (void) ioctl(fd, TIOCNOTTY, NULL);
780 close(fd); 780 close(fd);
@@ -1347,8 +1347,8 @@ do_ssh1_kex(void)
1347 len = BN_num_bytes(session_key_int); 1347 len = BN_num_bytes(session_key_int);
1348 if (len < 0 || len > sizeof(session_key)) { 1348 if (len < 0 || len > sizeof(session_key)) {
1349 error("do_connection: bad session key len from %s: " 1349 error("do_connection: bad session key len from %s: "
1350 "session_key_int %d > sizeof(session_key) %d", 1350 "session_key_int %d > sizeof(session_key) %lu",
1351 get_remote_ipaddr(), len, (int)sizeof(session_key)); 1351 get_remote_ipaddr(), len, (u_long)sizeof(session_key));
1352 rsafail++; 1352 rsafail++;
1353 } else { 1353 } else {
1354 memset(session_key, 0, sizeof(session_key)); 1354 memset(session_key, 0, sizeof(session_key));
diff --git a/tildexpand.c b/tildexpand.c
index b72744683..46bdaae87 100644
--- a/tildexpand.c
+++ b/tildexpand.c
@@ -11,10 +11,11 @@
11 */ 11 */
12 12
13#include "includes.h" 13#include "includes.h"
14RCSID("$OpenBSD: tildexpand.c,v 1.10 2001/01/21 19:06:01 markus Exp $"); 14RCSID("$OpenBSD: tildexpand.c,v 1.11 2001/02/08 19:30:53 itojun Exp $");
15 15
16#include "xmalloc.h" 16#include "xmalloc.h"
17#include "log.h" 17#include "log.h"
18#include "tildexpand.h"
18 19
19/* 20/*
20 * Expands tildes in the file name. Returns data allocated by xmalloc. 21 * Expands tildes in the file name. Returns data allocated by xmalloc.
diff --git a/uuencode.c b/uuencode.c
index 01b845764..d5f2b96b3 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: uuencode.c,v 1.8 2000/12/19 23:17:59 markus Exp $ */ 1/* $OpenBSD: uuencode.c,v 1.10 2001/02/08 19:30:53 itojun Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -27,7 +27,7 @@
27#include "includes.h" 27#include "includes.h"
28#include "xmalloc.h" 28#include "xmalloc.h"
29 29
30RCSID("$OpenBSD: uuencode.c,v 1.8 2000/12/19 23:17:59 markus Exp $"); 30RCSID("$OpenBSD: uuencode.c,v 1.10 2001/02/08 19:30:53 itojun Exp $");
31 31
32int 32int
33uuencode(u_char *src, u_int srclength, 33uuencode(u_char *src, u_int srclength,