]> andersk Git - openssh.git/blobdiff - sshd.c
- markus@cvs.openbsd.org 2001/03/23 14:28:32
[openssh.git] / sshd.c
diff --git a/sshd.c b/sshd.c
index 0a1048cd371e7db31daed544841701316c4e2575..0ac78cbafa8e34975ce7b964004b20231307308e 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.174 2001/03/09 12:30:29 deraadt Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.178 2001/03/23 14:28:32 markus Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -344,8 +344,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
                                fatal_cleanup();
                        }
                        if (buf[i] == '\r') {
-                               buf[i] = '\n';
-                               buf[i + 1] = 0;
+                               buf[i] = 0;
                                /* Kludge for F-Secure Macintosh < 1.0.2 */
                                if (i == 12 &&
                                    strncmp(buf, "SSH-1.5-W1.0", 12) == 0)
@@ -353,8 +352,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
                                continue;
                        }
                        if (buf[i] == '\n') {
-                               /* buf[i] == '\n' */
-                               buf[i + 1] = 0;
+                               buf[i] = 0;
                                break;
                        }
                }
@@ -381,6 +379,12 @@ sshd_exchange_identification(int sock_in, int sock_out)
 
        compat_datafellows(remote_version);
 
+       if (datafellows & SSH_BUG_SCANNER) {
+               log("scanned from %s with %s.  Don't panic.",
+                   get_remote_ipaddr(), client_version_string);
+               fatal_cleanup();
+       }
+
        mismatch = 0;
        switch(remote_major) {
        case 1:
@@ -414,7 +418,6 @@ sshd_exchange_identification(int sock_in, int sock_out)
                break;
        }
        chop(server_version_string);
-       chop(client_version_string);
        debug("Local version string %.200s", server_version_string);
 
        if (mismatch) {
@@ -806,6 +809,9 @@ main(int ac, char **av)
        /* Chdir to the root directory so that the current disk can be
           unmounted if desired. */
        chdir("/");
+       
+       /* ignore SIGPIPE */
+       signal(SIGPIPE, SIG_IGN);
 
        /* Start listening for a socket, unless started from inetd. */
        if (inetd_flag) {
@@ -1447,6 +1453,9 @@ do_ssh2_kex(void)
        }
        myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types();
 
+       myproposal[PROPOSAL_ENC_ALGS_STOC] =
+           compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_STOC]);
+
        server_kexinit = kex_init(myproposal);
        client_kexinit = xmalloc(sizeof(*client_kexinit));
        buffer_init(client_kexinit);
This page took 0.043254 seconds and 4 git commands to generate.