summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <kees@debian.org>2014-02-09 16:10:06 +0000
committerColin Watson <cjwatson@debian.org>2016-08-07 12:18:43 +0100
commit277ad2acedde81dce324e711da116d100b47f445 (patch)
treec1f6897cdf21a4dc38d4ac1b0751d426a853583e
parentc8105413361d3c97b6a2f72c9f1c85da830bed2c (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
-rw-r--r--servconf.c9
-rw-r--r--servconf.h2
-rw-r--r--sshd.c3
-rw-r--r--sshd_config.55
4 files changed, 18 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c
index bf9f8f784..a98b30938 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. */
@@ -359,6 +360,8 @@ fill_default_server_options(ServerOptions *options)
359 options->fwd_opts.streamlocal_bind_unlink = 0; 360 options->fwd_opts.streamlocal_bind_unlink = 0;
360 if (options->fingerprint_hash == -1) 361 if (options->fingerprint_hash == -1)
361 options->fingerprint_hash = SSH_FP_HASH_DEFAULT; 362 options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
363 if (options->debian_banner == -1)
364 options->debian_banner = 1;
362 365
363 assemble_algorithms(options); 366 assemble_algorithms(options);
364 367
@@ -445,6 +448,7 @@ typedef enum {
445 sAuthenticationMethods, sHostKeyAgent, sPermitUserRC, 448 sAuthenticationMethods, sHostKeyAgent, sPermitUserRC,
446 sStreamLocalBindMask, sStreamLocalBindUnlink, 449 sStreamLocalBindMask, sStreamLocalBindUnlink,
447 sAllowStreamLocalForwarding, sFingerprintHash, 450 sAllowStreamLocalForwarding, sFingerprintHash,
451 sDebianBanner,
448 sDeprecated, sUnsupported 452 sDeprecated, sUnsupported
449} ServerOpCodes; 453} ServerOpCodes;
450 454
@@ -596,6 +600,7 @@ static struct {
596 { "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL }, 600 { "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL },
597 { "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL }, 601 { "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL },
598 { "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL }, 602 { "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL },
603 { "debianbanner", sDebianBanner, SSHCFG_GLOBAL },
599 { NULL, sBadOption, 0 } 604 { NULL, sBadOption, 0 }
600}; 605};
601 606
@@ -1903,6 +1908,10 @@ process_server_config_line(ServerOptions *options, char *line,
1903 options->fingerprint_hash = value; 1908 options->fingerprint_hash = value;
1904 break; 1909 break;
1905 1910
1911 case sDebianBanner:
1912 intptr = &options->debian_banner;
1913 goto parse_int;
1914
1906 case sDeprecated: 1915 case sDeprecated:
1907 logit("%s line %d: Deprecated option %s", 1916 logit("%s line %d: Deprecated option %s",
1908 filename, linenum, arg); 1917 filename, linenum, arg);
diff --git a/servconf.h b/servconf.h
index 778ba1742..161fa37c4 100644
--- a/servconf.h
+++ b/servconf.h
@@ -197,6 +197,8 @@ typedef struct {
197 char *auth_methods[MAX_AUTH_METHODS]; 197 char *auth_methods[MAX_AUTH_METHODS];
198 198
199 int fingerprint_hash; 199 int fingerprint_hash;
200
201 int debian_banner;
200} ServerOptions; 202} ServerOptions;
201 203
202/* Information about the incoming connection as used by Match */ 204/* Information about the incoming connection as used by Match */
diff --git a/sshd.c b/sshd.c
index e873557b7..71fad9e54 100644
--- a/sshd.c
+++ b/sshd.c
@@ -443,7 +443,8 @@ sshd_exchange_identification(struct ssh *ssh, int sock_in, int sock_out)
443 } 443 }
444 444
445 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", 445 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
446 major, minor, SSH_RELEASE, 446 major, minor,
447 options.debian_banner ? SSH_RELEASE : SSH_RELEASE_MINIMUM,
447 *options.version_addendum == '\0' ? "" : " ", 448 *options.version_addendum == '\0' ? "" : " ",
448 options.version_addendum, newline); 449 options.version_addendum, newline);
449 450
diff --git a/sshd_config.5 b/sshd_config.5
index e05cdbef5..ac9b1f032 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -541,6 +541,11 @@ or
541.Dq no . 541.Dq no .
542The default is 542The default is
543.Dq delayed . 543.Dq delayed .
544.It Cm DebianBanner
545Specifies whether the distribution-specified extra version suffix is
546included during initial protocol handshake.
547The default is
548.Dq yes .
544.It Cm DenyGroups 549.It Cm DenyGroups
545This keyword can be followed by a list of group name patterns, separated 550This keyword can be followed by a list of group name patterns, separated
546by spaces. 551by spaces.