|
Lines 134-139
initialize_server_options(ServerOptions *options)
Link Here
|
| 134 |
options->ciphers = NULL; |
134 |
options->ciphers = NULL; |
| 135 |
options->macs = NULL; |
135 |
options->macs = NULL; |
| 136 |
options->kex_algorithms = NULL; |
136 |
options->kex_algorithms = NULL; |
|
|
137 |
options->transport = -1; |
| 137 |
options->protocol = SSH_PROTO_UNKNOWN; |
138 |
options->protocol = SSH_PROTO_UNKNOWN; |
| 138 |
options->fwd_opts.gateway_ports = -1; |
139 |
options->fwd_opts.gateway_ports = -1; |
| 139 |
options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; |
140 |
options->fwd_opts.streamlocal_bind_mask = (mode_t)-1; |
|
Lines 295-300
fill_default_server_options(ServerOptions *options)
Link Here
|
| 295 |
options->allow_streamlocal_forwarding = FORWARD_ALLOW; |
296 |
options->allow_streamlocal_forwarding = FORWARD_ALLOW; |
| 296 |
if (options->allow_agent_forwarding == -1) |
297 |
if (options->allow_agent_forwarding == -1) |
| 297 |
options->allow_agent_forwarding = 1; |
298 |
options->allow_agent_forwarding = 1; |
|
|
299 |
if (options->transport == -1) |
| 300 |
options->transport = TRANSPORT_TCP; |
| 298 |
if (options->fwd_opts.gateway_ports == -1) |
301 |
if (options->fwd_opts.gateway_ports == -1) |
| 299 |
options->fwd_opts.gateway_ports = 0; |
302 |
options->fwd_opts.gateway_ports = 0; |
| 300 |
if (options->max_startups == -1) |
303 |
if (options->max_startups == -1) |
|
Lines 380-385
typedef enum {
Link Here
|
| 380 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
383 |
sKerberosTgtPassing, sChallengeResponseAuthentication, |
| 381 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
384 |
sPasswordAuthentication, sKbdInteractiveAuthentication, |
| 382 |
sListenAddress, sAddressFamily, |
385 |
sListenAddress, sAddressFamily, |
|
|
386 |
sTransport, sListenMultipleAddresses, |
| 383 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
387 |
sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
| 384 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
388 |
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
| 385 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
389 |
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive, |
|
Lines 472-477
static struct {
Link Here
|
| 472 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
476 |
{ "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ |
| 473 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
477 |
{ "checkmail", sDeprecated, SSHCFG_GLOBAL }, |
| 474 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
478 |
{ "listenaddress", sListenAddress, SSHCFG_GLOBAL }, |
|
|
479 |
#ifdef SCTP |
| 480 |
{ "listenmultipleaddresses", sListenMultipleAddresses, SSHCFG_GLOBAL }, |
| 481 |
{ "transport", sTransport, SSHCFG_GLOBAL }, |
| 482 |
#else |
| 483 |
{ "listenmultipleaddresses", sUnsupported, SSHCFG_GLOBAL }, |
| 484 |
{ "transport", sUnsupported, SSHCFG_GLOBAL }, |
| 485 |
#endif |
| 475 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
486 |
{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL }, |
| 476 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
487 |
{ "printmotd", sPrintMotd, SSHCFG_GLOBAL }, |
| 477 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
488 |
{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL }, |
|
Lines 638-643
get_connection_info(int populate, int use_dns)
Link Here
|
| 638 |
return &ci; |
649 |
return &ci; |
| 639 |
} |
650 |
} |
| 640 |
|
651 |
|
|
|
652 |
#ifdef SCTP |
| 653 |
static void |
| 654 |
add_one_listen_multiple_addr(ServerOptions *options, char *addr, int port, int last) |
| 655 |
{ |
| 656 |
struct addrinfo hints, *ai, *aitop; |
| 657 |
char strport[NI_MAXSERV]; |
| 658 |
int gaierr; |
| 659 |
|
| 660 |
memset(&hints, 0, sizeof(hints)); |
| 661 |
hints.ai_family = options->address_family; |
| 662 |
hints.ai_socktype = SOCK_STREAM; |
| 663 |
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; |
| 664 |
snprintf(strport, sizeof strport, "%d", port); |
| 665 |
if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) |
| 666 |
fatal("bad addr or host: %s (%s)", |
| 667 |
addr ? addr : "<NULL>", |
| 668 |
ssh_gai_strerror(gaierr)); |
| 669 |
/* Mark addresses as multihomed */ |
| 670 |
for (ai = aitop; ai->ai_next; ai = ai->ai_next) |
| 671 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 672 |
ai->ai_flags = IS_MULTIPLE_ADDR; |
| 673 |
ai->ai_next = options->listen_addrs; |
| 674 |
options->listen_addrs = aitop; |
| 675 |
|
| 676 |
if (last) { |
| 677 |
aitop->ai_flags = 0; |
| 678 |
} |
| 679 |
} |
| 680 |
|
| 681 |
static void |
| 682 |
add_listen_multiple_addrs(ServerOptions *options, char *addrs, int port) |
| 683 |
{ |
| 684 |
u_int i, num_addrs; |
| 685 |
char **addrsptr, *p; |
| 686 |
|
| 687 |
if (options->num_ports == 0) |
| 688 |
options->ports[options->num_ports++] = SSH_DEFAULT_PORT; |
| 689 |
if (options->address_family == -1) |
| 690 |
options->address_family = AF_UNSPEC; |
| 691 |
|
| 692 |
num_addrs = 1; |
| 693 |
p = addrs; |
| 694 |
while ((p = strchr(p, ',')) != NULL) { |
| 695 |
num_addrs++; |
| 696 |
p++; |
| 697 |
} |
| 698 |
debug("found %d addresses for multi-homing", num_addrs); |
| 699 |
|
| 700 |
addrsptr = xmalloc(num_addrs * sizeof(char*)); |
| 701 |
p = addrs; |
| 702 |
for (i = 0; i < num_addrs; i++) { |
| 703 |
addrsptr[i] = p; |
| 704 |
p = strchr(p+1, ','); |
| 705 |
if (p != NULL) |
| 706 |
*(p++) = '\0'; |
| 707 |
} |
| 708 |
|
| 709 |
if (port == 0) |
| 710 |
for (i = 0; i < options->num_ports; i++) { |
| 711 |
while (--num_addrs) |
| 712 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], options->ports[i], 0); |
| 713 |
add_one_listen_multiple_addr(options, addrs, options->ports[i], 1); |
| 714 |
} |
| 715 |
else { |
| 716 |
while (--num_addrs) |
| 717 |
add_one_listen_multiple_addr(options, addrsptr[num_addrs], port, 0); |
| 718 |
add_one_listen_multiple_addr(options, addrs, port, 1); |
| 719 |
} |
| 720 |
|
| 721 |
free(addrsptr); |
| 722 |
} |
| 723 |
#endif |
| 724 |
|
| 641 |
/* |
725 |
/* |
| 642 |
* The strategy for the Match blocks is that the config file is parsed twice. |
726 |
* The strategy for the Match blocks is that the config file is parsed twice. |
| 643 |
* |
727 |
* |
|
Lines 986-991
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 986 |
intptr = &options->key_regeneration_time; |
1070 |
intptr = &options->key_regeneration_time; |
| 987 |
goto parse_time; |
1071 |
goto parse_time; |
| 988 |
|
1072 |
|
|
|
1073 |
#ifdef SCTP |
| 1074 |
case sListenMultipleAddresses: |
| 1075 |
arg = strdelim(&cp); |
| 1076 |
if (arg == NULL || *arg == '\0') |
| 1077 |
fatal("%s line %d: missing addresses", |
| 1078 |
filename, linenum); |
| 1079 |
|
| 1080 |
/* Check for appended port */ |
| 1081 |
p = strchr(arg, ';'); |
| 1082 |
if (p != NULL) { |
| 1083 |
if ((port = a2port(p + 1)) <= 0) |
| 1084 |
fatal("%s line %d: bad port number", filename, linenum); |
| 1085 |
*p = '\0'; |
| 1086 |
} else |
| 1087 |
port = 0; |
| 1088 |
add_listen_multiple_addrs(options, arg, port); |
| 1089 |
break; |
| 1090 |
#endif |
| 1091 |
|
| 989 |
case sListenAddress: |
1092 |
case sListenAddress: |
| 990 |
arg = strdelim(&cp); |
1093 |
arg = strdelim(&cp); |
| 991 |
if (arg == NULL || *arg == '\0') |
1094 |
if (arg == NULL || *arg == '\0') |
|
Lines 1402-1407
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 1402 |
options->kex_algorithms = xstrdup(arg); |
1505 |
options->kex_algorithms = xstrdup(arg); |
| 1403 |
break; |
1506 |
break; |
| 1404 |
|
1507 |
|
|
|
1508 |
case sTransport: |
| 1509 |
arg = strdelim(&cp); |
| 1510 |
if (!arg || *arg == '\0') |
| 1511 |
fatal("%s line %d: missing transport protocol specification", |
| 1512 |
filename, linenum); |
| 1513 |
if (strcasecmp(arg, "all") == 0) |
| 1514 |
options->transport = TRANSPORT_ALL; |
| 1515 |
else if (strcasecmp(arg, "tcp") == 0) |
| 1516 |
options->transport = TRANSPORT_TCP; |
| 1517 |
else if (strcasecmp(arg, "sctp") == 0) |
| 1518 |
options->transport = TRANSPORT_SCTP; |
| 1519 |
else |
| 1520 |
fatal("%s line %d: unknown transport protocol specified", |
| 1521 |
filename, linenum); |
| 1522 |
break; |
| 1523 |
|
| 1405 |
case sProtocol: |
1524 |
case sProtocol: |
| 1406 |
intptr = &options->protocol; |
1525 |
intptr = &options->protocol; |
| 1407 |
arg = strdelim(&cp); |
1526 |
arg = strdelim(&cp); |
|
Lines 1885-1890
copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
Link Here
|
| 1885 |
M_CP_INTOPT(allow_streamlocal_forwarding); |
2004 |
M_CP_INTOPT(allow_streamlocal_forwarding); |
| 1886 |
M_CP_INTOPT(allow_agent_forwarding); |
2005 |
M_CP_INTOPT(allow_agent_forwarding); |
| 1887 |
M_CP_INTOPT(permit_tun); |
2006 |
M_CP_INTOPT(permit_tun); |
|
|
2007 |
M_CP_INTOPT(transport); |
| 1888 |
M_CP_INTOPT(fwd_opts.gateway_ports); |
2008 |
M_CP_INTOPT(fwd_opts.gateway_ports); |
| 1889 |
M_CP_INTOPT(x11_display_offset); |
2009 |
M_CP_INTOPT(x11_display_offset); |
| 1890 |
M_CP_INTOPT(x11_forwarding); |
2010 |
M_CP_INTOPT(x11_forwarding); |
|
Lines 2144-2149
dump_config(ServerOptions *o)
Link Here
|
| 2144 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
2264 |
dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
| 2145 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
2265 |
dump_cfg_fmtint(sUseLogin, o->use_login); |
| 2146 |
dump_cfg_fmtint(sCompression, o->compression); |
2266 |
dump_cfg_fmtint(sCompression, o->compression); |
|
|
2267 |
#ifdef SCTP |
| 2268 |
dump_cfg_fmtint(sTransport, o->transport); |
| 2269 |
#endif |
| 2147 |
dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports); |
2270 |
dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports); |
| 2148 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
2271 |
dump_cfg_fmtint(sUseDNS, o->use_dns); |
| 2149 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |
2272 |
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding); |