Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openssh/files/, net-misc/openssh/
Date: Sun, 03 Mar 2019 14:32:39
Message-Id: 1551623545.9d94101585a6991d03d1ef98226d315406d8bf06.polynomial-c@gentoo
1 commit: 9d94101585a6991d03d1ef98226d315406d8bf06
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 3 14:32:25 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 14:32:25 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d941015
7
8 net-misc/openssh: Removed old.
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 net-misc/openssh/Manifest | 4 -
14 .../files/openssh-7.8_p1-X509-no-version.patch | 19 -
15 .../files/openssh-7.8_p1-hpn-X509-glue.patch | 79 ----
16 .../openssh/files/openssh-7.8_p1-hpn-glue.patch | 112 -----
17 .../files/openssh-7.8_p1-hpn-sctp-glue.patch | 17 -
18 net-misc/openssh/openssh-7.8_p1.ebuild | 438 --------------------
19 net-misc/openssh/openssh-7.9_p1-r1.ebuild | 450 ---------------------
20 net-misc/openssh/openssh-7.9_p1.ebuild | 450 ---------------------
21 8 files changed, 1569 deletions(-)
22
23 diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest
24 index 42d69025fbd..11a121a2939 100644
25 --- a/net-misc/openssh/Manifest
26 +++ b/net-misc/openssh/Manifest
27 @@ -7,10 +7,6 @@ DIST openssh-7.7p1-patches-1.2.tar.xz 17584 BLAKE2B 192ec01906c911197abec4606cdf
28 DIST openssh-7.7p1-sctp-1.1.patch.xz 7548 BLAKE2B 3b960c2377351955007005de560c2a3e8d0d059a0435e5beda14c63e444dad8b4357edaccd1cfe446c6268514f152b2bcfa7fa3612f1ae1324a31fecb0e85ac5 SHA512 093605865262a2b972db8c92990a49ed6178ed4567fb2626518c826c8472553d9be99a9e6052a6f5e545d81867b4118e9fd8a2c0c26a2739f1720b0f13282cba
29 DIST openssh-7.7p1-x509-11.3.1.patch.xz 362672 BLAKE2B 55b8b0ef00dc4d962a0db1115406b7b1e84110870c74198e9e4cb081b2ffde8daca67cb281c69d73b4c5cbffde361429d62634be194b57e888a0b434a0f42a37 SHA512 f84744f6d2e5a15017bce37bfa65ebb47dbafeac07ea9aab46bdc780b4062ff70687512d9d512cab81e3b9c701adb6ce17c5474f35cb4b49f57db2e2d45ac9ac
30 DIST openssh-7.7p1.tar.gz 1536900 BLAKE2B 7aee360f2cea5bfa3f8426fcbd66fde2568f05f9c8e623326b60f03b7c5f8abf223e178aa1d5958015b51627565bf5b1ace35b57f309638c908f5a7bf5500d21 SHA512 597252cb48209a0cb98ca1928a67e8d63e4275252f25bc37269204c108f034baade6ba0634e32ae63422fddd280f73096a6b31ad2f2e7a848dde75ca30e14261
31 -DIST openssh-7.8p1+x509-11.4.diff.gz 536597 BLAKE2B 18593135d0d4010f40a6e0c99a6a2e9fb4ca98d00b4940be5cb547fcb647adc9663245274d4e792bcc7c2ec49accaceb7c3c489707bbb7aaeed260dd2e0eb1c3 SHA512 b95d46201626797f197c5aa8488b0543d2c7c5719b99fadd94ef2c888a96c6a7b649527b78b6d6014d953ae57e05ecf116192cf498687db8cb7669c3998deecc
32 -DIST openssh-7.8p1-sctp-1.1.patch.xz 7548 BLAKE2B d74010028f097812f554f9e788aa5e46d75c12edbef18aaeaa9866665025bdad04a1a028cc862d11d718208c1b63862780840332536a535bb2eaff7661c966ef SHA512 c084f6b2cfa9cb70f46ecc9edfce6e2843cd4cd5e36ac870f5ceaaedd056ba9aa2ce8769418239ad0fe5e7350573397a222b6525a029f4492feb7b144ee22aa3
33 -DIST openssh-7.8p1.tar.gz 1548026 BLAKE2B 938428408596d24d497f245e3662a0cff3d462645683bf75cd29a0ea56fa6c280e7fa866bedf0928dd5bc4085b82d5a4ce74b7eea0b45b86f879b69f74db1642 SHA512 8e5b0c8682a9243e4e8b7c374ec989dccd1a752eb6f84e593b67141e8b23dcc8b9a7322b1f7525d18e2ce8830a767d0d9793f997486339db201a57986b910705
34 -DIST openssh-7.9p1+x509-11.5.diff.gz 594995 BLAKE2B 2c44df224e4114da0473cbbdfdcc4bd84b0b0235f80b43517d70fe1071f219d2631f784015ab1470eebcf8f3b6b5f8744862acebb22f217c6e76f79e6a49c099 SHA512 4d2fd950dee9721add822fdb54ff8c20fd18da85081ce8a2bd2a1050d3ff7900a7213782c479691de9dcfe4e2f91061e124d34b365edb3831e8bfe4aef3744f9
35 DIST openssh-7.9p1+x509-11.6.diff.gz 655819 BLAKE2B f442bb993f89782b74b0cd28906c91edfcf5b1d42a4c8135a5ccf5045e7eb000eb7aa301685b748f707506ba20e3b842d684db436872ed82b6d9b9c086879515 SHA512 0ff6ed2822aaa43cf352134b90975fb663662c5ea3d73b690601f24342ea207aecda8cdb9c1bdc3e3656fb059d842dfb3bf22646b626c303240808286103d8bc
36 DIST openssh-7.9p1-patches-1.0.tar.xz 9080 BLAKE2B c14106a875b6ea0672a03f6cb292386daba96da23fed4ebd04a75f712e252bc88a25116b0b3b27446421aadf112451cb3b8a96d2f7d437e6728fe782190bc69e SHA512 7903cdb4ce5be0f1b1b741788fb372e68b0c9c1d6da0d854d8bc62e4743ad7cd13101b867b541828d3786b0857783377457e5e87ba9b63bfd9afcdbfd93ac103
37 DIST openssh-7.9p1-sctp-1.1.patch.xz 7552 BLAKE2B 0eeda7c8a50c0c98433b5ee0734b9f79043067be376a9ca724d574d4a595c3f7aed0626342300467b73ad9003392e22fda8abe778158ba5be5a50a57eeef79f8 SHA512 6cad32c40dd3901c4eadb0c463a35ec2d901e61220c333d3df7759f672259f66fc83e2b1ace8b0ef84cbc1a65397f00f9c670ffa23726d8309fa5060512d2c21
38
39 diff --git a/net-misc/openssh/files/openssh-7.8_p1-X509-no-version.patch b/net-misc/openssh/files/openssh-7.8_p1-X509-no-version.patch
40 deleted file mode 100644
41 index 66641c27473..00000000000
42 --- a/net-misc/openssh/files/openssh-7.8_p1-X509-no-version.patch
43 +++ /dev/null
44 @@ -1,19 +0,0 @@
45 ---- a/openssh-7.8p1+x509-11.4.diff 2018-08-24 14:55:19.153936872 -0700
46 -+++ b/openssh-7.8p1+x509-11.4.diff 2018-08-24 14:55:58.116677254 -0700
47 -@@ -63643,16 +63643,6 @@
48 - setlocale(LC_CTYPE, "POSIX.UTF-8") != NULL))
49 - return;
50 - setlocale(LC_CTYPE, "C");
51 --diff -ruN openssh-7.8p1/version.h openssh-7.8p1+x509-11.4/version.h
52 ----- openssh-7.8p1/version.h 2018-08-23 08:41:42.000000000 +0300
53 --+++ openssh-7.8p1+x509-11.4/version.h 2018-08-24 20:07:00.000000000 +0300
54 --@@ -2,5 +2,4 @@
55 --
56 -- #define SSH_VERSION "OpenSSH_7.8"
57 --
58 ---#define SSH_PORTABLE "p1"
59 ---#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
60 --+#define SSH_RELEASE PACKAGE_STRING ", " SSH_VERSION "p1"
61 - diff -ruN openssh-7.8p1/version.m4 openssh-7.8p1+x509-11.4/version.m4
62 - --- openssh-7.8p1/version.m4 1970-01-01 02:00:00.000000000 +0200
63 - +++ openssh-7.8p1+x509-11.4/version.m4 2018-08-24 20:00:00.000000000 +0300
64
65 diff --git a/net-misc/openssh/files/openssh-7.8_p1-hpn-X509-glue.patch b/net-misc/openssh/files/openssh-7.8_p1-hpn-X509-glue.patch
66 deleted file mode 100644
67 index c76d454c92f..00000000000
68 --- a/net-misc/openssh/files/openssh-7.8_p1-hpn-X509-glue.patch
69 +++ /dev/null
70 @@ -1,79 +0,0 @@
71 ---- temp/openssh-7_8_P1-hpn-AES-CTR-14.16.diff.orig 2018-09-12 15:58:57.377986085 -0700
72 -+++ temp/openssh-7_8_P1-hpn-AES-CTR-14.16.diff 2018-09-12 16:07:15.376711327 -0700
73 -@@ -4,8 +4,8 @@
74 - +++ b/Makefile.in
75 - @@ -42,7 +42,7 @@ CC=@CC@
76 - LD=@LD@
77 -- CFLAGS=@CFLAGS@
78 -- CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
79 -+ CFLAGS=@CFLAGS@ $(CFLAGS_EXTRA)
80 -+ CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ @LDAP_CPPFLAGS@ $(PATHS) @DEFS@
81 - -LIBS=@LIBS@
82 - +LIBS=@LIBS@ -lpthread
83 - K5LIBS=@K5LIBS@
84 -@@ -788,8 +788,8 @@
85 - ssh_packet_set_connection(struct ssh *ssh, int fd_in, int fd_out)
86 - {
87 - struct session_state *state;
88 --- const struct sshcipher *none = cipher_by_name("none");
89 --+ struct sshcipher *none = cipher_by_name("none");
90 -+- const struct sshcipher *none = cipher_none();
91 -++ struct sshcipher *none = cipher_none();
92 - int r;
93 -
94 - if (none == NULL) {
95 -@@ -933,9 +933,9 @@
96 - /* Portable-specific options */
97 - sUsePAM,
98 - + sDisableMTAES,
99 -- /* Standard Options */
100 -- sPort, sHostKeyFile, sLoginGraceTime,
101 -- sPermitRootLogin, sLogFacility, sLogLevel,
102 -+ /* X.509 Standard Options */
103 -+ sHostbasedAlgorithms,
104 -+ sPubkeyAlgorithms,
105 - @@ -626,6 +630,7 @@ static struct {
106 - { "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL },
107 - { "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
108 ---- temp/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff.orig 2018-09-12 16:38:16.947447218 -0700
109 -+++ temp/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff 2018-09-12 16:32:35.479700864 -0700
110 -@@ -382,7 +382,7 @@
111 - @@ -822,6 +822,10 @@ kex_choose_conf(struct ssh *ssh)
112 - int nenc, nmac, ncomp;
113 - u_int mode, ctos, need, dh_need, authlen;
114 -- int r, first_kex_follows;
115 -+ int r, first_kex_follows = 0;
116 - + int auth_flag;
117 - +
118 - + auth_flag = packet_authentication_state(ssh);
119 -@@ -1125,15 +1125,6 @@
120 - index a738c3a..b32dbe0 100644
121 - --- a/sshd.c
122 - +++ b/sshd.c
123 --@@ -373,7 +373,7 @@ sshd_exchange_identification(struct ssh *ssh, int sock_in, int sock_out)
124 -- char remote_version[256]; /* Must be at least as big as buf. */
125 --
126 -- xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s\r\n",
127 --- PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION,
128 --+ PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE,
129 -- *options.version_addendum == '\0' ? "" : " ",
130 -- options.version_addendum);
131 --
132 - @@ -1037,6 +1037,8 @@ listen_on_addrs(struct listenaddr *la)
133 - int ret, listen_sock;
134 - struct addrinfo *ai;
135 -@@ -1213,14 +1204,3 @@
136 - # Example of overriding settings on a per-user basis
137 - #Match User anoncvs
138 - # X11Forwarding no
139 --diff --git a/version.h b/version.h
140 --index f1bbf00..21a70c2 100644
141 ----- a/version.h
142 --+++ b/version.h
143 --@@ -3,4 +3,5 @@
144 -- #define SSH_VERSION "OpenSSH_7.8"
145 --
146 -- #define SSH_PORTABLE "p1"
147 ---#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
148 --+#define SSH_RELEASE SSH_VERSION SSH_PORTABLE SSH_HPN
149 --+
150
151 diff --git a/net-misc/openssh/files/openssh-7.8_p1-hpn-glue.patch b/net-misc/openssh/files/openssh-7.8_p1-hpn-glue.patch
152 deleted file mode 100644
153 index 0561e381406..00000000000
154 --- a/net-misc/openssh/files/openssh-7.8_p1-hpn-glue.patch
155 +++ /dev/null
156 @@ -1,112 +0,0 @@
157 ---- temp/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff.orig 2018-09-11 17:19:19.968420409 -0700
158 -+++ temp/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff 2018-09-11 17:39:19.977535398 -0700
159 -@@ -409,18 +409,10 @@
160 - index dcf35e6..da4ced0 100644
161 - --- a/packet.c
162 - +++ b/packet.c
163 --@@ -920,6 +920,24 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
164 -+@@ -920,6 +920,16 @@ ssh_set_newkeys(struct ssh *ssh, int mode)
165 - return 0;
166 - }
167 -
168 --+/* this supports the forced rekeying required for the NONE cipher */
169 --+int rekey_requested = 0;
170 --+void
171 --+packet_request_rekeying(void)
172 --+{
173 --+ rekey_requested = 1;
174 --+}
175 --+
176 - +/* used to determine if pre or post auth when rekeying for aes-ctr
177 - + * and none cipher switch */
178 - +int
179 -@@ -434,20 +426,6 @@
180 - #define MAX_PACKETS (1U<<31)
181 - static int
182 - ssh_packet_need_rekeying(struct ssh *ssh, u_int outbound_packet_len)
183 --@@ -946,6 +964,13 @@ ssh_packet_need_rekeying(struct ssh *ssh, u_int outbound_packet_len)
184 -- if (state->p_send.packets == 0 && state->p_read.packets == 0)
185 -- return 0;
186 --
187 --+ /* used to force rekeying when called for by the none
188 --+ * cipher switch methods -cjr */
189 --+ if (rekey_requested == 1) {
190 --+ rekey_requested = 0;
191 --+ return 1;
192 --+ }
193 --+
194 -- /* Time-based rekeying */
195 -- if (state->rekey_interval != 0 &&
196 -- (int64_t)state->rekey_time + state->rekey_interval <= monotime())
197 - diff --git a/packet.h b/packet.h
198 - index 170203c..f4d9df2 100644
199 - --- a/packet.h
200 -@@ -476,9 +454,9 @@
201 - /* Format of the configuration file:
202 -
203 - @@ -166,6 +167,8 @@ typedef enum {
204 -- oHashKnownHosts,
205 - oTunnel, oTunnelDevice,
206 - oLocalCommand, oPermitLocalCommand, oRemoteCommand,
207 -+ oDisableMTAES,
208 - + oTcpRcvBufPoll, oTcpRcvBuf, oHPNDisabled, oHPNBufferSize,
209 - + oNoneEnabled, oNoneSwitch,
210 - oVisualHostKey,
211 -@@ -615,9 +593,9 @@
212 - int ip_qos_bulk; /* IP ToS/DSCP/class for bulk traffic */
213 - SyslogFacility log_facility; /* Facility for system logging. */
214 - @@ -111,7 +115,10 @@ typedef struct {
215 --
216 - int enable_ssh_keysign;
217 - int64_t rekey_limit;
218 -+ int disable_multithreaded; /*disable multithreaded aes-ctr*/
219 - + int none_switch; /* Use none cipher */
220 - + int none_enabled; /* Allow none to be used */
221 - int rekey_interval;
222 -@@ -673,9 +651,9 @@
223 - /* Portable-specific options */
224 - if (options->use_pam == -1)
225 - @@ -391,6 +400,43 @@ fill_default_server_options(ServerOptions *options)
226 -- }
227 -- if (options->permit_tun == -1)
228 - options->permit_tun = SSH_TUNMODE_NO;
229 -+ if (options->disable_multithreaded == -1)
230 -+ options->disable_multithreaded = 0;
231 - + if (options->none_enabled == -1)
232 - + options->none_enabled = 0;
233 - + if (options->hpn_disabled == -1)
234 -@@ -1092,7 +1070,7 @@
235 - xxx_host = host;
236 - xxx_hostaddr = hostaddr;
237 -
238 --@@ -412,6 +423,28 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
239 -+@@ -412,6 +423,27 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
240 -
241 - if (!authctxt.success)
242 - fatal("Authentication failed.");
243 -@@ -1117,10 +1095,9 @@
244 - + fprintf(stderr, "NONE cipher switch disabled when a TTY is allocated\n");
245 - + }
246 - + }
247 --+
248 -- debug("Authentication succeeded (%s).", authctxt.method->name);
249 -- }
250 -
251 -+ #ifdef WITH_OPENSSL
252 -+ if (options.disable_multithreaded == 0) {
253 - diff --git a/sshd.c b/sshd.c
254 - index a738c3a..b32dbe0 100644
255 - --- a/sshd.c
256 -@@ -1217,11 +1194,10 @@
257 - index f1bbf00..21a70c2 100644
258 - --- a/version.h
259 - +++ b/version.h
260 --@@ -3,4 +3,6 @@
261 -+@@ -3,4 +3,5 @@
262 - #define SSH_VERSION "OpenSSH_7.8"
263 -
264 - #define SSH_PORTABLE "p1"
265 - -#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
266 --+#define SSH_HPN "-hpn14v16"
267 - +#define SSH_RELEASE SSH_VERSION SSH_PORTABLE SSH_HPN
268 - +
269
270 diff --git a/net-misc/openssh/files/openssh-7.8_p1-hpn-sctp-glue.patch b/net-misc/openssh/files/openssh-7.8_p1-hpn-sctp-glue.patch
271 deleted file mode 100644
272 index a7d51ad9483..00000000000
273 --- a/net-misc/openssh/files/openssh-7.8_p1-hpn-sctp-glue.patch
274 +++ /dev/null
275 @@ -1,17 +0,0 @@
276 ---- dd/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff.orig 2018-09-12 18:18:51.851536374 -0700
277 -+++ dd/openssh-7_8_P1-hpn-DynWinNoneSwitch-14.16.diff 2018-09-12 18:19:01.116475099 -0700
278 -@@ -1190,14 +1190,3 @@
279 - # Example of overriding settings on a per-user basis
280 - #Match User anoncvs
281 - # X11Forwarding no
282 --diff --git a/version.h b/version.h
283 --index f1bbf00..21a70c2 100644
284 ----- a/version.h
285 --+++ b/version.h
286 --@@ -3,4 +3,5 @@
287 -- #define SSH_VERSION "OpenSSH_7.8"
288 --
289 -- #define SSH_PORTABLE "p1"
290 ---#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
291 --+#define SSH_RELEASE SSH_VERSION SSH_PORTABLE SSH_HPN
292 --+
293
294 diff --git a/net-misc/openssh/openssh-7.8_p1.ebuild b/net-misc/openssh/openssh-7.8_p1.ebuild
295 deleted file mode 100644
296 index 3ce6916d6e9..00000000000
297 --- a/net-misc/openssh/openssh-7.8_p1.ebuild
298 +++ /dev/null
299 @@ -1,438 +0,0 @@
300 -# Copyright 1999-2018 Gentoo Foundation
301 -# Distributed under the terms of the GNU General Public License v2
302 -
303 -EAPI=6
304 -
305 -inherit user flag-o-matic multilib autotools pam systemd
306 -
307 -# Make it more portable between straight releases
308 -# and _p? releases.
309 -PARCH=${P/_}
310 -CAP_PV="${PV^^}"
311 -
312 -HPN_VER="14.16"
313 -HPN_PATCHES=(
314 - ${PN}-${CAP_PV/./_}-hpn-DynWinNoneSwitch-${HPN_VER}.diff
315 - ${PN}-${CAP_PV/./_}-hpn-AES-CTR-${HPN_VER}.diff
316 -)
317 -HPN_DISABLE_MTAES=1 # unit tests hang on MT-AES-CTR
318 -SCTP_VER="1.1" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
319 -X509_VER="11.4" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
320 -
321 -DESCRIPTION="Port of OpenBSD's free SSH release"
322 -HOMEPAGE="https://www.openssh.com/"
323 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
324 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~chutzpah/dist/openssh/${SCTP_PATCH} )}
325 - ${HPN_VER:+hpn? ( $(printf "mirror://sourceforge/hpnssh/HPN-SSH%%20${HPN_VER/./v}%%20${PV/_}/%s\n" "${HPN_PATCHES[@]}") )}
326 - ${X509_PATCH:+X509? ( https://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
327 - "
328 -
329 -LICENSE="BSD GPL-2"
330 -SLOT="0"
331 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
332 -# Probably want to drop ssl defaulting to on in a future version.
333 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldns libedit libressl livecd pam +pie sctp selinux +ssl static test X X509"
334 -RESTRICT="!test? ( test )"
335 -REQUIRED_USE="ldns? ( ssl )
336 - pie? ( !static )
337 - static? ( !kerberos !pam )
338 - X509? ( !sctp ssl )
339 - test? ( ssl )"
340 -
341 -LIB_DEPEND="
342 - audit? ( sys-process/audit[static-libs(+)] )
343 - ldns? (
344 - net-libs/ldns[static-libs(+)]
345 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
346 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
347 - )
348 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
349 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
350 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
351 - ssl? (
352 - !libressl? (
353 - >=dev-libs/openssl-1.0.1:0=[bindist=]
354 - dev-libs/openssl:0=[static-libs(+)]
355 - )
356 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
357 - )
358 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
359 -RDEPEND="
360 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
361 - pam? ( virtual/pam )
362 - kerberos? ( virtual/krb5 )"
363 -DEPEND="${RDEPEND}
364 - static? ( ${LIB_DEPEND} )
365 - virtual/pkgconfig
366 - virtual/os-headers
367 - sys-devel/autoconf"
368 -RDEPEND="${RDEPEND}
369 - pam? ( >=sys-auth/pambase-20081028 )
370 - userland_GNU? ( virtual/shadow )
371 - X? ( x11-apps/xauth )"
372 -
373 -S="${WORKDIR}/${PARCH}"
374 -
375 -pkg_pretend() {
376 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
377 - # than not be able to log in to their server any more
378 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
379 - local fail="
380 - $(use hpn && maybe_fail hpn HPN_VER)
381 - $(use sctp && maybe_fail sctp SCTP_PATCH)
382 - $(use X509 && maybe_fail X509 X509_PATCH)
383 - "
384 - fail=$(echo ${fail})
385 - if [[ -n ${fail} ]] ; then
386 - eerror "Sorry, but this version does not yet support features"
387 - eerror "that you requested: ${fail}"
388 - eerror "Please mask ${PF} for now and check back later:"
389 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
390 - die "booooo"
391 - fi
392 -
393 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
394 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
395 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
396 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
397 - fi
398 -}
399 -
400 -src_prepare() {
401 - sed -i \
402 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
403 - pathnames.h || die
404 -
405 - # don't break .ssh/authorized_keys2 for fun
406 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
407 -
408 - eapply "${FILESDIR}"/${PN}-7.8_p1-GSSAPI-dns.patch #165444 integrated into gsskex
409 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
410 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
411 -
412 - local PATCHSET_VERSION_MACROS=()
413 -
414 - if use X509 ; then
415 - pushd "${WORKDIR}" || die
416 - eapply "${FILESDIR}/${P}-X509-no-version.patch"
417 - popd || die
418 -
419 - eapply "${WORKDIR}"/${X509_PATCH%.*}
420 -
421 - # We need to patch package version or any X.509 sshd will reject our ssh client
422 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
423 - # error
424 - einfo "Patching package version for X.509 patch set ..."
425 - sed -i \
426 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
427 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
428 -
429 - einfo "Patching version.h to expose X.509 patch set ..."
430 - sed -i \
431 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
432 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
433 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
434 - fi
435 -
436 - if use sctp ; then
437 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
438 -
439 - einfo "Patching version.h to expose SCTP patch set ..."
440 - sed -i \
441 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
442 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
443 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
444 -
445 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
446 - sed -i \
447 - -e "/\t\tcfgparse \\\/d" \
448 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
449 - fi
450 -
451 - if use hpn ; then
452 - local hpn_patchdir="${T}/${P}-hpn${HPN_VER}"
453 - mkdir "${hpn_patchdir}"
454 - cp $(printf -- "${DISTDIR}/%s\n" "${HPN_PATCHES[@]}") "${hpn_patchdir}"
455 - pushd "${hpn_patchdir}"
456 - eapply "${FILESDIR}"/${P}-hpn-glue.patch
457 - use X509 && eapply "${FILESDIR}"/${P}-hpn-X509-glue.patch
458 - use sctp && eapply "${FILESDIR}"/${P}-hpn-sctp-glue.patch
459 - popd
460 -
461 - eapply "${hpn_patchdir}"
462 -
463 - einfo "Patching Makefile.in for HPN patch set ..."
464 - sed -i \
465 - -e "/^LIBS=/ s/\$/ -lpthread/" \
466 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
467 -
468 - einfo "Patching version.h to expose HPN patch set ..."
469 - sed -i \
470 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER//./v}\"" \
471 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
472 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
473 -
474 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
475 - einfo "Disabling known non-working MT AES cipher per default ..."
476 -
477 - cat > "${T}"/disable_mtaes.conf <<- EOF
478 -
479 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
480 - # and therefore disabled per default.
481 - DisableMTAES yes
482 - EOF
483 - sed -i \
484 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
485 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
486 -
487 - sed -i \
488 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
489 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
490 - fi
491 - fi
492 -
493 - if use X509 || use sctp || use hpn ; then
494 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
495 - sed -i \
496 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
497 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
498 -
499 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
500 - sed -i \
501 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
502 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
503 -
504 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
505 - sed -i \
506 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
507 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
508 - fi
509 -
510 - sed -i \
511 - -e "/#UseLogin no/d" \
512 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
513 -
514 - [[ -d ${WORKDIR}/patch ]] && eapply "${WORKDIR}"/patch
515 -
516 - eapply_user #473004
517 -
518 - tc-export PKG_CONFIG
519 - local sed_args=(
520 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
521 - # Disable PATH reset, trust what portage gives us #254615
522 - -e 's:^PATH=/:#PATH=/:'
523 - # Disable fortify flags ... our gcc does this for us
524 - -e 's:-D_FORTIFY_SOURCE=2::'
525 - )
526 -
527 - # The -ftrapv flag ICEs on hppa #505182
528 - use hppa && sed_args+=(
529 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
530 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
531 - )
532 - # _XOPEN_SOURCE causes header conflicts on Solaris
533 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
534 - -e 's/-D_XOPEN_SOURCE//'
535 - )
536 - sed -i "${sed_args[@]}" configure{.ac,} || die
537 -
538 - eautoreconf
539 -}
540 -
541 -src_configure() {
542 - addwrite /dev/ptmx
543 -
544 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
545 - use static && append-ldflags -static
546 -
547 - local myconf=(
548 - --with-ldflags="${LDFLAGS}"
549 - --disable-strip
550 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
551 - --sysconfdir="${EPREFIX%/}"/etc/ssh
552 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
553 - --datadir="${EPREFIX%/}"/usr/share/openssh
554 - --with-privsep-path="${EPREFIX%/}"/var/empty
555 - --with-privsep-user=sshd
556 - $(use_with audit audit linux)
557 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
558 - # We apply the sctp patch conditionally, so can't pass --without-sctp
559 - # unconditionally else we get unknown flag warnings.
560 - $(use sctp && use_with sctp)
561 - $(use_with ldns)
562 - $(use_with libedit)
563 - $(use_with pam)
564 - $(use_with pie)
565 - $(use_with selinux)
566 - $(use_with ssl openssl)
567 - $(use_with ssl md5-passwords)
568 - $(use_with ssl ssl-engine)
569 - $(use_with !elibc_Cygwin hardening) #659210
570 - )
571 -
572 - # stackprotect is broken on musl x86
573 - use elibc_musl && use x86 && myconf+=( --without-stackprotect )
574 -
575 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
576 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
577 -
578 - econf "${myconf[@]}"
579 -}
580 -
581 -src_test() {
582 - local t skipped=() failed=() passed=()
583 - local tests=( interop-tests compat-tests )
584 -
585 - local shell=$(egetshell "${UID}")
586 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
587 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
588 - elog "user, so we will run a subset only."
589 - skipped+=( tests )
590 - else
591 - tests+=( tests )
592 - fi
593 -
594 - # It will also attempt to write to the homedir .ssh.
595 - local sshhome=${T}/homedir
596 - mkdir -p "${sshhome}"/.ssh
597 - for t in "${tests[@]}" ; do
598 - # Some tests read from stdin ...
599 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
600 - emake -k -j1 ${t} </dev/null \
601 - && passed+=( "${t}" ) \
602 - || failed+=( "${t}" )
603 - done
604 -
605 - einfo "Passed tests: ${passed[*]}"
606 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
607 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
608 -}
609 -
610 -# Gentoo tweaks to default config files.
611 -tweak_ssh_configs() {
612 - local locale_vars=(
613 - # These are language variables that POSIX defines.
614 - # http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
615 - LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
616 -
617 - # These are the GNU extensions.
618 - # https://www.gnu.org/software/autoconf/manual/html_node/Special-Shell-Variables.html
619 - LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
620 - )
621 -
622 - # First the server config.
623 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
624 -
625 - # Allow client to pass locale environment variables. #367017
626 - AcceptEnv ${locale_vars[*]}
627 -
628 - # Allow client to pass COLORTERM to match TERM. #658540
629 - AcceptEnv COLORTERM
630 - EOF
631 -
632 - # Then the client config.
633 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
634 -
635 - # Send locale environment variables. #367017
636 - SendEnv ${locale_vars[*]}
637 -
638 - # Send COLORTERM to match TERM. #658540
639 - SendEnv COLORTERM
640 - EOF
641 -
642 - if use pam ; then
643 - sed -i \
644 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
645 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
646 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
647 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
648 - "${ED%/}"/etc/ssh/sshd_config || die
649 - fi
650 -
651 - if use livecd ; then
652 - sed -i \
653 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
654 - "${ED%/}"/etc/ssh/sshd_config || die
655 - fi
656 -}
657 -
658 -src_install() {
659 - emake install-nokeys DESTDIR="${D}"
660 - fperms 600 /etc/ssh/sshd_config
661 - dobin contrib/ssh-copy-id
662 - newinitd "${FILESDIR}"/sshd.initd sshd
663 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
664 -
665 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
666 -
667 - tweak_ssh_configs
668 -
669 - doman contrib/ssh-copy-id.1
670 - dodoc CREDITS OVERVIEW README* TODO sshd_config
671 - use hpn && dodoc HPN-README
672 - use X509 || dodoc ChangeLog
673 -
674 - diropts -m 0700
675 - dodir /etc/skel/.ssh
676 -
677 - keepdir /var/empty
678 -
679 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
680 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
681 -}
682 -
683 -pkg_preinst() {
684 - enewgroup sshd 22
685 - enewuser sshd 22 -1 /var/empty sshd
686 -}
687 -
688 -pkg_postinst() {
689 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
690 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
691 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
692 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
693 - fi
694 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
695 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
696 - elog "Make sure to update any configs that you might have. Note that xinetd might"
697 - elog "be an alternative for you as it supports USE=tcpd."
698 - fi
699 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
700 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
701 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
702 - elog "adding to your sshd_config or ~/.ssh/config files:"
703 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
704 - elog "You should however generate new keys using rsa or ed25519."
705 -
706 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
707 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
708 - elog "out of the box. If you need this, please update your sshd_config explicitly."
709 - fi
710 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
711 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
712 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
713 - fi
714 - if has_version "<${CATEGORY}/${PN}-7.7_p1" ; then
715 - elog "Starting with openssh-7.7p1, we no longer patch openssh to provide LDAP functionality."
716 - elog "Install sys-auth/ssh-ldap-pubkey and use OpenSSH's \"AuthorizedKeysCommand\" option"
717 - elog "if you need to authenticate against LDAP."
718 - elog "See https://wiki.gentoo.org/wiki/SSH/LDAP_migration for more details."
719 - fi
720 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
721 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
722 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
723 - elog "and update all clients/servers that utilize them."
724 - fi
725 -
726 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
727 - elog ""
728 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
729 - elog "and therefore disabled at runtime per default."
730 - elog "Make sure your sshd_config is up to date and contains"
731 - elog ""
732 - elog " DisableMTAES yes"
733 - elog ""
734 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
735 - elog ""
736 - fi
737 -}
738
739 diff --git a/net-misc/openssh/openssh-7.9_p1-r1.ebuild b/net-misc/openssh/openssh-7.9_p1-r1.ebuild
740 deleted file mode 100644
741 index af3fd632c5f..00000000000
742 --- a/net-misc/openssh/openssh-7.9_p1-r1.ebuild
743 +++ /dev/null
744 @@ -1,450 +0,0 @@
745 -# Copyright 1999-2018 Gentoo Authors
746 -# Distributed under the terms of the GNU General Public License v2
747 -
748 -EAPI=6
749 -
750 -inherit user flag-o-matic multilib autotools pam systemd
751 -
752 -# Make it more portable between straight releases
753 -# and _p? releases.
754 -PARCH=${P/_}
755 -#HPN_PV="${PV^^}"
756 -HPN_PV="7.8_P1"
757 -
758 -HPN_VER="14.16"
759 -HPN_PATCHES=(
760 - ${PN}-${HPN_PV/./_}-hpn-DynWinNoneSwitch-${HPN_VER}.diff
761 - ${PN}-${HPN_PV/./_}-hpn-AES-CTR-${HPN_VER}.diff
762 -)
763 -HPN_DISABLE_MTAES=1 # unit tests hang on MT-AES-CTR
764 -SCTP_VER="1.1" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
765 -X509_VER="11.6" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
766 -
767 -DESCRIPTION="Port of OpenBSD's free SSH release"
768 -HOMEPAGE="https://www.openssh.com/"
769 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
770 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~chutzpah/dist/openssh/${SCTP_PATCH} )}
771 - ${HPN_VER:+hpn? ( $(printf "mirror://sourceforge/hpnssh/HPN-SSH%%20${HPN_VER/./v}%%20${HPN_PV/_}/%s\n" "${HPN_PATCHES[@]}") )}
772 - ${X509_PATCH:+X509? ( https://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
773 - "
774 -
775 -LICENSE="BSD GPL-2"
776 -SLOT="0"
777 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
778 -# Probably want to drop ssl defaulting to on in a future version.
779 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldns libedit libressl livecd pam +pie sctp selinux +ssl static test X X509"
780 -RESTRICT="!test? ( test )"
781 -REQUIRED_USE="ldns? ( ssl )
782 - pie? ( !static )
783 - static? ( !kerberos !pam )
784 - X509? ( !sctp ssl )
785 - test? ( ssl )"
786 -
787 -LIB_DEPEND="
788 - audit? ( sys-process/audit[static-libs(+)] )
789 - ldns? (
790 - net-libs/ldns[static-libs(+)]
791 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
792 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
793 - )
794 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
795 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
796 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
797 - ssl? (
798 - !libressl? (
799 - || (
800 - (
801 - >=dev-libs/openssl-1.0.1:0[bindist=]
802 - <dev-libs/openssl-1.1.0:0[bindist=]
803 - )
804 - >=dev-libs/openssl-1.1.0g:0[bindist=]
805 - )
806 - dev-libs/openssl:0=[static-libs(+)]
807 - )
808 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
809 - )
810 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
811 -RDEPEND="
812 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
813 - pam? ( virtual/pam )
814 - kerberos? ( virtual/krb5 )"
815 -DEPEND="${RDEPEND}
816 - static? ( ${LIB_DEPEND} )
817 - virtual/pkgconfig
818 - virtual/os-headers
819 - sys-devel/autoconf"
820 -RDEPEND="${RDEPEND}
821 - pam? ( >=sys-auth/pambase-20081028 )
822 - userland_GNU? ( virtual/shadow )
823 - X? ( x11-apps/xauth )"
824 -
825 -S="${WORKDIR}/${PARCH}"
826 -
827 -pkg_pretend() {
828 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
829 - # than not be able to log in to their server any more
830 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
831 - local fail="
832 - $(use hpn && maybe_fail hpn HPN_VER)
833 - $(use sctp && maybe_fail sctp SCTP_PATCH)
834 - $(use X509 && maybe_fail X509 X509_PATCH)
835 - "
836 - fail=$(echo ${fail})
837 - if [[ -n ${fail} ]] ; then
838 - eerror "Sorry, but this version does not yet support features"
839 - eerror "that you requested: ${fail}"
840 - eerror "Please mask ${PF} for now and check back later:"
841 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
842 - die "booooo"
843 - fi
844 -
845 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
846 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
847 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
848 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
849 - fi
850 -}
851 -
852 -src_prepare() {
853 - sed -i \
854 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
855 - pathnames.h || die
856 -
857 - # don't break .ssh/authorized_keys2 for fun
858 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
859 -
860 - eapply "${FILESDIR}"/${PN}-7.9_p1-openssl-1.0.2-compat.patch
861 - eapply "${FILESDIR}"/${PN}-7.9_p1-include-stdlib.patch
862 - eapply "${FILESDIR}"/${PN}-7.8_p1-GSSAPI-dns.patch #165444 integrated into gsskex
863 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
864 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
865 -
866 - local PATCHSET_VERSION_MACROS=()
867 -
868 - if use X509 ; then
869 - pushd "${WORKDIR}" || die
870 - eapply "${FILESDIR}/${P}-X509-glue-${X509_VER}.patch"
871 - eapply "${FILESDIR}/${P}-X509-dont-make-piddir-${X509_VER}.patch"
872 - popd || die
873 -
874 - eapply "${WORKDIR}"/${X509_PATCH%.*}
875 - eapply "${FILESDIR}"/${P}-X509-${X509_VER}-tests.patch
876 -
877 - # We need to patch package version or any X.509 sshd will reject our ssh client
878 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
879 - # error
880 - einfo "Patching package version for X.509 patch set ..."
881 - sed -i \
882 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
883 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
884 -
885 - einfo "Patching version.h to expose X.509 patch set ..."
886 - sed -i \
887 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
888 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
889 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
890 - fi
891 -
892 - if use sctp ; then
893 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
894 -
895 - einfo "Patching version.h to expose SCTP patch set ..."
896 - sed -i \
897 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
898 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
899 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
900 -
901 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
902 - sed -i \
903 - -e "/\t\tcfgparse \\\/d" \
904 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
905 - fi
906 -
907 - if use hpn ; then
908 - local hpn_patchdir="${T}/${P}-hpn${HPN_VER}"
909 - mkdir "${hpn_patchdir}"
910 - cp $(printf -- "${DISTDIR}/%s\n" "${HPN_PATCHES[@]}") "${hpn_patchdir}"
911 - pushd "${hpn_patchdir}"
912 - eapply "${FILESDIR}"/${P}-hpn-glue.patch
913 - use X509 && eapply "${FILESDIR}"/${P}-hpn-X509-glue.patch
914 - use sctp && eapply "${FILESDIR}"/${P}-hpn-sctp-glue.patch
915 - popd
916 -
917 - eapply "${hpn_patchdir}"
918 - eapply "${FILESDIR}/openssh-7.9_p1-hpn-openssl-1.1.patch"
919 -
920 - einfo "Patching Makefile.in for HPN patch set ..."
921 - sed -i \
922 - -e "/^LIBS=/ s/\$/ -lpthread/" \
923 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
924 -
925 - einfo "Patching version.h to expose HPN patch set ..."
926 - sed -i \
927 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER//./v}\"" \
928 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
929 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
930 -
931 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
932 - einfo "Disabling known non-working MT AES cipher per default ..."
933 -
934 - cat > "${T}"/disable_mtaes.conf <<- EOF
935 -
936 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
937 - # and therefore disabled per default.
938 - DisableMTAES yes
939 - EOF
940 - sed -i \
941 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
942 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
943 -
944 - sed -i \
945 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
946 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
947 - fi
948 - fi
949 -
950 - if use X509 || use sctp || use hpn ; then
951 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
952 - sed -i \
953 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
954 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
955 -
956 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
957 - sed -i \
958 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
959 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
960 -
961 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
962 - sed -i \
963 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
964 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
965 - fi
966 -
967 - sed -i \
968 - -e "/#UseLogin no/d" \
969 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
970 -
971 - [[ -d ${WORKDIR}/patch ]] && eapply "${WORKDIR}"/patch
972 -
973 - eapply_user #473004
974 -
975 - tc-export PKG_CONFIG
976 - local sed_args=(
977 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
978 - # Disable PATH reset, trust what portage gives us #254615
979 - -e 's:^PATH=/:#PATH=/:'
980 - # Disable fortify flags ... our gcc does this for us
981 - -e 's:-D_FORTIFY_SOURCE=2::'
982 - )
983 -
984 - # The -ftrapv flag ICEs on hppa #505182
985 - use hppa && sed_args+=(
986 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
987 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
988 - )
989 - # _XOPEN_SOURCE causes header conflicts on Solaris
990 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
991 - -e 's/-D_XOPEN_SOURCE//'
992 - )
993 - sed -i "${sed_args[@]}" configure{.ac,} || die
994 -
995 - eautoreconf
996 -}
997 -
998 -src_configure() {
999 - addwrite /dev/ptmx
1000 -
1001 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
1002 - use static && append-ldflags -static
1003 -
1004 - local myconf=(
1005 - --with-ldflags="${LDFLAGS}"
1006 - --disable-strip
1007 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
1008 - --sysconfdir="${EPREFIX%/}"/etc/ssh
1009 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
1010 - --datadir="${EPREFIX%/}"/usr/share/openssh
1011 - --with-privsep-path="${EPREFIX%/}"/var/empty
1012 - --with-privsep-user=sshd
1013 - $(use_with audit audit linux)
1014 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
1015 - # We apply the sctp patch conditionally, so can't pass --without-sctp
1016 - # unconditionally else we get unknown flag warnings.
1017 - $(use sctp && use_with sctp)
1018 - $(use_with ldns)
1019 - $(use_with libedit)
1020 - $(use_with pam)
1021 - $(use_with pie)
1022 - $(use_with selinux)
1023 - $(use_with ssl openssl)
1024 - $(use_with ssl md5-passwords)
1025 - $(use_with ssl ssl-engine)
1026 - $(use_with !elibc_Cygwin hardening) #659210
1027 - )
1028 -
1029 - # stackprotect is broken on musl x86
1030 - use elibc_musl && use x86 && myconf+=( --without-stackprotect )
1031 -
1032 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
1033 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
1034 -
1035 - econf "${myconf[@]}"
1036 -}
1037 -
1038 -src_test() {
1039 - local t skipped=() failed=() passed=()
1040 - local tests=( interop-tests compat-tests )
1041 -
1042 - local shell=$(egetshell "${UID}")
1043 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1044 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1045 - elog "user, so we will run a subset only."
1046 - skipped+=( tests )
1047 - else
1048 - tests+=( tests )
1049 - fi
1050 -
1051 - # It will also attempt to write to the homedir .ssh.
1052 - local sshhome=${T}/homedir
1053 - mkdir -p "${sshhome}"/.ssh
1054 - for t in "${tests[@]}" ; do
1055 - # Some tests read from stdin ...
1056 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1057 - emake -k -j1 ${t} </dev/null \
1058 - && passed+=( "${t}" ) \
1059 - || failed+=( "${t}" )
1060 - done
1061 -
1062 - einfo "Passed tests: ${passed[*]}"
1063 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1064 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1065 -}
1066 -
1067 -# Gentoo tweaks to default config files.
1068 -tweak_ssh_configs() {
1069 - local locale_vars=(
1070 - # These are language variables that POSIX defines.
1071 - # http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
1072 - LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
1073 -
1074 - # These are the GNU extensions.
1075 - # https://www.gnu.org/software/autoconf/manual/html_node/Special-Shell-Variables.html
1076 - LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
1077 - )
1078 -
1079 - # First the server config.
1080 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1081 -
1082 - # Allow client to pass locale environment variables. #367017
1083 - AcceptEnv ${locale_vars[*]}
1084 -
1085 - # Allow client to pass COLORTERM to match TERM. #658540
1086 - AcceptEnv COLORTERM
1087 - EOF
1088 -
1089 - # Then the client config.
1090 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1091 -
1092 - # Send locale environment variables. #367017
1093 - SendEnv ${locale_vars[*]}
1094 -
1095 - # Send COLORTERM to match TERM. #658540
1096 - SendEnv COLORTERM
1097 - EOF
1098 -
1099 - if use pam ; then
1100 - sed -i \
1101 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1102 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1103 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1104 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1105 - "${ED%/}"/etc/ssh/sshd_config || die
1106 - fi
1107 -
1108 - if use livecd ; then
1109 - sed -i \
1110 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1111 - "${ED%/}"/etc/ssh/sshd_config || die
1112 - fi
1113 -}
1114 -
1115 -src_install() {
1116 - emake install-nokeys DESTDIR="${D}"
1117 - fperms 600 /etc/ssh/sshd_config
1118 - dobin contrib/ssh-copy-id
1119 - newinitd "${FILESDIR}"/sshd.initd sshd
1120 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1121 -
1122 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1123 -
1124 - tweak_ssh_configs
1125 -
1126 - doman contrib/ssh-copy-id.1
1127 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1128 - use hpn && dodoc HPN-README
1129 - use X509 || dodoc ChangeLog
1130 -
1131 - diropts -m 0700
1132 - dodir /etc/skel/.ssh
1133 -
1134 - keepdir /var/empty
1135 -
1136 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1137 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1138 -}
1139 -
1140 -pkg_preinst() {
1141 - enewgroup sshd 22
1142 - enewuser sshd 22 -1 /var/empty sshd
1143 -}
1144 -
1145 -pkg_postinst() {
1146 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1147 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1148 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1149 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1150 - fi
1151 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1152 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1153 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1154 - elog "be an alternative for you as it supports USE=tcpd."
1155 - fi
1156 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1157 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1158 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1159 - elog "adding to your sshd_config or ~/.ssh/config files:"
1160 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1161 - elog "You should however generate new keys using rsa or ed25519."
1162 -
1163 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1164 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1165 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1166 - fi
1167 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1168 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1169 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1170 - fi
1171 - if has_version "<${CATEGORY}/${PN}-7.7_p1" ; then
1172 - elog "Starting with openssh-7.7p1, we no longer patch openssh to provide LDAP functionality."
1173 - elog "Install sys-auth/ssh-ldap-pubkey and use OpenSSH's \"AuthorizedKeysCommand\" option"
1174 - elog "if you need to authenticate against LDAP."
1175 - elog "See https://wiki.gentoo.org/wiki/SSH/LDAP_migration for more details."
1176 - fi
1177 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1178 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1179 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1180 - elog "and update all clients/servers that utilize them."
1181 - fi
1182 -
1183 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1184 - elog ""
1185 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1186 - elog "and therefore disabled at runtime per default."
1187 - elog "Make sure your sshd_config is up to date and contains"
1188 - elog ""
1189 - elog " DisableMTAES yes"
1190 - elog ""
1191 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1192 - elog ""
1193 - fi
1194 -}
1195
1196 diff --git a/net-misc/openssh/openssh-7.9_p1.ebuild b/net-misc/openssh/openssh-7.9_p1.ebuild
1197 deleted file mode 100644
1198 index f39686f32b0..00000000000
1199 --- a/net-misc/openssh/openssh-7.9_p1.ebuild
1200 +++ /dev/null
1201 @@ -1,450 +0,0 @@
1202 -# Copyright 1999-2018 Gentoo Authors
1203 -# Distributed under the terms of the GNU General Public License v2
1204 -
1205 -EAPI=6
1206 -
1207 -inherit user flag-o-matic multilib autotools pam systemd
1208 -
1209 -# Make it more portable between straight releases
1210 -# and _p? releases.
1211 -PARCH=${P/_}
1212 -#HPN_PV="${PV^^}"
1213 -HPN_PV="7.8_P1"
1214 -
1215 -HPN_VER="14.16"
1216 -HPN_PATCHES=(
1217 - ${PN}-${HPN_PV/./_}-hpn-DynWinNoneSwitch-${HPN_VER}.diff
1218 - ${PN}-${HPN_PV/./_}-hpn-AES-CTR-${HPN_VER}.diff
1219 -)
1220 -HPN_DISABLE_MTAES=1 # unit tests hang on MT-AES-CTR
1221 -SCTP_VER="1.1" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
1222 -X509_VER="11.5" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
1223 -
1224 -DESCRIPTION="Port of OpenBSD's free SSH release"
1225 -HOMEPAGE="https://www.openssh.com/"
1226 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1227 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~chutzpah/dist/openssh/${SCTP_PATCH} )}
1228 - ${HPN_VER:+hpn? ( $(printf "mirror://sourceforge/hpnssh/HPN-SSH%%20${HPN_VER/./v}%%20${HPN_PV/_}/%s\n" "${HPN_PATCHES[@]}") )}
1229 - ${X509_PATCH:+X509? ( https://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
1230 - "
1231 -
1232 -LICENSE="BSD GPL-2"
1233 -SLOT="0"
1234 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1235 -# Probably want to drop ssl defaulting to on in a future version.
1236 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldns libedit libressl livecd pam +pie sctp selinux +ssl static test X X509"
1237 -RESTRICT="!test? ( test )"
1238 -REQUIRED_USE="ldns? ( ssl )
1239 - pie? ( !static )
1240 - static? ( !kerberos !pam )
1241 - X509? ( !sctp ssl )
1242 - test? ( ssl )"
1243 -
1244 -LIB_DEPEND="
1245 - audit? ( sys-process/audit[static-libs(+)] )
1246 - ldns? (
1247 - net-libs/ldns[static-libs(+)]
1248 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
1249 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
1250 - )
1251 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
1252 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
1253 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
1254 - ssl? (
1255 - !libressl? (
1256 - || (
1257 - (
1258 - >=dev-libs/openssl-1.0.1:0[bindist=]
1259 - <dev-libs/openssl-1.1.0:0[bindist=]
1260 - )
1261 - >=dev-libs/openssl-1.1.0g:0[bindist=]
1262 - )
1263 - dev-libs/openssl:0=[static-libs(+)]
1264 - )
1265 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
1266 - )
1267 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
1268 -RDEPEND="
1269 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
1270 - pam? ( virtual/pam )
1271 - kerberos? ( virtual/krb5 )"
1272 -DEPEND="${RDEPEND}
1273 - static? ( ${LIB_DEPEND} )
1274 - virtual/pkgconfig
1275 - virtual/os-headers
1276 - sys-devel/autoconf"
1277 -RDEPEND="${RDEPEND}
1278 - pam? ( >=sys-auth/pambase-20081028 )
1279 - userland_GNU? ( virtual/shadow )
1280 - X? ( x11-apps/xauth )"
1281 -
1282 -S="${WORKDIR}/${PARCH}"
1283 -
1284 -pkg_pretend() {
1285 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
1286 - # than not be able to log in to their server any more
1287 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
1288 - local fail="
1289 - $(use hpn && maybe_fail hpn HPN_VER)
1290 - $(use sctp && maybe_fail sctp SCTP_PATCH)
1291 - $(use X509 && maybe_fail X509 X509_PATCH)
1292 - "
1293 - fail=$(echo ${fail})
1294 - if [[ -n ${fail} ]] ; then
1295 - eerror "Sorry, but this version does not yet support features"
1296 - eerror "that you requested: ${fail}"
1297 - eerror "Please mask ${PF} for now and check back later:"
1298 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
1299 - die "booooo"
1300 - fi
1301 -
1302 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
1303 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
1304 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
1305 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
1306 - fi
1307 -}
1308 -
1309 -src_prepare() {
1310 - sed -i \
1311 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
1312 - pathnames.h || die
1313 -
1314 - # don't break .ssh/authorized_keys2 for fun
1315 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
1316 -
1317 - eapply "${FILESDIR}"/${PN}-7.9_p1-openssl-1.0.2-compat.patch
1318 - eapply "${FILESDIR}"/${PN}-7.9_p1-include-stdlib.patch
1319 - eapply "${FILESDIR}"/${PN}-7.8_p1-GSSAPI-dns.patch #165444 integrated into gsskex
1320 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
1321 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
1322 -
1323 - local PATCHSET_VERSION_MACROS=()
1324 -
1325 - if use X509 ; then
1326 - pushd "${WORKDIR}" || die
1327 - eapply "${FILESDIR}/${P}-X509-glue.patch"
1328 - eapply "${FILESDIR}/${P}-X509-dont-make-piddir.patch"
1329 - popd || die
1330 -
1331 - eapply "${WORKDIR}"/${X509_PATCH%.*}
1332 - eapply "${FILESDIR}"/${PN}-7.9_p1-libressl-2.8.patch
1333 -
1334 - # We need to patch package version or any X.509 sshd will reject our ssh client
1335 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
1336 - # error
1337 - einfo "Patching package version for X.509 patch set ..."
1338 - sed -i \
1339 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
1340 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
1341 -
1342 - einfo "Patching version.h to expose X.509 patch set ..."
1343 - sed -i \
1344 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
1345 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
1346 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
1347 - fi
1348 -
1349 - if use sctp ; then
1350 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
1351 -
1352 - einfo "Patching version.h to expose SCTP patch set ..."
1353 - sed -i \
1354 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
1355 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
1356 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
1357 -
1358 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
1359 - sed -i \
1360 - -e "/\t\tcfgparse \\\/d" \
1361 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
1362 - fi
1363 -
1364 - if use hpn ; then
1365 - local hpn_patchdir="${T}/${P}-hpn${HPN_VER}"
1366 - mkdir "${hpn_patchdir}"
1367 - cp $(printf -- "${DISTDIR}/%s\n" "${HPN_PATCHES[@]}") "${hpn_patchdir}"
1368 - pushd "${hpn_patchdir}"
1369 - eapply "${FILESDIR}"/${P}-hpn-glue.patch
1370 - use X509 && eapply "${FILESDIR}"/${P}-hpn-X509-glue.patch
1371 - use sctp && eapply "${FILESDIR}"/${P}-hpn-sctp-glue.patch
1372 - popd
1373 -
1374 - eapply "${hpn_patchdir}"
1375 - eapply "${FILESDIR}/openssh-7.9_p1-hpn-openssl-1.1.patch"
1376 -
1377 - einfo "Patching Makefile.in for HPN patch set ..."
1378 - sed -i \
1379 - -e "/^LIBS=/ s/\$/ -lpthread/" \
1380 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
1381 -
1382 - einfo "Patching version.h to expose HPN patch set ..."
1383 - sed -i \
1384 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER//./v}\"" \
1385 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
1386 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
1387 -
1388 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1389 - einfo "Disabling known non-working MT AES cipher per default ..."
1390 -
1391 - cat > "${T}"/disable_mtaes.conf <<- EOF
1392 -
1393 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
1394 - # and therefore disabled per default.
1395 - DisableMTAES yes
1396 - EOF
1397 - sed -i \
1398 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
1399 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
1400 -
1401 - sed -i \
1402 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
1403 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
1404 - fi
1405 - fi
1406 -
1407 - if use X509 || use sctp || use hpn ; then
1408 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
1409 - sed -i \
1410 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1411 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
1412 -
1413 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
1414 - sed -i \
1415 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1416 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
1417 -
1418 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
1419 - sed -i \
1420 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
1421 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
1422 - fi
1423 -
1424 - sed -i \
1425 - -e "/#UseLogin no/d" \
1426 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
1427 -
1428 - [[ -d ${WORKDIR}/patch ]] && eapply "${WORKDIR}"/patch
1429 -
1430 - eapply_user #473004
1431 -
1432 - tc-export PKG_CONFIG
1433 - local sed_args=(
1434 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1435 - # Disable PATH reset, trust what portage gives us #254615
1436 - -e 's:^PATH=/:#PATH=/:'
1437 - # Disable fortify flags ... our gcc does this for us
1438 - -e 's:-D_FORTIFY_SOURCE=2::'
1439 - )
1440 -
1441 - # The -ftrapv flag ICEs on hppa #505182
1442 - use hppa && sed_args+=(
1443 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
1444 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
1445 - )
1446 - # _XOPEN_SOURCE causes header conflicts on Solaris
1447 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
1448 - -e 's/-D_XOPEN_SOURCE//'
1449 - )
1450 - sed -i "${sed_args[@]}" configure{.ac,} || die
1451 -
1452 - eautoreconf
1453 -}
1454 -
1455 -src_configure() {
1456 - addwrite /dev/ptmx
1457 -
1458 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
1459 - use static && append-ldflags -static
1460 -
1461 - local myconf=(
1462 - --with-ldflags="${LDFLAGS}"
1463 - --disable-strip
1464 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
1465 - --sysconfdir="${EPREFIX%/}"/etc/ssh
1466 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
1467 - --datadir="${EPREFIX%/}"/usr/share/openssh
1468 - --with-privsep-path="${EPREFIX%/}"/var/empty
1469 - --with-privsep-user=sshd
1470 - $(use_with audit audit linux)
1471 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
1472 - # We apply the sctp patch conditionally, so can't pass --without-sctp
1473 - # unconditionally else we get unknown flag warnings.
1474 - $(use sctp && use_with sctp)
1475 - $(use_with ldns)
1476 - $(use_with libedit)
1477 - $(use_with pam)
1478 - $(use_with pie)
1479 - $(use_with selinux)
1480 - $(use_with ssl openssl)
1481 - $(use_with ssl md5-passwords)
1482 - $(use_with ssl ssl-engine)
1483 - $(use_with !elibc_Cygwin hardening) #659210
1484 - )
1485 -
1486 - # stackprotect is broken on musl x86
1487 - use elibc_musl && use x86 && myconf+=( --without-stackprotect )
1488 -
1489 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
1490 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
1491 -
1492 - econf "${myconf[@]}"
1493 -}
1494 -
1495 -src_test() {
1496 - local t skipped=() failed=() passed=()
1497 - local tests=( interop-tests compat-tests )
1498 -
1499 - local shell=$(egetshell "${UID}")
1500 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1501 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1502 - elog "user, so we will run a subset only."
1503 - skipped+=( tests )
1504 - else
1505 - tests+=( tests )
1506 - fi
1507 -
1508 - # It will also attempt to write to the homedir .ssh.
1509 - local sshhome=${T}/homedir
1510 - mkdir -p "${sshhome}"/.ssh
1511 - for t in "${tests[@]}" ; do
1512 - # Some tests read from stdin ...
1513 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1514 - emake -k -j1 ${t} </dev/null \
1515 - && passed+=( "${t}" ) \
1516 - || failed+=( "${t}" )
1517 - done
1518 -
1519 - einfo "Passed tests: ${passed[*]}"
1520 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1521 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1522 -}
1523 -
1524 -# Gentoo tweaks to default config files.
1525 -tweak_ssh_configs() {
1526 - local locale_vars=(
1527 - # These are language variables that POSIX defines.
1528 - # http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
1529 - LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
1530 -
1531 - # These are the GNU extensions.
1532 - # https://www.gnu.org/software/autoconf/manual/html_node/Special-Shell-Variables.html
1533 - LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
1534 - )
1535 -
1536 - # First the server config.
1537 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1538 -
1539 - # Allow client to pass locale environment variables. #367017
1540 - AcceptEnv ${locale_vars[*]}
1541 -
1542 - # Allow client to pass COLORTERM to match TERM. #658540
1543 - AcceptEnv COLORTERM
1544 - EOF
1545 -
1546 - # Then the client config.
1547 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1548 -
1549 - # Send locale environment variables. #367017
1550 - SendEnv ${locale_vars[*]}
1551 -
1552 - # Send COLORTERM to match TERM. #658540
1553 - SendEnv COLORTERM
1554 - EOF
1555 -
1556 - if use pam ; then
1557 - sed -i \
1558 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1559 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1560 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1561 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1562 - "${ED%/}"/etc/ssh/sshd_config || die
1563 - fi
1564 -
1565 - if use livecd ; then
1566 - sed -i \
1567 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1568 - "${ED%/}"/etc/ssh/sshd_config || die
1569 - fi
1570 -}
1571 -
1572 -src_install() {
1573 - emake install-nokeys DESTDIR="${D}"
1574 - fperms 600 /etc/ssh/sshd_config
1575 - dobin contrib/ssh-copy-id
1576 - newinitd "${FILESDIR}"/sshd.initd sshd
1577 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1578 -
1579 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1580 -
1581 - tweak_ssh_configs
1582 -
1583 - doman contrib/ssh-copy-id.1
1584 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1585 - use hpn && dodoc HPN-README
1586 - use X509 || dodoc ChangeLog
1587 -
1588 - diropts -m 0700
1589 - dodir /etc/skel/.ssh
1590 -
1591 - keepdir /var/empty
1592 -
1593 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1594 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1595 -}
1596 -
1597 -pkg_preinst() {
1598 - enewgroup sshd 22
1599 - enewuser sshd 22 -1 /var/empty sshd
1600 -}
1601 -
1602 -pkg_postinst() {
1603 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1604 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1605 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1606 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1607 - fi
1608 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1609 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1610 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1611 - elog "be an alternative for you as it supports USE=tcpd."
1612 - fi
1613 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1614 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1615 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1616 - elog "adding to your sshd_config or ~/.ssh/config files:"
1617 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1618 - elog "You should however generate new keys using rsa or ed25519."
1619 -
1620 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1621 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1622 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1623 - fi
1624 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1625 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1626 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1627 - fi
1628 - if has_version "<${CATEGORY}/${PN}-7.7_p1" ; then
1629 - elog "Starting with openssh-7.7p1, we no longer patch openssh to provide LDAP functionality."
1630 - elog "Install sys-auth/ssh-ldap-pubkey and use OpenSSH's \"AuthorizedKeysCommand\" option"
1631 - elog "if you need to authenticate against LDAP."
1632 - elog "See https://wiki.gentoo.org/wiki/SSH/LDAP_migration for more details."
1633 - fi
1634 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1635 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1636 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1637 - elog "and update all clients/servers that utilize them."
1638 - fi
1639 -
1640 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1641 - elog ""
1642 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1643 - elog "and therefore disabled at runtime per default."
1644 - elog "Make sure your sshd_config is up to date and contains"
1645 - elog ""
1646 - elog " DisableMTAES yes"
1647 - elog ""
1648 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1649 - elog ""
1650 - fi
1651 -}