diff options
author | naddy@openbsd.org <naddy@openbsd.org> | 2016-08-15 12:27:56 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-08-23 13:28:30 +1000 |
commit | c38ea634893a1975dbbec798fb968c9488013f4a (patch) | |
tree | 29d9dcc51011ed7677e85b6ce2cabb25faedf74e /sshd.c | |
parent | 33ba55d9e358c07f069e579bfab80eccaaad52cb (diff) |
upstream commit
Remove more SSH1 server code: * Drop sshd's -k option. *
Retire configuration keywords that only apply to protocol 1, as well as the
"protocol" keyword. * Remove some related vestiges of protocol 1 support.
ok markus@
Upstream-ID: 9402f82886de917779db12f8ee3f03d4decc244d
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 33 |
1 files changed, 6 insertions, 27 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.472 2016/08/13 17:47:41 markus Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.473 2016/08/15 12:27:56 naddy Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -365,26 +365,12 @@ sshd_exchange_identification(struct ssh *ssh, int sock_in, int sock_out) | |||
365 | { | 365 | { |
366 | u_int i; | 366 | u_int i; |
367 | int remote_major, remote_minor; | 367 | int remote_major, remote_minor; |
368 | int major, minor; | ||
369 | char *s, *newline = "\n"; | 368 | char *s, *newline = "\n"; |
370 | char buf[256]; /* Must not be larger than remote_version. */ | 369 | char buf[256]; /* Must not be larger than remote_version. */ |
371 | char remote_version[256]; /* Must be at least as big as buf. */ | 370 | char remote_version[256]; /* Must be at least as big as buf. */ |
372 | 371 | ||
373 | if ((options.protocol & SSH_PROTO_1) && | ||
374 | (options.protocol & SSH_PROTO_2)) { | ||
375 | major = PROTOCOL_MAJOR_1; | ||
376 | minor = 99; | ||
377 | } else if (options.protocol & SSH_PROTO_2) { | ||
378 | major = PROTOCOL_MAJOR_2; | ||
379 | minor = PROTOCOL_MINOR_2; | ||
380 | newline = "\r\n"; | ||
381 | } else { | ||
382 | major = PROTOCOL_MAJOR_1; | ||
383 | minor = PROTOCOL_MINOR_1; | ||
384 | } | ||
385 | |||
386 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", | 372 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", |
387 | major, minor, SSH_VERSION, | 373 | PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, |
388 | *options.version_addendum == '\0' ? "" : " ", | 374 | *options.version_addendum == '\0' ? "" : " ", |
389 | options.version_addendum, newline); | 375 | options.version_addendum, newline); |
390 | 376 | ||
@@ -925,10 +911,9 @@ usage(void) | |||
925 | #endif | 911 | #endif |
926 | ); | 912 | ); |
927 | fprintf(stderr, | 913 | fprintf(stderr, |
928 | "usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file]\n" | 914 | "usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]\n" |
929 | " [-E log_file] [-f config_file] [-g login_grace_time]\n" | 915 | " [-E log_file] [-f config_file] [-g login_grace_time]\n" |
930 | " [-h host_key_file] [-k key_gen_time] [-o option] [-p port]\n" | 916 | " [-h host_key_file] [-o option] [-p port] [-u len]\n" |
931 | " [-u len]\n" | ||
932 | ); | 917 | ); |
933 | exit(1); | 918 | exit(1); |
934 | } | 919 | } |
@@ -1461,7 +1446,7 @@ main(int ac, char **av) | |||
1461 | options.log_level = SYSLOG_LEVEL_QUIET; | 1446 | options.log_level = SYSLOG_LEVEL_QUIET; |
1462 | break; | 1447 | break; |
1463 | case 'b': | 1448 | case 'b': |
1464 | /* ignored */ | 1449 | /* protocol 1, ignored */ |
1465 | break; | 1450 | break; |
1466 | case 'p': | 1451 | case 'p': |
1467 | options.ports_from_cmdline = 1; | 1452 | options.ports_from_cmdline = 1; |
@@ -1482,10 +1467,7 @@ main(int ac, char **av) | |||
1482 | } | 1467 | } |
1483 | break; | 1468 | break; |
1484 | case 'k': | 1469 | case 'k': |
1485 | if ((options.key_regeneration_time = convtime(optarg)) == -1) { | 1470 | /* protocol 1, ignored */ |
1486 | fprintf(stderr, "Invalid key regeneration interval.\n"); | ||
1487 | exit(1); | ||
1488 | } | ||
1489 | break; | 1471 | break; |
1490 | case 'h': | 1472 | case 'h': |
1491 | if (options.num_host_key_files >= MAX_HOSTKEYS) { | 1473 | if (options.num_host_key_files >= MAX_HOSTKEYS) { |
@@ -1619,9 +1601,6 @@ main(int ac, char **av) | |||
1619 | * and warns for trivial misconfigurations that could break login. | 1601 | * and warns for trivial misconfigurations that could break login. |
1620 | */ | 1602 | */ |
1621 | if (options.num_auth_methods != 0) { | 1603 | if (options.num_auth_methods != 0) { |
1622 | if ((options.protocol & SSH_PROTO_1)) | ||
1623 | fatal("AuthenticationMethods is not supported with " | ||
1624 | "SSH protocol 1"); | ||
1625 | for (n = 0; n < options.num_auth_methods; n++) { | 1604 | for (n = 0; n < options.num_auth_methods; n++) { |
1626 | if (auth2_methods_valid(options.auth_methods[n], | 1605 | if (auth2_methods_valid(options.auth_methods[n], |
1627 | 1) == 0) | 1606 | 1) == 0) |