diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | sshd.c | 63 |
2 files changed, 34 insertions, 36 deletions
@@ -1,6 +1,11 @@ | |||
1 | 20030719 | 1 | 20030719 |
2 | - (dtucker) [configure.ac] Bug #620: Define BROKEN_GETADDRINFO for | 2 | - (dtucker) [configure.ac] Bug #620: Define BROKEN_GETADDRINFO for |
3 | Solaris/x86. Patch from jrhett at isite.net. | 3 | Solaris/x86. Patch from jrhett at isite.net. |
4 | - (dtucker) OpenBSD CVS Sync | ||
5 | - markus@cvs.openbsd.org 2003/07/14 12:36:37 | ||
6 | [sshd.c] | ||
7 | remove undocumented -V option. would be only useful if openssh is used | ||
8 | as ssh v1 server for ssh.com's ssh v2. | ||
4 | 9 | ||
5 | 20030714 | 10 | 20030714 |
6 | - (dtucker) [acconfig.h configure.ac port-aix.c] Older AIXes don't declare | 11 | - (dtucker) [acconfig.h configure.ac port-aix.c] Older AIXes don't declare |
@@ -697,4 +702,4 @@ | |||
697 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 702 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
698 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 703 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
699 | 704 | ||
700 | $Id: ChangeLog,v 1.2857 2003/07/19 09:49:45 dtucker Exp $ | 705 | $Id: ChangeLog,v 1.2858 2003/07/19 09:52:28 dtucker Exp $ |
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | 43 | ||
44 | #include "includes.h" | 44 | #include "includes.h" |
45 | RCSID("$OpenBSD: sshd.c,v 1.271 2003/06/28 16:23:06 deraadt Exp $"); | 45 | RCSID("$OpenBSD: sshd.c,v 1.272 2003/07/14 12:36:37 markus Exp $"); |
46 | 46 | ||
47 | #include <openssl/dh.h> | 47 | #include <openssl/dh.h> |
48 | #include <openssl/bn.h> | 48 | #include <openssl/bn.h> |
@@ -370,39 +370,37 @@ sshd_exchange_identification(int sock_in, int sock_out) | |||
370 | snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION); | 370 | snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION); |
371 | server_version_string = xstrdup(buf); | 371 | server_version_string = xstrdup(buf); |
372 | 372 | ||
373 | if (client_version_string == NULL) { | 373 | /* Send our protocol version identification. */ |
374 | /* Send our protocol version identification. */ | 374 | if (atomicio(vwrite, sock_out, server_version_string, |
375 | if (atomicio(vwrite, sock_out, server_version_string, | 375 | strlen(server_version_string)) |
376 | strlen(server_version_string)) | 376 | != strlen(server_version_string)) { |
377 | != strlen(server_version_string)) { | 377 | logit("Could not write ident string to %s", get_remote_ipaddr()); |
378 | logit("Could not write ident string to %s", get_remote_ipaddr()); | 378 | fatal_cleanup(); |
379 | } | ||
380 | |||
381 | /* Read other sides version identification. */ | ||
382 | memset(buf, 0, sizeof(buf)); | ||
383 | for (i = 0; i < sizeof(buf) - 1; i++) { | ||
384 | if (atomicio(read, sock_in, &buf[i], 1) != 1) { | ||
385 | logit("Did not receive identification string from %s", | ||
386 | get_remote_ipaddr()); | ||
379 | fatal_cleanup(); | 387 | fatal_cleanup(); |
380 | } | 388 | } |
381 | 389 | if (buf[i] == '\r') { | |
382 | /* Read other sides version identification. */ | 390 | buf[i] = 0; |
383 | memset(buf, 0, sizeof(buf)); | 391 | /* Kludge for F-Secure Macintosh < 1.0.2 */ |
384 | for (i = 0; i < sizeof(buf) - 1; i++) { | 392 | if (i == 12 && |
385 | if (atomicio(read, sock_in, &buf[i], 1) != 1) { | 393 | strncmp(buf, "SSH-1.5-W1.0", 12) == 0) |
386 | logit("Did not receive identification string from %s", | ||
387 | get_remote_ipaddr()); | ||
388 | fatal_cleanup(); | ||
389 | } | ||
390 | if (buf[i] == '\r') { | ||
391 | buf[i] = 0; | ||
392 | /* Kludge for F-Secure Macintosh < 1.0.2 */ | ||
393 | if (i == 12 && | ||
394 | strncmp(buf, "SSH-1.5-W1.0", 12) == 0) | ||
395 | break; | ||
396 | continue; | ||
397 | } | ||
398 | if (buf[i] == '\n') { | ||
399 | buf[i] = 0; | ||
400 | break; | 394 | break; |
401 | } | 395 | continue; |
396 | } | ||
397 | if (buf[i] == '\n') { | ||
398 | buf[i] = 0; | ||
399 | break; | ||
402 | } | 400 | } |
403 | buf[sizeof(buf) - 1] = 0; | ||
404 | client_version_string = xstrdup(buf); | ||
405 | } | 401 | } |
402 | buf[sizeof(buf) - 1] = 0; | ||
403 | client_version_string = xstrdup(buf); | ||
406 | 404 | ||
407 | /* | 405 | /* |
408 | * Check that the versions match. In future this might accept | 406 | * Check that the versions match. In future this might accept |
@@ -841,7 +839,7 @@ main(int ac, char **av) | |||
841 | initialize_server_options(&options); | 839 | initialize_server_options(&options); |
842 | 840 | ||
843 | /* Parse command-line arguments. */ | 841 | /* Parse command-line arguments. */ |
844 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:o:dDeiqtQ46")) != -1) { | 842 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:dDeiqtQ46")) != -1) { |
845 | switch (opt) { | 843 | switch (opt) { |
846 | case '4': | 844 | case '4': |
847 | IPv4or6 = AF_INET; | 845 | IPv4or6 = AF_INET; |
@@ -912,11 +910,6 @@ main(int ac, char **av) | |||
912 | } | 910 | } |
913 | options.host_key_files[options.num_host_key_files++] = optarg; | 911 | options.host_key_files[options.num_host_key_files++] = optarg; |
914 | break; | 912 | break; |
915 | case 'V': | ||
916 | client_version_string = optarg; | ||
917 | /* only makes sense with inetd_flag, i.e. no listen() */ | ||
918 | inetd_flag = 1; | ||
919 | break; | ||
920 | case 't': | 913 | case 't': |
921 | test_flag = 1; | 914 | test_flag = 1; |
922 | break; | 915 | break; |