summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authorKees Cook <kees@debian.org>2014-02-09 16:10:06 +0000
committerColin Watson <cjwatson@debian.org>2015-11-29 17:36:19 +0000
commite4e2b402150f28abadcd565941ab51c2bcbac8ce (patch)
treeac614375adfce0ff3563b4af644f2791b6656df2 /servconf.c
parent40fc1212b3c06063cf3926aa8e8209e1fa05436f (diff)
Add DebianBanner server configuration option
Setting this to "no" causes sshd to omit the Debian revision from its initial protocol handshake, for those scared by package-versioning.patch. Bug-Debian: http://bugs.debian.org/562048 Forwarded: not-needed Last-Update: 2015-11-29 Patch-Name: debian-banner.patch
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/servconf.c b/servconf.c
index ed3a88d4b..a778f44e9 100644
--- a/servconf.c
+++ b/servconf.c
@@ -171,6 +171,7 @@ initialize_server_options(ServerOptions *options)
171 options->ip_qos_bulk = -1; 171 options->ip_qos_bulk = -1;
172 options->version_addendum = NULL; 172 options->version_addendum = NULL;
173 options->fingerprint_hash = -1; 173 options->fingerprint_hash = -1;
174 options->debian_banner = -1;
174} 175}
175 176
176/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */ 177/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */
@@ -347,6 +348,8 @@ fill_default_server_options(ServerOptions *options)
347 options->fwd_opts.streamlocal_bind_unlink = 0; 348 options->fwd_opts.streamlocal_bind_unlink = 0;
348 if (options->fingerprint_hash == -1) 349 if (options->fingerprint_hash == -1)
349 options->fingerprint_hash = SSH_FP_HASH_DEFAULT; 350 options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
351 if (options->debian_banner == -1)
352 options->debian_banner = 1;
350 353
351 if (kex_assemble_names(KEX_SERVER_ENCRYPT, &options->ciphers) != 0 || 354 if (kex_assemble_names(KEX_SERVER_ENCRYPT, &options->ciphers) != 0 ||
352 kex_assemble_names(KEX_SERVER_MAC, &options->macs) != 0 || 355 kex_assemble_names(KEX_SERVER_MAC, &options->macs) != 0 ||
@@ -430,6 +433,7 @@ typedef enum {
430 sAuthenticationMethods, sHostKeyAgent, sPermitUserRC, 433 sAuthenticationMethods, sHostKeyAgent, sPermitUserRC,
431 sStreamLocalBindMask, sStreamLocalBindUnlink, 434 sStreamLocalBindMask, sStreamLocalBindUnlink,
432 sAllowStreamLocalForwarding, sFingerprintHash, 435 sAllowStreamLocalForwarding, sFingerprintHash,
436 sDebianBanner,
433 sDeprecated, sUnsupported 437 sDeprecated, sUnsupported
434} ServerOpCodes; 438} ServerOpCodes;
435 439
@@ -577,6 +581,7 @@ static struct {
577 { "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL }, 581 { "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL },
578 { "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL }, 582 { "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL },
579 { "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL }, 583 { "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL },
584 { "debianbanner", sDebianBanner, SSHCFG_GLOBAL },
580 { NULL, sBadOption, 0 } 585 { NULL, sBadOption, 0 }
581}; 586};
582 587
@@ -1867,6 +1872,10 @@ process_server_config_line(ServerOptions *options, char *line,
1867 options->fingerprint_hash = value; 1872 options->fingerprint_hash = value;
1868 break; 1873 break;
1869 1874
1875 case sDebianBanner:
1876 intptr = &options->debian_banner;
1877 goto parse_int;
1878
1870 case sDeprecated: 1879 case sDeprecated:
1871 logit("%s line %d: Deprecated option %s", 1880 logit("%s line %d: Deprecated option %s",
1872 filename, linenum, arg); 1881 filename, linenum, arg);