summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <kees@debian.org>2014-02-09 16:10:06 +0000
committerColin Watson <cjwatson@debian.org>2014-03-19 16:40:06 +0000
commit75e44c43679e8b888b7ef55ce7abe432eb57ef1c (patch)
tree73db865971fcd71d6f3fc9ae5770a01248afb78c
parent07b738d2bf93a5e3c57ab242b666a5f58484c7a3 (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: 2013-09-14 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 65f71ade8..63ff4ffbc 100644
--- a/servconf.c
+++ b/servconf.c
@@ -157,6 +157,7 @@ initialize_server_options(ServerOptions *options)
157 options->ip_qos_interactive = -1; 157 options->ip_qos_interactive = -1;
158 options->ip_qos_bulk = -1; 158 options->ip_qos_bulk = -1;
159 options->version_addendum = NULL; 159 options->version_addendum = NULL;
160 options->debian_banner = -1;
160} 161}
161 162
162void 163void
@@ -312,6 +313,8 @@ fill_default_server_options(ServerOptions *options)
312 options->ip_qos_bulk = IPTOS_THROUGHPUT; 313 options->ip_qos_bulk = IPTOS_THROUGHPUT;
313 if (options->version_addendum == NULL) 314 if (options->version_addendum == NULL)
314 options->version_addendum = xstrdup(""); 315 options->version_addendum = xstrdup("");
316 if (options->debian_banner == -1)
317 options->debian_banner = 1;
315 /* Turn privilege separation on by default */ 318 /* Turn privilege separation on by default */
316 if (use_privsep == -1) 319 if (use_privsep == -1)
317 use_privsep = PRIVSEP_NOSANDBOX; 320 use_privsep = PRIVSEP_NOSANDBOX;
@@ -362,6 +365,7 @@ typedef enum {
362 sKexAlgorithms, sIPQoS, sVersionAddendum, 365 sKexAlgorithms, sIPQoS, sVersionAddendum,
363 sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, 366 sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
364 sAuthenticationMethods, sHostKeyAgent, 367 sAuthenticationMethods, sHostKeyAgent,
368 sDebianBanner,
365 sDeprecated, sUnsupported 369 sDeprecated, sUnsupported
366} ServerOpCodes; 370} ServerOpCodes;
367 371
@@ -504,6 +508,7 @@ static struct {
504 { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, 508 { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL },
505 { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, 509 { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL },
506 { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL }, 510 { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL },
511 { "debianbanner", sDebianBanner, SSHCFG_GLOBAL },
507 { NULL, sBadOption, 0 } 512 { NULL, sBadOption, 0 }
508}; 513};
509 514
@@ -1666,6 +1671,10 @@ process_server_config_line(ServerOptions *options, char *line,
1666 } 1671 }
1667 return 0; 1672 return 0;
1668 1673
1674 case sDebianBanner:
1675 intptr = &options->debian_banner;
1676 goto parse_int;
1677
1669 case sDeprecated: 1678 case sDeprecated:
1670 logit("%s line %d: Deprecated option %s", 1679 logit("%s line %d: Deprecated option %s",
1671 filename, linenum, arg); 1680 filename, linenum, arg);
diff --git a/servconf.h b/servconf.h
index eba76ee1d..98d68ceaf 100644
--- a/servconf.h
+++ b/servconf.h
@@ -188,6 +188,8 @@ typedef struct {
188 188
189 u_int num_auth_methods; 189 u_int num_auth_methods;
190 char *auth_methods[MAX_AUTH_METHODS]; 190 char *auth_methods[MAX_AUTH_METHODS];
191
192 int debian_banner;
191} ServerOptions; 193} ServerOptions;
192 194
193/* Information about the incoming connection as used by Match */ 195/* Information about the incoming connection as used by Match */
diff --git a/sshd.c b/sshd.c
index 82168a186..c49a87773 100644
--- a/sshd.c
+++ b/sshd.c
@@ -440,7 +440,8 @@ sshd_exchange_identification(int sock_in, int sock_out)
440 } 440 }
441 441
442 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", 442 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
443 major, minor, SSH_RELEASE, 443 major, minor,
444 options.debian_banner ? SSH_RELEASE : SSH_RELEASE_MINIMUM,
444 *options.version_addendum == '\0' ? "" : " ", 445 *options.version_addendum == '\0' ? "" : " ",
445 options.version_addendum, newline); 446 options.version_addendum, newline);
446 447
diff --git a/sshd_config.5 b/sshd_config.5
index 39643deb1..bdca79724 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -413,6 +413,11 @@ or
413.Dq no . 413.Dq no .
414The default is 414The default is
415.Dq delayed . 415.Dq delayed .
416.It Cm DebianBanner
417Specifies whether the distribution-specified extra version suffix is
418included during initial protocol handshake.
419The default is
420.Dq yes .
416.It Cm DenyGroups 421.It Cm DenyGroups
417This keyword can be followed by a list of group name patterns, separated 422This keyword can be followed by a list of group name patterns, separated
418by spaces. 423by spaces.