summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--auth2.c6
-rw-r--r--packet.c15
-rw-r--r--scp.c34
-rw-r--r--ssh-keygen.c4
-rw-r--r--sshd.818
6 files changed, 47 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index eeceec348..f015f5620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
2 - OpenBSD CVS update 2 - OpenBSD CVS update
3 [packet.c] 3 [packet.c]
4 - send debug messages in SSH2 format 4 - send debug messages in SSH2 format
5 [scp.c]
6 - fix very rare EAGAIN/EINTR issues; based on work by djm
7 [packet.c]
8 - less debug, rm unused
9 [auth2.c]
10 - disable kerb,s/key in ssh2
11 [sshd.8]
12 - Minor tweaks and typo fixes.
13 [ssh-keygen.c]
14 - Put -d into usage and reorder. markus ok.
5 - Include missing headers for OpenSSL tests. Fix from Phil Karn 15 - Include missing headers for OpenSSL tests. Fix from Phil Karn
6 <karn@ka9q.ampr.org> 16 <karn@ka9q.ampr.org>
7 - Fixed __progname symbol collisions reported by Andre Lucas 17 - Fixed __progname symbol collisions reported by Andre Lucas
diff --git a/auth2.c b/auth2.c
index 9937ed678..cfe63cdf1 100644
--- a/auth2.c
+++ b/auth2.c
@@ -27,7 +27,7 @@
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29#include "includes.h" 29#include "includes.h"
30RCSID("$OpenBSD: auth2.c,v 1.3 2000/04/27 15:23:02 markus Exp $"); 30RCSID("$OpenBSD: auth2.c,v 1.4 2000/05/01 07:45:08 markus Exp $");
31 31
32#include <openssl/dsa.h> 32#include <openssl/dsa.h>
33#include <openssl/rsa.h> 33#include <openssl/rsa.h>
@@ -92,6 +92,10 @@ static int userauth_success = 0;
92void 92void
93do_authentication2() 93do_authentication2()
94{ 94{
95 /* turn off skey/kerberos, not supported by SSH2 */
96 options.skey_authentication = 0;
97 options.kerberos_authentication = 0;
98
95 dispatch_init(&protocol_error); 99 dispatch_init(&protocol_error);
96 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); 100 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
97 dispatch_run(DISPATCH_BLOCK, &userauth_success); 101 dispatch_run(DISPATCH_BLOCK, &userauth_success);
diff --git a/packet.c b/packet.c
index 73a96b986..e70d06091 100644
--- a/packet.c
+++ b/packet.c
@@ -17,7 +17,7 @@
17 */ 17 */
18 18
19#include "includes.h" 19#include "includes.h"
20RCSID("$Id: packet.c,v 1.20 2000/04/30 22:24:07 damien Exp $"); 20RCSID("$Id: packet.c,v 1.21 2000/05/01 11:10:33 damien Exp $");
21 21
22#include "xmalloc.h" 22#include "xmalloc.h"
23#include "buffer.h" 23#include "buffer.h"
@@ -130,7 +130,7 @@ clear_enc_keys(Enc *enc, int len)
130void 130void
131packet_set_ssh2_format(void) 131packet_set_ssh2_format(void)
132{ 132{
133 debug("use_ssh2_packet_format"); 133 DBG(debug("use_ssh2_packet_format"));
134 use_ssh2_packet_format = 1; 134 use_ssh2_packet_format = 1;
135} 135}
136 136
@@ -613,7 +613,7 @@ packet_send2()
613 fatal("packet_send2: no KEX"); 613 fatal("packet_send2: no KEX");
614 if (mac->md != NULL) 614 if (mac->md != NULL)
615 mac->enabled = 1; 615 mac->enabled = 1;
616 debug("cipher_set_key_iv send_context"); 616 DBG(debug("cipher_set_key_iv send_context"));
617 cipher_set_key_iv(&send_context, enc->type, 617 cipher_set_key_iv(&send_context, enc->type,
618 enc->key, enc->key_len, 618 enc->key, enc->key_len,
619 enc->iv, enc->iv_len); 619 enc->iv, enc->iv_len);
@@ -636,13 +636,6 @@ packet_send()
636 DBG(debug("packet_send done")); 636 DBG(debug("packet_send done"));
637} 637}
638 638
639void
640packet_send_and_wait()
641{
642 packet_send();
643 packet_write_wait();
644}
645
646/* 639/*
647 * Waits until a packet has been received, and returns its type. Note that 640 * Waits until a packet has been received, and returns its type. Note that
648 * no other data is processed until this returns, so this function should not 641 * no other data is processed until this returns, so this function should not
@@ -921,7 +914,7 @@ packet_read_poll2(int *payload_len_ptr)
921 fatal("packet_read_poll2: no KEX"); 914 fatal("packet_read_poll2: no KEX");
922 if (mac->md != NULL) 915 if (mac->md != NULL)
923 mac->enabled = 1; 916 mac->enabled = 1;
924 debug("cipher_set_key_iv receive_context"); 917 DBG(debug("cipher_set_key_iv receive_context"));
925 cipher_set_key_iv(&receive_context, enc->type, 918 cipher_set_key_iv(&receive_context, enc->type,
926 enc->key, enc->key_len, 919 enc->key, enc->key_len,
927 enc->iv, enc->iv_len); 920 enc->iv, enc->iv_len);
diff --git a/scp.c b/scp.c
index 64869f976..2ac106290 100644
--- a/scp.c
+++ b/scp.c
@@ -45,7 +45,7 @@
45 */ 45 */
46 46
47#include "includes.h" 47#include "includes.h"
48RCSID("$Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $"); 48RCSID("$Id: scp.c,v 1.21 2000/05/01 11:10:33 damien Exp $");
49 49
50#include "ssh.h" 50#include "ssh.h"
51#include "xmalloc.h" 51#include "xmalloc.h"
@@ -543,7 +543,7 @@ syserr: run_err("%s: %s", name, strerror(errno));
543 (void) sprintf(buf, "T%lu 0 %lu 0\n", 543 (void) sprintf(buf, "T%lu 0 %lu 0\n",
544 (unsigned long) stb.st_mtime, 544 (unsigned long) stb.st_mtime,
545 (unsigned long) stb.st_atime); 545 (unsigned long) stb.st_atime);
546 (void) write(remout, buf, strlen(buf)); 546 (void) atomicio(write, remout, buf, strlen(buf));
547 if (response() < 0) 547 if (response() < 0)
548 goto next; 548 goto next;
549 } 549 }
@@ -556,7 +556,7 @@ syserr: run_err("%s: %s", name, strerror(errno));
556 fprintf(stderr, "Sending file modes: %s", buf); 556 fprintf(stderr, "Sending file modes: %s", buf);
557 fflush(stderr); 557 fflush(stderr);
558 } 558 }
559 (void) write(remout, buf, strlen(buf)); 559 (void) atomicio(write, remout, buf, strlen(buf));
560 if (response() < 0) 560 if (response() < 0)
561 goto next; 561 goto next;
562 if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) { 562 if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) {
@@ -578,7 +578,7 @@ next: (void) close(fd);
578 haderr = result >= 0 ? EIO : errno; 578 haderr = result >= 0 ? EIO : errno;
579 } 579 }
580 if (haderr) 580 if (haderr)
581 (void) write(remout, bp->buf, amt); 581 (void) atomicio(write, remout, bp->buf, amt);
582 else { 582 else {
583 result = atomicio(write, remout, bp->buf, amt); 583 result = atomicio(write, remout, bp->buf, amt);
584 if (result != amt) 584 if (result != amt)
@@ -592,7 +592,7 @@ next: (void) close(fd);
592 if (close(fd) < 0 && !haderr) 592 if (close(fd) < 0 && !haderr)
593 haderr = errno; 593 haderr = errno;
594 if (!haderr) 594 if (!haderr)
595 (void) write(remout, "", 1); 595 (void) atomicio(write, remout, "", 1);
596 else 596 else
597 run_err("%s: %s", name, strerror(haderr)); 597 run_err("%s: %s", name, strerror(haderr));
598 (void) response(); 598 (void) response();
@@ -621,7 +621,7 @@ rsource(name, statp)
621 (void) sprintf(path, "T%lu 0 %lu 0\n", 621 (void) sprintf(path, "T%lu 0 %lu 0\n",
622 (unsigned long) statp->st_mtime, 622 (unsigned long) statp->st_mtime,
623 (unsigned long) statp->st_atime); 623 (unsigned long) statp->st_atime);
624 (void) write(remout, path, strlen(path)); 624 (void) atomicio(write, remout, path, strlen(path));
625 if (response() < 0) { 625 if (response() < 0) {
626 closedir(dirp); 626 closedir(dirp);
627 return; 627 return;
@@ -632,7 +632,7 @@ rsource(name, statp)
632 0, last); 632 0, last);
633 if (verbose_mode) 633 if (verbose_mode)
634 fprintf(stderr, "Entering directory: %s", path); 634 fprintf(stderr, "Entering directory: %s", path);
635 (void) write(remout, path, strlen(path)); 635 (void) atomicio(write, remout, path, strlen(path));
636 if (response() < 0) { 636 if (response() < 0) {
637 closedir(dirp); 637 closedir(dirp);
638 return; 638 return;
@@ -651,7 +651,7 @@ rsource(name, statp)
651 source(1, vect); 651 source(1, vect);
652 } 652 }
653 (void) closedir(dirp); 653 (void) closedir(dirp);
654 (void) write(remout, "E\n", 2); 654 (void) atomicio(write, remout, "E\n", 2);
655 (void) response(); 655 (void) response();
656} 656}
657 657
@@ -687,7 +687,7 @@ sink(argc, argv)
687 if (targetshouldbedirectory) 687 if (targetshouldbedirectory)
688 verifydir(targ); 688 verifydir(targ);
689 689
690 (void) write(remout, "", 1); 690 (void) atomicio(write, remout, "", 1);
691 if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) 691 if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
692 targisdir = 1; 692 targisdir = 1;
693 for (first = 1;; first = 0) { 693 for (first = 1;; first = 0) {
@@ -705,7 +705,7 @@ sink(argc, argv)
705 705
706 if (buf[0] == '\01' || buf[0] == '\02') { 706 if (buf[0] == '\01' || buf[0] == '\02') {
707 if (iamremote == 0) 707 if (iamremote == 0)
708 (void) write(STDERR_FILENO, 708 (void) atomicio(write, STDERR_FILENO,
709 buf + 1, strlen(buf + 1)); 709 buf + 1, strlen(buf + 1));
710 if (buf[0] == '\02') 710 if (buf[0] == '\02')
711 exit(1); 711 exit(1);
@@ -713,7 +713,7 @@ sink(argc, argv)
713 continue; 713 continue;
714 } 714 }
715 if (buf[0] == 'E') { 715 if (buf[0] == 'E') {
716 (void) write(remout, "", 1); 716 (void) atomicio(write, remout, "", 1);
717 return; 717 return;
718 } 718 }
719 if (ch == '\n') 719 if (ch == '\n')
@@ -737,7 +737,7 @@ sink(argc, argv)
737 getnum(dummy_usec); 737 getnum(dummy_usec);
738 if (*cp++ != '\0') 738 if (*cp++ != '\0')
739 SCREWUP("atime.usec not delimited"); 739 SCREWUP("atime.usec not delimited");
740 (void) write(remout, "", 1); 740 (void) atomicio(write, remout, "", 1);
741 continue; 741 continue;
742 } 742 }
743 if (*cp != 'C' && *cp != 'D') { 743 if (*cp != 'C' && *cp != 'D') {
@@ -816,7 +816,7 @@ sink(argc, argv)
816bad: run_err("%s: %s", np, strerror(errno)); 816bad: run_err("%s: %s", np, strerror(errno));
817 continue; 817 continue;
818 } 818 }
819 (void) write(remout, "", 1); 819 (void) atomicio(write, remout, "", 1);
820 if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) { 820 if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) {
821 (void) close(ofd); 821 (void) close(ofd);
822 continue; 822 continue;
@@ -897,7 +897,7 @@ bad: run_err("%s: %s", np, strerror(errno));
897 run_err("%s: %s", np, strerror(wrerrno)); 897 run_err("%s: %s", np, strerror(wrerrno));
898 break; 898 break;
899 case NO: 899 case NO:
900 (void) write(remout, "", 1); 900 (void) atomicio(write, remout, "", 1);
901 break; 901 break;
902 case DISPLAYED: 902 case DISPLAYED:
903 break; 903 break;
@@ -932,7 +932,7 @@ response()
932 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n'); 932 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
933 933
934 if (!iamremote) 934 if (!iamremote)
935 (void) write(STDERR_FILENO, rbuf, cp - rbuf); 935 (void) atomicio(write, STDERR_FILENO, rbuf, cp - rbuf);
936 ++errs; 936 ++errs;
937 if (resp == 1) 937 if (resp == 1)
938 return (-1); 938 return (-1);
@@ -1008,7 +1008,7 @@ run_err(const char *fmt,...)
1008 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1008 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1009 * SUCH DAMAGE. 1009 * SUCH DAMAGE.
1010 * 1010 *
1011 * $Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $ 1011 * $Id: scp.c,v 1.21 2000/05/01 11:10:33 damien Exp $
1012 */ 1012 */
1013 1013
1014char * 1014char *
@@ -1240,7 +1240,7 @@ progressmeter(int flag)
1240 alarmtimer(1); 1240 alarmtimer(1);
1241 } else if (flag == 1) { 1241 } else if (flag == 1) {
1242 alarmtimer(0); 1242 alarmtimer(0);
1243 write(fileno(stdout), "\n", 1); 1243 atomicio(write, fileno(stdout), "\n", 1);
1244 statbytes = 0; 1244 statbytes = 0;
1245 } 1245 }
1246} 1246}
diff --git a/ssh-keygen.c b/ssh-keygen.c
index d86396896..2154e1ebf 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$Id: ssh-keygen.c,v 1.15 2000/05/01 10:59:51 damien Exp $"); 10RCSID("$Id: ssh-keygen.c,v 1.16 2000/05/01 11:10:34 damien Exp $");
11 11
12#include <openssl/evp.h> 12#include <openssl/evp.h>
13#include <openssl/pem.h> 13#include <openssl/pem.h>
@@ -492,7 +492,7 @@ void
492usage(void) 492usage(void)
493{ 493{
494 printf("ssh-keygen version %s\n", SSH_VERSION); 494 printf("ssh-keygen version %s\n", SSH_VERSION);
495 printf("Usage: %s [-b bits] [-p] [-c] [-l] [-x] [-X] [-y] [-f file] [-P pass] [-N new-pass] [-C comment]\n", __progname); 495 printf("Usage: %s [-b bits] [-c] [-d] [-f file] [-l] [-p] [-q] [-x] [-y] [-C comment] [-N new-pass] [-P pass] [-X]\n", __progname);
496 exit(1); 496 exit(1);
497} 497}
498 498
diff --git a/sshd.8 b/sshd.8
index cd7f9002f..9d8764a9c 100644
--- a/sshd.8
+++ b/sshd.8
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sat Apr 22 21:55:14 1995 ylo 10.\" Created: Sat Apr 22 21:55:14 1995 ylo
11.\" 11.\"
12.\" $Id: sshd.8,v 1.18 2000/04/20 13:27:27 damien Exp $ 12.\" $Id: sshd.8,v 1.19 2000/05/01 11:10:34 damien Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SSHD 8 15.Dt SSHD 8
@@ -31,7 +31,7 @@
31.Nm 31.Nm
32(Secure Shell Daemon) is the daemon program for 32(Secure Shell Daemon) is the daemon program for
33.Xr ssh 1 . 33.Xr ssh 1 .
34Together these programs replace rlogin and rsh programs, and 34Together these programs replace rlogin and rsh, and
35provide secure encrypted communications between two untrusted hosts 35provide secure encrypted communications between two untrusted hosts
36over an insecure network. 36over an insecure network.
37The programs are intended to be as easy to 37The programs are intended to be as easy to
@@ -56,19 +56,19 @@ the daemon starts, it generates a server RSA key (normally 768 bits).
56This key is normally regenerated every hour if it has been used, and 56This key is normally regenerated every hour if it has been used, and
57is never stored on disk. 57is never stored on disk.
58.Pp 58.Pp
59Whenever a client connects the daemon, the daemon sends its host 59Whenever a client connects the daemon responds with its public
60and server public keys to the client. 60host and server keys.
61The client compares the 61The client compares the
62host key against its own database to verify that it has not changed. 62host key against its own database to verify that it has not changed.
63The client then generates a 256 bit random number. 63The client then generates a 256 bit random number.
64It encrypts this 64It encrypts this
65random number using both the host key and the server key, and sends 65random number using both the host key and the server key, and sends
66the encrypted number to the server. 66the encrypted number to the server.
67Both sides then start to use this 67Both sides then use this
68random number as a session key which is used to encrypt all further 68random number as a session key which is used to encrypt all further
69communications in the session. 69communications in the session.
70The rest of the session is encrypted 70The rest of the session is encrypted
71using a conventional cipher, currently Blowfish and 3DES, with 3DES 71using a conventional cipher, currently Blowfish or 3DES, with 3DES
72being used by default. 72being used by default.
73The client selects the encryption algorithm 73The client selects the encryption algorithm
74to use from those offered by the server. 74to use from those offered by the server.
@@ -95,7 +95,7 @@ are disabled (thus completely disabling
95.Xr rlogin 1 95.Xr rlogin 1
96and 96and
97.Xr rsh 1 97.Xr rsh 1
98into that machine). 98into the machine).
99.Pp 99.Pp
100If the client successfully authenticates itself, a dialog for 100If the client successfully authenticates itself, a dialog for
101preparing the session is entered. 101preparing the session is entered.
@@ -188,9 +188,9 @@ authentication, and termination of each connection is logged.
188Do not print an error message if RSA support is missing. 188Do not print an error message if RSA support is missing.
189.It Fl V Ar client_protocol_id 189.It Fl V Ar client_protocol_id
190SSH2 compatibility mode. 190SSH2 compatibility mode.
191When this options is specified 191When this option is specified
192.Nm 192.Nm
193assumes the client has sent the given version string 193assumes the client has sent the supplied version string
194and skips the 194and skips the
195Protocol Version Identification Exchange. 195Protocol Version Identification Exchange.
196.It Fl 4 196.It Fl 4