summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-07-19 19:52:28 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-07-19 19:52:28 +1000
commitfe0078ae492ab0c020fa6ee5bccd8d08ca5f47a6 (patch)
treeb85c9196444262fbd03415bf2e9996ae684c5635 /sshd.c
parent394b8c8db307fa4d4c39ecb4d276980ce9927146 (diff)
- markus@cvs.openbsd.org 2003/07/14 12:36:37
[sshd.c] remove undocumented -V option. would be only useful if openssh is used as ssh v1 server for ssh.com's ssh v2.
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c63
1 files changed, 28 insertions, 35 deletions
diff --git a/sshd.c b/sshd.c
index 14cd4a27f..e3748da7d 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.271 2003/06/28 16:23:06 deraadt Exp $"); 45RCSID("$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;