|
Lines 129-134
initialize_server_options(ServerOptions
Link Here
|
| 129 |
options->ciphers = NULL; |
129 |
options->ciphers = NULL; |
| 130 |
options->macs = NULL; |
130 |
options->macs = NULL; |
| 131 |
options->kex_algorithms = NULL; |
131 |
options->kex_algorithms = NULL; |
|
|
132 |
#ifdef SCTP |
| 133 |
options->transport = -1; |
| 134 |
#endif |
| 132 |
options->protocol = SSH_PROTO_UNKNOWN; |
135 |
options->protocol = SSH_PROTO_UNKNOWN; |
| 133 |
options->fwd_opts.gateway_ports = -1; |
136 |
options->fwd_opts.gateway_ports = -1; |
| 134 |
options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; |
137 |
options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; |
|
Lines 276-281
fill_default_server_options(ServerOption
Link Here
|
| 276 |
options->allow_streamlocal_forwarding = FORWARD_ALLOW; |
279 |
options->allow_streamlocal_forwarding = FORWARD_ALLOW; |
| 277 |
if (options->allow_agent_forwarding == -1) |
280 |
if (options->allow_agent_forwarding == -1) |
| 278 |
options->allow_agent_forwarding = 1; |
281 |
options->allow_agent_forwarding = 1; |
|
|
282 |
#ifdef SCTP |
| 283 |
if (options->transport == -1) |
| 284 |
options->transport = TRANSPORT_TCP; |
| 285 |
#endif |
| 279 |
if (options->fwd_opts.gateway_ports == -1) |
286 |
if (options->fwd_opts.gateway_ports == -1) |
| 280 |
options->fwd_opts.gateway_ports = 0; |
287 |
options->fwd_opts.gateway_ports = 0; |
| 281 |
if (options->max_startups == -1) |
288 |
if (options->max_startups == -1) |
|
Lines 341-346
typedef enum {
Link Here
|
| 341 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
348 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
| 342 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
349 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
| 343 |
sListenAddress, sAddressFamily, |
350 |
sListenAddress, sAddressFamily, |
|
|
351 |
#ifdef SCTP |
| 352 |
sTransport, sListenMultipleAddresses, |
| 353 |
#endif |
| 344 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
354 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
| 345 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
355 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
| 346 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
356 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
|
Lines 431-436
static struct {
Link Here
|
| 431 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
441 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
| 432 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
442 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
| 433 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
443 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
|
|
444 |
#ifdef SCTP |
| 445 |
{ "listenmultipleaddresses", sListenMultipleAddresses, SSHCFG_GLOBAL }, |
| 446 |
#endif |
| 434 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
447 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
| 435 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
448 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
| 436 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
449 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
|
Lines 456-461
static struct {
Link Here
|
| 456 |
{ "denygroups", sDenyGroups, SSHCFG_ALL }, |
469 |
{ "denygroups", sDenyGroups, SSHCFG_ALL }, |
| 457 |
{ "ciphers", sCiphers, SSHCFG_GLOBAL }, |
470 |
{ "ciphers", sCiphers, SSHCFG_GLOBAL }, |
| 458 |
{ "macs", sMacs, SSHCFG_GLOBAL }, |
471 |
{ "macs", sMacs, SSHCFG_GLOBAL }, |
|
|
472 |
#ifdef SCTP |
| 473 |
{ "transport", sTransport, SSHCFG_GLOBAL }, |
| 474 |
#endif |
| 459 |
{ "protocol", sProtocol, SSHCFG_GLOBAL }, |
475 |
{ "protocol", sProtocol, SSHCFG_GLOBAL }, |
| 460 |
{ "gatewayports", sGatewayPorts, SSHCFG_ALL }, |
476 |
{ "gatewayports", sGatewayPorts, SSHCFG_ALL }, |
| 461 |
{ "subsystem", sSubsystem, SSHCFG_GLOBAL }, |
477 |
{ "subsystem", sSubsystem, SSHCFG_GLOBAL }, |
|
Lines 594-599
get_connection_info(int populate, int us
Link Here
|
| 594 |
return &ci; |
610 |
return &ci; |
| 595 |
} |
611 |
} |
| 596 |
|
612 |
|
|
|
613 |
#ifdef SCTP |
| 614 |
static void |
| 615 |
add_one_listen_multiple_addr(ServerOptions *options, char *addr, int port, int last) |
| 616 |
{ |
| 617 |
struct addrinfo hints, *ai, *aitop; |
| 618 |
char strport[NI_MAXSERV]; |
| 619 |
int gaierr; |
| 620 |
|
| 621 |
memset(&hints, 0, sizeof(hints)); |
| 622 |
hints.ai_family = options->address_family; |
| 623 |
hints.ai_socktype = SOCK_STREAM; |
| 624 |
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; |
| 625 |
snprintf(strport, sizeof strport, "%d", port); |
| 626 |
if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) |
| 627 |
fatal("bad addr or host: %s (%s)", |
| 628 |
addr ? addr : "<NULL>", |
| 629 |
ssh_gai_strerror(gaierr)); |
| 630 |
/* Mark addresses as multihomed */ |
| 631 |
for (ai = aitop; ai->ai_next; ai = ai->ai_next) |
| 632 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 633 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 634 |
ai->ai_next = options->listen_addrs; |
| 635 |
options->listen_addrs = aitop; |
| 636 |
|
| 637 |
if (last) { |
| 638 |
aitop->ai_flags = 0; |
| 639 |
} |
| 640 |
} |
| 641 |
|
| 642 |
static void |
| 643 |
add_listen_multiple_addrs(ServerOptions *options, char *addrs, int port) |
| 644 |
{ |
| 645 |
u_int i, num_addrs; |
| 646 |
char **addrsptr, *p; |
| 647 |
|
| 648 |
if (options->num_ports == 0) |
| 649 |
options->ports[options->num_ports++] = SSH_DEFAULT_PORT; |
| 650 |
if (options->address_family == -1) |
| 651 |
options->address_family = AF_UNSPEC; |
| 652 |
|
| 653 |
num_addrs = 1; |
| 654 |
p = addrs; |
| 655 |
while ((p = strchr(p, ',')) != NULL) { |
| 656 |
num_addrs++; |
| 657 |
p++; |
| 658 |
} |
| 659 |
debug("found %d addresses for multi-homing", num_addrs); |
| 660 |
|
| 661 |
addrsptr = xmalloc(num_addrs * sizeof(char*)); |
| 662 |
p = addrs; |
| 663 |
for (i = 0; i < num_addrs; i++) { |
| 664 |
addrsptr[i] = p; |
| 665 |
p = strchr(p+1, ','); |
| 666 |
if (p != NULL) |
| 667 |
*(p++) = '\0'; |
| 668 |
} |
| 669 |
|
| 670 |
if (port == 0) |
| 671 |
for (i = 0; i < options->num_ports; i++) { |
| 672 |
while (--num_addrs) { |
| 673 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], options->ports[i], 0); |
| 674 |
} |
| 675 |
add_one_listen_multiple_addr(options, addrs, options->ports[i], 1); |
| 676 |
} |
| 677 |
else { |
| 678 |
while (--num_addrs) { |
| 679 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], port, 0); |
| 680 |
} |
| 681 |
add_one_listen_multiple_addr(options, addrs, port, 1); |
| 682 |
} |
| 683 |
|
| 684 |
free(addrsptr); |
| 685 |
} |
| 686 |
#endif |
| 687 |
|
| 597 |
/* |
688 |
/* |
| 598 |
* The strategy for the Match blocks is that the config file is parsed twice. |
689 |
* The strategy for the Match blocks is that the config file is parsed twice. |
| 599 |
* |
690 |
* |
|
Lines 942-947
process_server_config_line(ServerOptions
Link Here
|
| 942 |
intptr = &options->key_regeneration_time; |
1033 |
intptr = &options->key_regeneration_time; |
| 943 |
goto parse_time; |
1034 |
goto parse_time; |
| 944 |
|
1035 |
|
|
|
1036 |
#ifdef SCTP |
| 1037 |
case sListenMultipleAddresses: |
| 1038 |
arg = strdelim(&cp); |
| 1039 |
if (arg == NULL || *arg == '\0') |
| 1040 |
fatal("%s line %d: missing addresses", |
| 1041 |
filename, linenum); |
| 1042 |
|
| 1043 |
/* Check for appended port */ |
| 1044 |
p = strchr(arg, ';'); |
| 1045 |
if (p != NULL) { |
| 1046 |
if ((port = a2port(p + 1)) <= 0) |
| 1047 |
fatal("%s line %d: bad port number", filename, linenum); |
| 1048 |
*p = '\0'; |
| 1049 |
} else { |
| 1050 |
port = 0; |
| 1051 |
} |
| 1052 |
add_listen_multiple_addrs(options, arg, port); |
| 1053 |
break; |
| 1054 |
#endif |
| 1055 |
|
| 945 |
case sListenAddress: |
1056 |
case sListenAddress: |
| 946 |
arg = strdelim(&cp); |
1057 |
arg = strdelim(&cp); |
| 947 |
if (arg == NULL || *arg == '\0') |
1058 |
if (arg == NULL || *arg == '\0') |
|
Lines 1340-1345
process_server_config_line(ServerOptions
Link Here
|
| 1340 |
options->kex_algorithms = xstrdup(arg); |
1451 |
options->kex_algorithms = xstrdup(arg); |
| 1341 |
break; |
1452 |
break; |
| 1342 |
|
1453 |
|
|
|
1454 |
#ifdef SCTP |
| 1455 |
case sTransport: |
| 1456 |
arg = strdelim(&cp); |
| 1457 |
if (!arg || *arg == '\0') |
| 1458 |
fatal("%s line %d: missing transport protocol specification", |
| 1459 |
filename, linenum); |
| 1460 |
if (strcasecmp(arg, "all") == 0) |
| 1461 |
options->transport = TRANSPORT_ALL; |
| 1462 |
else if (strcasecmp(arg, "tcp") == 0) |
| 1463 |
options->transport = TRANSPORT_TCP; |
| 1464 |
else if (strcasecmp(arg, "sctp") == 0) |
| 1465 |
options->transport = TRANSPORT_SCTP; |
| 1466 |
else |
| 1467 |
fatal("%s line %d: unknown transport protocol specified", |
| 1468 |
filename, linenum); |
| 1469 |
break; |
| 1470 |
#endif |
| 1471 |
|
| 1343 |
case sProtocol: |
1472 |
case sProtocol: |
| 1344 |
intptr = &options->protocol; |
1473 |
intptr = &options->protocol; |
| 1345 |
arg = strdelim(&cp); |
1474 |
arg = strdelim(&cp); |
|
Lines 1805-1810
copy_set_server_options(ServerOptions *d
Link Here
|
| 1805 |
M_CP_INTOPT(allow_streamlocal_forwarding); |
1934 |
M_CP_INTOPT(allow_streamlocal_forwarding); |
| 1806 |
M_CP_INTOPT(allow_agent_forwarding); |
1935 |
M_CP_INTOPT(allow_agent_forwarding); |
| 1807 |
M_CP_INTOPT(permit_tun); |
1936 |
M_CP_INTOPT(permit_tun); |
|
|
1937 |
#ifdef SCTP |
| 1938 |
M_CP_INTOPT(transport); |
| 1939 |
#endif |
| 1808 |
M_CP_INTOPT(fwd_opts.gateway_ports); |
1940 |
M_CP_INTOPT(fwd_opts.gateway_ports); |
| 1809 |
M_CP_INTOPT(x11_display_offset); |
1941 |
M_CP_INTOPT(x11_display_offset); |
| 1810 |
M_CP_INTOPT(x11_forwarding); |
1942 |
M_CP_INTOPT(x11_forwarding); |
|
Lines 2061-2066
dump_config(ServerOptions *o)
Link Here
|
| 2061 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
2193 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
| 2062 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
2194 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
| 2063 |
dump_cfg_fmtint(sCompression, o->compression); |
2195 |
dump_cfg_fmtint(sCompression, o->compression); |
|
|
2196 |
#ifdef SCTP |
| 2197 |
dump_cfg_fmtint(sTransport, o->transport); |
| 2198 |
#endif |
| 2064 |
dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports); |
2199 |
dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports); |
| 2065 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
2200 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
| 2066 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |
2201 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |