3f55133
diff -up openssh-7.0p1/configure.ac.vendor openssh-7.0p1/configure.ac
3f55133
--- openssh-7.0p1/configure.ac.vendor	2015-08-12 11:14:54.102628399 +0200
3f55133
+++ openssh-7.0p1/configure.ac	2015-08-12 11:14:54.129628356 +0200
3f55133
@@ -4776,6 +4776,12 @@ AC_ARG_WITH([lastlog],
47b1c9e
 		fi
47b1c9e
 	]
Jan F. Chadima 69dd72f
 )
Jan F. Chadima 69dd72f
+AC_ARG_ENABLE(vendor-patchlevel,
Jan F. Chadima 69dd72f
+  [  --enable-vendor-patchlevel=TAG  specify a vendor patch level],
Jan F. Chadima 69dd72f
+  [AC_DEFINE_UNQUOTED(SSH_VENDOR_PATCHLEVEL,[SSH_RELEASE "-" "$enableval"],[Define to your vendor patch level, if it has been modified from the upstream source release.])
Jan F. Chadima 69dd72f
+   SSH_VENDOR_PATCHLEVEL="$enableval"],
Jan F. Chadima 69dd72f
+  [AC_DEFINE(SSH_VENDOR_PATCHLEVEL,SSH_RELEASE,[Define to your vendor patch level, if it has been modified from the upstream source release.])
Jan F. Chadima 69dd72f
+   SSH_VENDOR_PATCHLEVEL=none])
47b1c9e
 
Jan F. Chadima 69dd72f
 dnl lastlog, [uw]tmpx? detection
Jan F. Chadima 69dd72f
 dnl  NOTE: set the paths in the platform section to avoid the
3f55133
@@ -5038,6 +5044,7 @@ echo "           Translate v4 in v6 hack
Jan F. Chadima 69dd72f
 echo "                  BSD Auth support: $BSD_AUTH_MSG"
Jan F. Chadima 69dd72f
 echo "              Random number source: $RAND_MSG"
Jan F. Chadima 69dd72f
 echo "             Privsep sandbox style: $SANDBOX_STYLE"
Jan F. Chadima 69dd72f
+echo "                Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
Jan F. Chadima 69dd72f
 
Jan F. Chadima 69dd72f
 echo ""
Jan F. Chadima 69dd72f
 
