summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kex.c5
-rw-r--r--kex.h2
-rw-r--r--servconf.c9
-rw-r--r--servconf.h2
-rw-r--r--sshconnect.c2
-rw-r--r--sshd.c3
-rw-r--r--sshd_config.55
7 files changed, 23 insertions, 5 deletions
diff --git a/kex.c b/kex.c
index be354206d..bbb7a2340 100644
--- a/kex.c
+++ b/kex.c
@@ -1168,7 +1168,7 @@ send_error(struct ssh *ssh, char *msg)
1168 */ 1168 */
1169int 1169int
1170kex_exchange_identification(struct ssh *ssh, int timeout_ms, 1170kex_exchange_identification(struct ssh *ssh, int timeout_ms,
1171 const char *version_addendum) 1171 int debian_banner, const char *version_addendum)
1172{ 1172{
1173 int remote_major, remote_minor, mismatch; 1173 int remote_major, remote_minor, mismatch;
1174 size_t len, i, n; 1174 size_t len, i, n;
@@ -1186,7 +1186,8 @@ kex_exchange_identification(struct ssh *ssh, int timeout_ms,
1186 if (version_addendum != NULL && *version_addendum == '\0') 1186 if (version_addendum != NULL && *version_addendum == '\0')
1187 version_addendum = NULL; 1187 version_addendum = NULL;
1188 if ((r = sshbuf_putf(our_version, "SSH-%d.%d-%.100s%s%s\r\n", 1188 if ((r = sshbuf_putf(our_version, "SSH-%d.%d-%.100s%s%s\r\n",
1189 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE, 1189 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2,
1190 debian_banner ? SSH_RELEASE : SSH_RELEASE_MINIMUM,
1190 version_addendum == NULL ? "" : " ", 1191 version_addendum == NULL ? "" : " ",
1191 version_addendum == NULL ? "" : version_addendum)) != 0) { 1192 version_addendum == NULL ? "" : version_addendum)) != 0) {
1192 error("%s: sshbuf_putf: %s", __func__, ssh_err(r)); 1193 error("%s: sshbuf_putf: %s", __func__, ssh_err(r));
diff --git a/kex.h b/kex.h
index 2d5f1d4ed..39f67bbc1 100644
--- a/kex.h
+++ b/kex.h
@@ -195,7 +195,7 @@ char *kex_names_cat(const char *, const char *);
195int kex_assemble_names(char **, const char *, const char *); 195int kex_assemble_names(char **, const char *, const char *);
196int kex_gss_names_valid(const char *); 196int kex_gss_names_valid(const char *);
197 197
198int kex_exchange_identification(struct ssh *, int, const char *); 198int kex_exchange_identification(struct ssh *, int, int, const char *);
199 199
200struct kex *kex_new(void); 200struct kex *kex_new(void);
201int kex_ready(struct ssh *, char *[PROPOSAL_MAX]); 201int kex_ready(struct ssh *, char *[PROPOSAL_MAX]);
diff --git a/servconf.c b/servconf.c
index c01e0690e..8d2bced52 100644
--- a/servconf.c
+++ b/servconf.c
@@ -184,6 +184,7 @@ initialize_server_options(ServerOptions *options)
184 options->fingerprint_hash = -1; 184 options->fingerprint_hash = -1;
185 options->disable_forwarding = -1; 185 options->disable_forwarding = -1;
186 options->expose_userauth_info = -1; 186 options->expose_userauth_info = -1;
187 options->debian_banner = -1;
187} 188}
188 189
189/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */ 190/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */
@@ -437,6 +438,8 @@ fill_default_server_options(ServerOptions *options)
437 options->disable_forwarding = 0; 438 options->disable_forwarding = 0;
438 if (options->expose_userauth_info == -1) 439 if (options->expose_userauth_info == -1)
439 options->expose_userauth_info = 0; 440 options->expose_userauth_info = 0;
441 if (options->debian_banner == -1)
442 options->debian_banner = 1;
440 443
441 assemble_algorithms(options); 444 assemble_algorithms(options);
442 445
@@ -523,6 +526,7 @@ typedef enum {
523 sStreamLocalBindMask, sStreamLocalBindUnlink, 526 sStreamLocalBindMask, sStreamLocalBindUnlink,
524 sAllowStreamLocalForwarding, sFingerprintHash, sDisableForwarding, 527 sAllowStreamLocalForwarding, sFingerprintHash, sDisableForwarding,
525 sExposeAuthInfo, sRDomain, 528 sExposeAuthInfo, sRDomain,
529 sDebianBanner,
526 sDeprecated, sIgnore, sUnsupported 530 sDeprecated, sIgnore, sUnsupported
527} ServerOpCodes; 531} ServerOpCodes;
528 532
@@ -682,6 +686,7 @@ static struct {
682 { "exposeauthinfo", sExposeAuthInfo, SSHCFG_ALL }, 686 { "exposeauthinfo", sExposeAuthInfo, SSHCFG_ALL },
683 { "rdomain", sRDomain, SSHCFG_ALL }, 687 { "rdomain", sRDomain, SSHCFG_ALL },
684 { "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL }, 688 { "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL },
689 { "debianbanner", sDebianBanner, SSHCFG_GLOBAL },
685 { NULL, sBadOption, 0 } 690 { NULL, sBadOption, 0 }
686}; 691};
687 692
@@ -2211,6 +2216,10 @@ process_server_config_line(ServerOptions *options, char *line,
2211 *charptr = xstrdup(arg); 2216 *charptr = xstrdup(arg);
2212 break; 2217 break;
2213 2218
2219 case sDebianBanner:
2220 intptr = &options->debian_banner;
2221 goto parse_flag;
2222
2214 case sDeprecated: 2223 case sDeprecated:
2215 case sIgnore: 2224 case sIgnore:
2216 case sUnsupported: 2225 case sUnsupported:
diff --git a/servconf.h b/servconf.h
index a476d5220..986093ffa 100644
--- a/servconf.h
+++ b/servconf.h
@@ -214,6 +214,8 @@ typedef struct {
214 int fingerprint_hash; 214 int fingerprint_hash;
215 int expose_userauth_info; 215 int expose_userauth_info;
216 u_int64_t timing_secret; 216 u_int64_t timing_secret;
217
218 int debian_banner;
217} ServerOptions; 219} ServerOptions;
218 220
219/* Information about the incoming connection as used by Match */ 221/* Information about the incoming connection as used by Match */
diff --git a/sshconnect.c b/sshconnect.c
index 0b6f6af4b..1183ffe0e 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1287,7 +1287,7 @@ ssh_login(struct ssh *ssh, Sensitive *sensitive, const char *orighost,
1287 lowercase(host); 1287 lowercase(host);
1288 1288
1289 /* Exchange protocol version identification strings with the server. */ 1289 /* Exchange protocol version identification strings with the server. */
1290 if (kex_exchange_identification(ssh, timeout_ms, NULL) != 0) 1290 if (kex_exchange_identification(ssh, timeout_ms, 1, NULL) != 0)
1291 cleanup_exit(255); /* error already logged */ 1291 cleanup_exit(255); /* error already logged */
1292 1292
1293 /* Put the connection into non-blocking mode. */ 1293 /* Put the connection into non-blocking mode. */
diff --git a/sshd.c b/sshd.c
index e3e96426e..1e7ece588 100644
--- a/sshd.c
+++ b/sshd.c
@@ -2160,7 +2160,8 @@ main(int ac, char **av)
2160 if (!debug_flag) 2160 if (!debug_flag)
2161 alarm(options.login_grace_time); 2161 alarm(options.login_grace_time);
2162 2162
2163 if (kex_exchange_identification(ssh, -1, options.version_addendum) != 0) 2163 if (kex_exchange_identification(ssh, -1, options.debian_banner,
2164 options.version_addendum) != 0)
2164 cleanup_exit(255); /* error already logged */ 2165 cleanup_exit(255); /* error already logged */
2165 2166
2166 ssh_packet_set_nonblocking(ssh); 2167 ssh_packet_set_nonblocking(ssh);
diff --git a/sshd_config.5 b/sshd_config.5
index 2ef671d1b..addea54a0 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -543,6 +543,11 @@ or
543.Cm no . 543.Cm no .
544The default is 544The default is
545.Cm yes . 545.Cm yes .
546.It Cm DebianBanner
547Specifies whether the distribution-specified extra version suffix is
548included during initial protocol handshake.
549The default is
550.Cm yes .
546.It Cm DenyGroups 551.It Cm DenyGroups
547This keyword can be followed by a list of group name patterns, separated 552This keyword can be followed by a list of group name patterns, separated
548by spaces. 553by spaces.