summaryrefslogtreecommitdiff
path: root/debian/patches/package-versioning.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/package-versioning.patch')
-rw-r--r--debian/patches/package-versioning.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/debian/patches/package-versioning.patch b/debian/patches/package-versioning.patch
new file mode 100644
index 000000000..e2b40654c
--- /dev/null
+++ b/debian/patches/package-versioning.patch
@@ -0,0 +1,65 @@
1From 4e80e6a84e57783718ca225021a597713c44c2a2 Mon Sep 17 00:00:00 2001
2From: Matthew Vernon <matthew@debian.org>
3Date: Sun, 9 Feb 2014 16:10:05 +0000
4Subject: Include the Debian version in our identification
5
6This makes it easier to audit networks for versions patched against security
7vulnerabilities. It has little detrimental effect, as attackers will
8generally just try attacks rather than bothering to scan for
9vulnerable-looking version strings. (However, see debian-banner.patch.)
10
11Forwarded: not-needed
12Last-Update: 2013-09-14
13
14Patch-Name: package-versioning.patch
15---
16 sshconnect.c | 4 ++--
17 sshd.c | 2 +-
18 version.h | 7 ++++++-
19 3 files changed, 9 insertions(+), 4 deletions(-)
20
21diff --git a/sshconnect.c b/sshconnect.c
22index 4aff104..2999061 100644
23--- a/sshconnect.c
24+++ b/sshconnect.c
25@@ -524,10 +524,10 @@ send_client_banner(int connection_out, int minor1)
26 /* Send our own protocol version identification. */
27 if (compat20) {
28 xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
29- PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
30+ PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE);
31 } else {
32 xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n",
33- PROTOCOL_MAJOR_1, minor1, SSH_VERSION);
34+ PROTOCOL_MAJOR_1, minor1, SSH_RELEASE);
35 }
36 if (roaming_atomicio(vwrite, connection_out, client_version_string,
37 strlen(client_version_string)) != strlen(client_version_string))
38diff --git a/sshd.c b/sshd.c
39index f60c9e0..e3ac37b 100644
40--- a/sshd.c
41+++ b/sshd.c
42@@ -443,7 +443,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
43 }
44
45 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
46- major, minor, SSH_VERSION,
47+ major, minor, SSH_RELEASE,
48 *options.version_addendum == '\0' ? "" : " ",
49 options.version_addendum, newline);
50
51diff --git a/version.h b/version.h
52index 7a5dbc8..f665356 100644
53--- a/version.h
54+++ b/version.h
55@@ -3,4 +3,9 @@
56 #define SSH_VERSION "OpenSSH_7.0"
57
58 #define SSH_PORTABLE "p1"
59-#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
60+#define SSH_RELEASE_MINIMUM SSH_VERSION SSH_PORTABLE
61+#ifdef SSH_EXTRAVERSION
62+#define SSH_RELEASE SSH_RELEASE_MINIMUM " " SSH_EXTRAVERSION
63+#else
64+#define SSH_RELEASE SSH_RELEASE_MINIMUM
65+#endif