3f55133
diff -up openssh-7.0p1/servconf.c.vendor openssh-7.0p1/servconf.c
3f55133
--- openssh-7.0p1/servconf.c.vendor	2015-08-11 10:57:29.000000000 +0200
3f55133
+++ openssh-7.0p1/servconf.c	2015-08-12 11:15:33.201565712 +0200
3f55133
@@ -149,6 +149,7 @@ initialize_server_options(ServerOptions
Jan F. Chadima 69dd72f
 	options->max_authtries = -1;
Jan F. Chadima 69dd72f
 	options->max_sessions = -1;
Jan F. Chadima 69dd72f
 	options->banner = NULL;
Jan F. Chadima 69dd72f
+	options->show_patchlevel = -1;
Jan F. Chadima 69dd72f
 	options->use_dns = -1;
Jan F. Chadima 69dd72f
 	options->client_alive_interval = -1;
Jan F. Chadima 69dd72f
 	options->client_alive_count_max = -1;
535d341
@@ -335,6 +336,8 @@ fill_default_server_options(ServerOption
Jan F. Chadima 69dd72f
 		options->ip_qos_bulk = IPTOS_THROUGHPUT;
9fe1afc
 	if (options->version_addendum == NULL)
9fe1afc
 		options->version_addendum = xstrdup("");
Jan F. Chadima 69dd72f
+	if (options->show_patchlevel == -1)
9fe1afc
+		options->show_patchlevel = 0;
1900351
 	if (options->fwd_opts.streamlocal_bind_mask == (mode_t)-1)
1900351
 		options->fwd_opts.streamlocal_bind_mask = 0177;
1900351
 	if (options->fwd_opts.streamlocal_bind_unlink == -1)
3f55133
@@ -407,7 +410,7 @@ typedef enum {
Jan F. Chadima 69dd72f
 	sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
132f8f8
 	sGatewayPorts, sPubkeyAuthentication, sPubkeyAcceptedKeyTypes,
132f8f8
 	sXAuthLocation, sSubsystem, sMaxStartups, sMaxAuthTries, sMaxSessions,
Jan F. Chadima 69dd72f
-	sBanner, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima 69dd72f
+	sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
132f8f8
 	sHostbasedUsesNameFromPacketOnly, sHostbasedAcceptedKeyTypes,
3f55133
 	sHostKeyAlgorithms,
132f8f8
 	sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
3f55133
@@ -529,6 +532,7 @@ static struct {
Jan F. Chadima 69dd72f
 	{ "maxauthtries", sMaxAuthTries, SSHCFG_ALL },
Jan F. Chadima 69dd72f
 	{ "maxsessions", sMaxSessions, SSHCFG_ALL },
Jan F. Chadima 69dd72f
 	{ "banner", sBanner, SSHCFG_ALL },
Jan F. Chadima 69dd72f
+	{ "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72f
 	{ "usedns", sUseDNS, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72f
 	{ "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72f
 	{ "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
3f55133
@@ -1389,6 +1393,10 @@ process_server_config_line(ServerOptions
Jan F. Chadima 69dd72f
 		multistate_ptr = multistate_privsep;
Jan F. Chadima 69dd72f
 		goto parse_multistate;
Jan F. Chadima 69dd72f
 
Jan F. Chadima 69dd72f
+	case sShowPatchLevel:
Jan F. Chadima 69dd72f
+		intptr = &options->show_patchlevel;
Jan F. Chadima 69dd72f
+		goto parse_flag;
Jan F. Chadima 69dd72f
+
Jan F. Chadima 69dd72f
 	case sAllowUsers:
Jan F. Chadima 69dd72f
 		while ((arg = strdelim(&cp)) && *arg != '\0') {
Jan F. Chadima 69dd72f
 			if (options->num_allow_users >= MAX_ALLOW_USERS)
3f55133
@@ -2266,6 +2274,7 @@ dump_config(ServerOptions *o)
Jan F. Chadima 69dd72f
 	dump_cfg_fmtint(sUseLogin, o->use_login);
Jan F. Chadima 69dd72f
 	dump_cfg_fmtint(sCompression, o->compression);
1900351
 	dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports);
Jan F. Chadima 69dd72f
+	dump_cfg_fmtint(sShowPatchLevel, o->show_patchlevel);
Jan F. Chadima 69dd72f
 	dump_cfg_fmtint(sUseDNS, o->use_dns);
Jan F. Chadima 69dd72f
 	dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
535d341
 	dump_cfg_fmtint(sAllowAgentForwarding, o->allow_agent_forwarding);
3f55133
diff -up openssh-7.0p1/servconf.h.vendor openssh-7.0p1/servconf.h
3f55133
--- openssh-7.0p1/servconf.h.vendor	2015-08-11 10:57:29.000000000 +0200
3f55133
+++ openssh-7.0p1/servconf.h	2015-08-12 11:14:54.130628355 +0200
3f55133
@@ -155,6 +155,7 @@ typedef struct {
Jan F. Chadima 69dd72f
 	int	max_authtries;
Jan F. Chadima 69dd72f
 	int	max_sessions;
Jan F. Chadima 69dd72f
 	char   *banner;			/* SSH-2 banner message */
Jan F. Chadima 69dd72f
+	int	show_patchlevel;	/* Show vendor patch level to clients */
Jan F. Chadima 69dd72f
 	int	use_dns;
Jan F. Chadima 69dd72f
 	int	client_alive_interval;	/*
Jan F. Chadima 69dd72f
 					 * poke the client this often to
3f55133
diff -up openssh-7.0p1/sshd_config.0.vendor openssh-7.0p1/sshd_config.0
3f55133
--- openssh-7.0p1/sshd_config.0.vendor	2015-08-12 11:14:54.125628363 +0200
3f55133
+++ openssh-7.0p1/sshd_config.0	2015-08-12 11:14:54.130628355 +0200
3f55133
@@ -841,6 +841,11 @@ DESCRIPTION
Jan F. Chadima 69dd72f
              Defines the number of bits in the ephemeral protocol version 1
3f55133
              server key.  The default and minimum value is 1024.
Jan F. Chadima 69dd72f
 
Jan F. Chadima 69dd72f
+     ShowPatchLevel
Jan F. Chadima 69dd72f
+	     Specifies whether sshd will display the specific patch level of
Jan F. Chadima 69dd72f
+	     the binary in the server identification string.  The patch level
Jan F. Chadima 69dd72f
+	     is set at compile-time.  The default is M-bM-^@M-^\noM-bM-^@M-^].
Jan F. Chadima 69dd72f
+
1900351
      StreamLocalBindMask
1900351
              Sets the octal file creation mode mask (umask) used when creating
1900351
              a Unix-domain socket file for local or remote port forwarding.
3f55133
diff -up openssh-7.0p1/sshd_config.5.vendor openssh-7.0p1/sshd_config.5
3f55133
--- openssh-7.0p1/sshd_config.5.vendor	2015-08-12 11:14:54.125628363 +0200
3f55133
+++ openssh-7.0p1/sshd_config.5	2015-08-12 11:14:54.131628353 +0200
3f55133
@@ -1411,6 +1411,13 @@ This option applies to protocol version
Jan F. Chadima 69dd72f
 .It Cm ServerKeyBits
Jan F. Chadima 69dd72f
 Defines the number of bits in the ephemeral protocol version 1 server key.
3f55133
 The default and minimum value is 1024.
Jan F. Chadima 69dd72f
+.It Cm ShowPatchLevel 
Jan F. Chadima 69dd72f
+Specifies whether 
Jan F. Chadima 69dd72f
+.Nm sshd 
Jan F. Chadima 69dd72f
+will display the patch level of the binary in the identification string. 
Jan F. Chadima 69dd72f
+The patch level is set at compile-time. 
Jan F. Chadima 69dd72f
+The default is 
Jan F. Chadima 69dd72f
+.Dq no . 
1900351
 .It Cm StreamLocalBindMask
1900351
 Sets the octal file creation mode mask
1900351
 .Pq umask
3f55133
diff -up openssh-7.0p1/sshd_config.vendor openssh-7.0p1/sshd_config
3f55133
--- openssh-7.0p1/sshd_config.vendor	2015-08-12 11:14:54.125628363 +0200
3f55133
+++ openssh-7.0p1/sshd_config	2015-08-12 11:14:54.131628353 +0200
3f55133
@@ -119,6 +119,7 @@ UsePrivilegeSeparation sandbox		# Defaul
3f55133
 #Compression delayed
3f55133
 #ClientAliveInterval 0
3f55133
 #ClientAliveCountMax 3
3f55133
+#ShowPatchLevel no
3f55133
 #UseDNS no
3f55133
 #PidFile /var/run/sshd.pid
3f55133
 #MaxStartups 10:30:100
3f55133
diff -up openssh-7.0p1/sshd.c.vendor openssh-7.0p1/sshd.c
3f55133
--- openssh-7.0p1/sshd.c.vendor	2015-08-12 11:14:54.100628403 +0200
3f55133
+++ openssh-7.0p1/sshd.c	2015-08-12 11:14:54.131628353 +0200
3f55133
@@ -432,7 +432,7 @@ sshd_exchange_identification(int sock_in
3f55133
 	}
3f55133
 
3f55133
 	xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
3f55133
-	    major, minor, SSH_VERSION,
3f55133
+	    major, minor, (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
3f55133
 	    *options.version_addendum == '\0' ? "" : " ",
3f55133
 	    options.version_addendum, newline);
3f55133
 
3f55133
@@ -1749,7 +1749,8 @@ main(int ac, char **av)
3f55133
 		exit(1);
3f55133
 	}
3f55133
 
3f55133
-	debug("sshd version %s, %s", SSH_VERSION,
3f55133
+	debug("sshd version %s, %s", 
3f55133
+		(options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
3f55133
 #ifdef WITH_OPENSSL
3f55133
 	    SSLeay_version(SSLEAY_VERSION)
3f55133
 #else