|
Lines 127-132
initialize_server_options(ServerOptions
Link Here
|
| 127 |
options->ciphers = NULL; |
127 |
options->ciphers = NULL; |
| 128 |
options->macs = NULL; |
128 |
options->macs = NULL; |
| 129 |
options->kex_algorithms = NULL; |
129 |
options->kex_algorithms = NULL; |
|
|
130 |
#ifdef SCTP |
| 131 |
options->transport = -1; |
| 132 |
#endif |
| 130 |
options->protocol = SSH_PROTO_UNKNOWN; |
133 |
options->protocol = SSH_PROTO_UNKNOWN; |
| 131 |
options->gateway_ports = -1; |
134 |
options->gateway_ports = -1; |
| 132 |
options->num_subsystems = 0; |
135 |
options->num_subsystems = 0; |
|
Lines 268-273
fill_default_server_options(ServerOption
Link Here
|
| 268 |
options->allow_tcp_forwarding = FORWARD_ALLOW; |
271 |
options->allow_tcp_forwarding = FORWARD_ALLOW; |
| 269 |
if (options->allow_agent_forwarding == -1) |
272 |
if (options->allow_agent_forwarding == -1) |
| 270 |
options->allow_agent_forwarding = 1; |
273 |
options->allow_agent_forwarding = 1; |
|
|
274 |
#ifdef SCTP |
| 275 |
if (options->transport == -1) |
| 276 |
options->transport = TRANSPORT_TCP; |
| 277 |
#endif |
| 271 |
if (options->gateway_ports == -1) |
278 |
if (options->gateway_ports == -1) |
| 272 |
options->gateway_ports = 0; |
279 |
options->gateway_ports = 0; |
| 273 |
if (options->max_startups == -1) |
280 |
if (options->max_startups == -1) |
|
Lines 329-334
typedef enum {
Link Here
|
| 329 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
336 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
| 330 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
337 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
| 331 |
sListenAddress, sAddressFamily, |
338 |
sListenAddress, sAddressFamily, |
|
|
339 |
#ifdef SCTP |
| 340 |
sTransport, sListenMultipleAddresses, |
| 341 |
#endif |
| 332 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
342 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
| 333 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
343 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
| 334 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
344 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
|
Lines 417-422
static struct {
Link Here
|
| 417 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
427 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
| 418 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
428 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
| 419 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
429 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
|
|
430 |
#ifdef SCTP |
| 431 |
{ "listenmultipleaddresses", sListenMultipleAddresses, SSHCFG_GLOBAL }, |
| 432 |
#endif |
| 420 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
433 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
| 421 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
434 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
| 422 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
435 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
|
Lines 442-447
static struct {
Link Here
|
| 442 |
{ "denygroups", sDenyGroups, SSHCFG_ALL }, |
455 |
{ "denygroups", sDenyGroups, SSHCFG_ALL }, |
| 443 |
{ "ciphers", sCiphers, SSHCFG_GLOBAL }, |
456 |
{ "ciphers", sCiphers, SSHCFG_GLOBAL }, |
| 444 |
{ "macs", sMacs, SSHCFG_GLOBAL }, |
457 |
{ "macs", sMacs, SSHCFG_GLOBAL }, |
|
|
458 |
#ifdef SCTP |
| 459 |
{ "transport", sTransport, SSHCFG_GLOBAL }, |
| 460 |
#endif |
| 445 |
{ "protocol", sProtocol, SSHCFG_GLOBAL }, |
461 |
{ "protocol", sProtocol, SSHCFG_GLOBAL }, |
| 446 |
{ "gatewayports", sGatewayPorts, SSHCFG_ALL }, |
462 |
{ "gatewayports", sGatewayPorts, SSHCFG_ALL }, |
| 447 |
{ "subsystem", sSubsystem, SSHCFG_GLOBAL }, |
463 |
{ "subsystem", sSubsystem, SSHCFG_GLOBAL }, |
|
Lines 576-581
get_connection_info(int populate, int us
Link Here
|
| 576 |
return &ci; |
592 |
return &ci; |
| 577 |
} |
593 |
} |
| 578 |
|
594 |
|
|
|
595 |
#ifdef SCTP |
| 596 |
static void |
| 597 |
add_one_listen_multiple_addr(ServerOptions *options, char *addr, int port, int last) |
| 598 |
{ |
| 599 |
struct addrinfo hints, *ai, *aitop; |
| 600 |
char strport[NI_MAXSERV]; |
| 601 |
int gaierr; |
| 602 |
|
| 603 |
memset(&hints, 0, sizeof(hints)); |
| 604 |
hints.ai_family = options->address_family; |
| 605 |
hints.ai_socktype = SOCK_STREAM; |
| 606 |
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; |
| 607 |
snprintf(strport, sizeof strport, "%d", port); |
| 608 |
if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) |
| 609 |
fatal("bad addr or host: %s (%s)", |
| 610 |
addr ? addr : "<NULL>", |
| 611 |
ssh_gai_strerror(gaierr)); |
| 612 |
/* Mark addresses as multihomed */ |
| 613 |
for (ai = aitop; ai->ai_next; ai = ai->ai_next) |
| 614 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 615 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 616 |
ai->ai_next = options->listen_addrs; |
| 617 |
options->listen_addrs = aitop; |
| 618 |
|
| 619 |
if (last) { |
| 620 |
aitop->ai_flags = 0; |
| 621 |
} |
| 622 |
} |
| 623 |
|
| 624 |
static void |
| 625 |
add_listen_multiple_addrs(ServerOptions *options, char *addrs, int port) |
| 626 |
{ |
| 627 |
u_int i, num_addrs; |
| 628 |
char **addrsptr, *p; |
| 629 |
|
| 630 |
if (options->num_ports == 0) |
| 631 |
options->ports[options->num_ports++] = SSH_DEFAULT_PORT; |
| 632 |
if (options->address_family == -1) |
| 633 |
options->address_family = AF_UNSPEC; |
| 634 |
|
| 635 |
num_addrs = 1; |
| 636 |
p = addrs; |
| 637 |
while ((p = strchr(p, ',')) != NULL) { |
| 638 |
num_addrs++; |
| 639 |
p++; |
| 640 |
} |
| 641 |
debug("found %d addresses for multi-homing", num_addrs); |
| 642 |
|
| 643 |
addrsptr = xmalloc(num_addrs * sizeof(char*)); |
| 644 |
p = addrs; |
| 645 |
for (i = 0; i < num_addrs; i++) { |
| 646 |
addrsptr[i] = p; |
| 647 |
p = strchr(p+1, ','); |
| 648 |
if (p != NULL) |
| 649 |
*(p++) = '\0'; |
| 650 |
} |
| 651 |
|
| 652 |
if (port == 0) |
| 653 |
for (i = 0; i < options->num_ports; i++) { |
| 654 |
while (--num_addrs) { |
| 655 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], options->ports[i], 0); |
| 656 |
} |
| 657 |
add_one_listen_multiple_addr(options, addrs, options->ports[i], 1); |
| 658 |
} |
| 659 |
else { |
| 660 |
while (--num_addrs) { |
| 661 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], port, 0); |
| 662 |
} |
| 663 |
add_one_listen_multiple_addr(options, addrs, port, 1); |
| 664 |
} |
| 665 |
|
| 666 |
free(addrsptr); |
| 667 |
} |
| 668 |
#endif |
| 669 |
|
| 579 |
/* |
670 |
/* |
| 580 |
* The strategy for the Match blocks is that the config file is parsed twice. |
671 |
* The strategy for the Match blocks is that the config file is parsed twice. |
| 581 |
* |
672 |
* |
|
Lines 924-929
process_server_config_line(ServerOptions
Link Here
|
| 924 |
intptr = &options->key_regeneration_time; |
1015 |
intptr = &options->key_regeneration_time; |
| 925 |
goto parse_time; |
1016 |
goto parse_time; |
| 926 |
|
1017 |
|
|
|
1018 |
#ifdef SCTP |
| 1019 |
case sListenMultipleAddresses: |
| 1020 |
arg = strdelim(&cp); |
| 1021 |
if (arg == NULL || *arg == '\0') |
| 1022 |
fatal("%s line %d: missing addresses", |
| 1023 |
filename, linenum); |
| 1024 |
|
| 1025 |
/* Check for appended port */ |
| 1026 |
p = strchr(arg, ';'); |
| 1027 |
if (p != NULL) { |
| 1028 |
if ((port = a2port(p + 1)) <= 0) |
| 1029 |
fatal("%s line %d: bad port number", filename, linenum); |
| 1030 |
*p = '\0'; |
| 1031 |
} else { |
| 1032 |
port = 0; |
| 1033 |
} |
| 1034 |
add_listen_multiple_addrs(options, arg, port); |
| 1035 |
break; |
| 1036 |
#endif |
| 1037 |
|
| 927 |
case sListenAddress: |
1038 |
case sListenAddress: |
| 928 |
arg = strdelim(&cp); |
1039 |
arg = strdelim(&cp); |
| 929 |
if (arg == NULL || *arg == '\0') |
1040 |
if (arg == NULL || *arg == '\0') |
|
Lines 1313-1318
process_server_config_line(ServerOptions
Link Here
|
| 1313 |
options->kex_algorithms = xstrdup(arg); |
1424 |
options->kex_algorithms = xstrdup(arg); |
| 1314 |
break; |
1425 |
break; |
| 1315 |
|
1426 |
|
|
|
1427 |
#ifdef SCTP |
| 1428 |
case sTransport: |
| 1429 |
arg = strdelim(&cp); |
| 1430 |
if (!arg || *arg == '\0') |
| 1431 |
fatal("%s line %d: missing transport protocol specification", |
| 1432 |
filename, linenum); |
| 1433 |
if (strcasecmp(arg, "all") == 0) |
| 1434 |
options->transport = TRANSPORT_ALL; |
| 1435 |
else if (strcasecmp(arg, "tcp") == 0) |
| 1436 |
options->transport = TRANSPORT_TCP; |
| 1437 |
else if (strcasecmp(arg, "sctp") == 0) |
| 1438 |
options->transport = TRANSPORT_SCTP; |
| 1439 |
else |
| 1440 |
fatal("%s line %d: unknown transport protocol specified", |
| 1441 |
filename, linenum); |
| 1442 |
break; |
| 1443 |
#endif |
| 1444 |
|
| 1316 |
case sProtocol: |
1445 |
case sProtocol: |
| 1317 |
intptr = &options->protocol; |
1446 |
intptr = &options->protocol; |
| 1318 |
arg = strdelim(&cp); |
1447 |
arg = strdelim(&cp); |
|
Lines 1761-1766
copy_set_server_options(ServerOptions *d
Link Here
|
| 1761 |
M_CP_INTOPT(allow_tcp_forwarding); |
1890 |
M_CP_INTOPT(allow_tcp_forwarding); |
| 1762 |
M_CP_INTOPT(allow_agent_forwarding); |
1891 |
M_CP_INTOPT(allow_agent_forwarding); |
| 1763 |
M_CP_INTOPT(permit_tun); |
1892 |
M_CP_INTOPT(permit_tun); |
|
|
1893 |
#ifdef SCTP |
| 1894 |
M_CP_INTOPT(transport); |
| 1895 |
#endif |
| 1764 |
M_CP_INTOPT(gateway_ports); |
1896 |
M_CP_INTOPT(gateway_ports); |
| 1765 |
M_CP_INTOPT(x11_display_offset); |
1897 |
M_CP_INTOPT(x11_display_offset); |
| 1766 |
M_CP_INTOPT(x11_forwarding); |
1898 |
M_CP_INTOPT(x11_forwarding); |
|
Lines 2013-2018
dump_config(ServerOptions *o)
Link Here
|
| 2013 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
2145 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
| 2014 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
2146 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
| 2015 |
dump_cfg_fmtint(sCompression, o->compression); |
2147 |
dump_cfg_fmtint(sCompression, o->compression); |
|
|
2148 |
#ifdef SCTP |
| 2149 |
dump_cfg_fmtint(sTransport, o->transport); |
| 2150 |
#endif |
| 2016 |
dump_cfg_fmtint(sGatewayPorts, o->gateway_ports); |
2151 |
dump_cfg_fmtint(sGatewayPorts, o->gateway_ports); |
| 2017 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
2152 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
| 2018 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |
2153 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |