Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: net-misc/openssh/files/, net-misc/openssh/
Date: Thu, 28 Jun 2018 20:08:22
Message-Id: 1530216487.60461ca1385809bacf6a114a7f1ecfe22f6da47f.blueness@gentoo
1 commit: 60461ca1385809bacf6a114a7f1ecfe22f6da47f
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 28 20:08:07 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 28 20:08:07 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=60461ca1
7
8 net-misc/openssh: fix is now in the tree
9
10 net-misc/openssh/Manifest | 5 -
11 .../openssh-6.7_p1-openssl-ignore-status.patch | 17 -
12 ...penssh-7.5_p1-disable-conch-interop-tests.patch | 20 -
13 .../openssh/files/openssh-7.7_p1-GSSAPI-dns.patch | 351 ----------------
14 net-misc/openssh/files/sshd-r1.confd | 33 --
15 net-misc/openssh/files/sshd.pam_include.2 | 4 -
16 net-misc/openssh/files/sshd.rc6.5 | 89 ----
17 net-misc/openssh/files/sshd.service | 11 -
18 net-misc/openssh/files/sshd.socket | 10 -
19 net-misc/openssh/files/sshd_at.service | 8 -
20 net-misc/openssh/metadata.xml | 39 --
21 net-misc/openssh/openssh-7.7_p1-r5.ebuild | 437 --------------------
22 net-misc/openssh/openssh-7.7_p1-r6.ebuild | 460 ---------------------
23 13 files changed, 1484 deletions(-)
24
25 diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest
26 deleted file mode 100644
27 index e720a87..0000000
28 --- a/net-misc/openssh/Manifest
29 +++ /dev/null
30 @@ -1,5 +0,0 @@
31 -DIST openssh-7.7p1-hpnssh14v15-gentoo2.patch.xz 22060 BLAKE2B 9ee654f689d4b90bd0fe4f71d57b4a8d9d957012be3a23ff2baa6c45ae99e2f1e4daf5de24479a6a3eb761ee6847deb3c6c3021d4cbabc9089f605d8d7270efc SHA512 856d28ac89c14d01c40c7d7e93cfaebd74b091188b5b469550eb62aa5445177aec1a5f47c1e2f7173013712e98e5f9f5e46bbb3dbd4ec7c5ee8256ef45cda0f8
32 -DIST openssh-7.7p1-patches-1.1.tar.xz 16476 BLAKE2B fca2885a9e29faec40700ece37a995ba83e40bd2a6875129a5327770d8ee43663a7c063de33b4653994ed7332adb03730f613c047550d874190b95c66e2e9efa SHA512 aa5e33ce4bb4be16abf27ac1bade1dc85c51d82002be546402e0b8b0685de3ec7029f0f56bf1295ec346eb3960a6bed7cfc882722e57957a19a732f3174b3039
33 -DIST openssh-7.7p1-sctp-1.1.patch.xz 7548 BLAKE2B 3b960c2377351955007005de560c2a3e8d0d059a0435e5beda14c63e444dad8b4357edaccd1cfe446c6268514f152b2bcfa7fa3612f1ae1324a31fecb0e85ac5 SHA512 093605865262a2b972db8c92990a49ed6178ed4567fb2626518c826c8472553d9be99a9e6052a6f5e545d81867b4118e9fd8a2c0c26a2739f1720b0f13282cba
34 -DIST openssh-7.7p1-x509-11.3.1.patch.xz 362672 BLAKE2B 55b8b0ef00dc4d962a0db1115406b7b1e84110870c74198e9e4cb081b2ffde8daca67cb281c69d73b4c5cbffde361429d62634be194b57e888a0b434a0f42a37 SHA512 f84744f6d2e5a15017bce37bfa65ebb47dbafeac07ea9aab46bdc780b4062ff70687512d9d512cab81e3b9c701adb6ce17c5474f35cb4b49f57db2e2d45ac9ac
35 -DIST openssh-7.7p1.tar.gz 1536900 BLAKE2B 7aee360f2cea5bfa3f8426fcbd66fde2568f05f9c8e623326b60f03b7c5f8abf223e178aa1d5958015b51627565bf5b1ace35b57f309638c908f5a7bf5500d21 SHA512 597252cb48209a0cb98ca1928a67e8d63e4275252f25bc37269204c108f034baade6ba0634e32ae63422fddd280f73096a6b31ad2f2e7a848dde75ca30e14261
36
37 diff --git a/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch b/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch
38 deleted file mode 100644
39 index fa33af3..0000000
40 --- a/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch
41 +++ /dev/null
42 @@ -1,17 +0,0 @@
43 -the last nibble of the openssl version represents the status. that is,
44 -whether it is a beta or release. when it comes to version checks in
45 -openssh, this component does not matter, so ignore it.
46 -
47 -https://bugzilla.mindrot.org/show_bug.cgi?id=2212
48 -
49 ---- a/openbsd-compat/openssl-compat.c
50 -+++ b/openbsd-compat/openssl-compat.c
51 -@@ -58,7 +58,7 @@ ssh_compatible_openssl(long headerver, long libver)
52 - * For versions >= 1.0.0, major,minor,status must match and library
53 - * fix version must be equal to or newer than the header.
54 - */
55 -- mask = 0xfff0000fL; /* major,minor,status */
56 -+ mask = 0xfff00000L; /* major,minor,status */
57 - hfix = (headerver & 0x000ff000) >> 12;
58 - lfix = (libver & 0x000ff000) >> 12;
59 - if ( (headerver & mask) == (libver & mask) && lfix >= hfix)
60
61 diff --git a/net-misc/openssh/files/openssh-7.5_p1-disable-conch-interop-tests.patch b/net-misc/openssh/files/openssh-7.5_p1-disable-conch-interop-tests.patch
62 deleted file mode 100644
63 index a5647ce..0000000
64 --- a/net-misc/openssh/files/openssh-7.5_p1-disable-conch-interop-tests.patch
65 +++ /dev/null
66 @@ -1,20 +0,0 @@
67 -Disable conch interop tests which are failing when called
68 -via portage for yet unknown reason and because using conch
69 -seems to be flaky (test is failing when using Python2 but
70 -passing when using Python3).
71 -
72 -Bug: https://bugs.gentoo.org/605446
73 -
74 ---- a/regress/conch-ciphers.sh
75 -+++ b/regress/conch-ciphers.sh
76 -@@ -3,6 +3,10 @@
77 -
78 - tid="conch ciphers"
79 -
80 -+# https://bugs.gentoo.org/605446
81 -+echo "conch interop tests skipped due to Gentoo bug #605446"
82 -+exit 0
83 -+
84 - if test "x$REGRESS_INTEROP_CONCH" != "xyes" ; then
85 - echo "conch interop tests not enabled"
86 - exit 0
87
88 diff --git a/net-misc/openssh/files/openssh-7.7_p1-GSSAPI-dns.patch b/net-misc/openssh/files/openssh-7.7_p1-GSSAPI-dns.patch
89 deleted file mode 100644
90 index 2840652..0000000
91 --- a/net-misc/openssh/files/openssh-7.7_p1-GSSAPI-dns.patch
92 +++ /dev/null
93 @@ -1,351 +0,0 @@
94 -https://bugs.gentoo.org/165444
95 -https://bugzilla.mindrot.org/show_bug.cgi?id=1008
96 -
97 ---- a/auth.c
98 -+++ b/auth.c
99 -@@ -728,120 +728,6 @@ fakepw(void)
100 - return (&fake);
101 - }
102 -
103 --/*
104 -- * Returns the remote DNS hostname as a string. The returned string must not
105 -- * be freed. NB. this will usually trigger a DNS query the first time it is
106 -- * called.
107 -- * This function does additional checks on the hostname to mitigate some
108 -- * attacks on legacy rhosts-style authentication.
109 -- * XXX is RhostsRSAAuthentication vulnerable to these?
110 -- * XXX Can we remove these checks? (or if not, remove RhostsRSAAuthentication?)
111 -- */
112 --
113 --static char *
114 --remote_hostname(struct ssh *ssh)
115 --{
116 -- struct sockaddr_storage from;
117 -- socklen_t fromlen;
118 -- struct addrinfo hints, *ai, *aitop;
119 -- char name[NI_MAXHOST], ntop2[NI_MAXHOST];
120 -- const char *ntop = ssh_remote_ipaddr(ssh);
121 --
122 -- /* Get IP address of client. */
123 -- fromlen = sizeof(from);
124 -- memset(&from, 0, sizeof(from));
125 -- if (getpeername(ssh_packet_get_connection_in(ssh),
126 -- (struct sockaddr *)&from, &fromlen) < 0) {
127 -- debug("getpeername failed: %.100s", strerror(errno));
128 -- return strdup(ntop);
129 -- }
130 --
131 -- ipv64_normalise_mapped(&from, &fromlen);
132 -- if (from.ss_family == AF_INET6)
133 -- fromlen = sizeof(struct sockaddr_in6);
134 --
135 -- debug3("Trying to reverse map address %.100s.", ntop);
136 -- /* Map the IP address to a host name. */
137 -- if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
138 -- NULL, 0, NI_NAMEREQD) != 0) {
139 -- /* Host name not found. Use ip address. */
140 -- return strdup(ntop);
141 -- }
142 --
143 -- /*
144 -- * if reverse lookup result looks like a numeric hostname,
145 -- * someone is trying to trick us by PTR record like following:
146 -- * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5
147 -- */
148 -- memset(&hints, 0, sizeof(hints));
149 -- hints.ai_socktype = SOCK_DGRAM; /*dummy*/
150 -- hints.ai_flags = AI_NUMERICHOST;
151 -- if (getaddrinfo(name, NULL, &hints, &ai) == 0) {
152 -- logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
153 -- name, ntop);
154 -- freeaddrinfo(ai);
155 -- return strdup(ntop);
156 -- }
157 --
158 -- /* Names are stored in lowercase. */
159 -- lowercase(name);
160 --
161 -- /*
162 -- * Map it back to an IP address and check that the given
163 -- * address actually is an address of this host. This is
164 -- * necessary because anyone with access to a name server can
165 -- * define arbitrary names for an IP address. Mapping from
166 -- * name to IP address can be trusted better (but can still be
167 -- * fooled if the intruder has access to the name server of
168 -- * the domain).
169 -- */
170 -- memset(&hints, 0, sizeof(hints));
171 -- hints.ai_family = from.ss_family;
172 -- hints.ai_socktype = SOCK_STREAM;
173 -- if (getaddrinfo(name, NULL, &hints, &aitop) != 0) {
174 -- logit("reverse mapping checking getaddrinfo for %.700s "
175 -- "[%s] failed.", name, ntop);
176 -- return strdup(ntop);
177 -- }
178 -- /* Look for the address from the list of addresses. */
179 -- for (ai = aitop; ai; ai = ai->ai_next) {
180 -- if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop2,
181 -- sizeof(ntop2), NULL, 0, NI_NUMERICHOST) == 0 &&
182 -- (strcmp(ntop, ntop2) == 0))
183 -- break;
184 -- }
185 -- freeaddrinfo(aitop);
186 -- /* If we reached the end of the list, the address was not there. */
187 -- if (ai == NULL) {
188 -- /* Address not found for the host name. */
189 -- logit("Address %.100s maps to %.600s, but this does not "
190 -- "map back to the address.", ntop, name);
191 -- return strdup(ntop);
192 -- }
193 -- return strdup(name);
194 --}
195 --
196 --/*
197 -- * Return the canonical name of the host in the other side of the current
198 -- * connection. The host name is cached, so it is efficient to call this
199 -- * several times.
200 -- */
201 --
202 --const char *
203 --auth_get_canonical_hostname(struct ssh *ssh, int use_dns)
204 --{
205 -- static char *dnsname;
206 --
207 -- if (!use_dns)
208 -- return ssh_remote_ipaddr(ssh);
209 -- else if (dnsname != NULL)
210 -- return dnsname;
211 -- else {
212 -- dnsname = remote_hostname(ssh);
213 -- return dnsname;
214 -- }
215 --}
216 --
217 - /*
218 - * Runs command in a subprocess wuth a minimal environment.
219 - * Returns pid on success, 0 on failure.
220 ---- a/canohost.c
221 -+++ b/canohost.c
222 -@@ -202,3 +202,117 @@ get_local_port(int sock)
223 - {
224 - return get_sock_port(sock, 1);
225 - }
226 -+
227 -+/*
228 -+ * Returns the remote DNS hostname as a string. The returned string must not
229 -+ * be freed. NB. this will usually trigger a DNS query the first time it is
230 -+ * called.
231 -+ * This function does additional checks on the hostname to mitigate some
232 -+ * attacks on legacy rhosts-style authentication.
233 -+ * XXX is RhostsRSAAuthentication vulnerable to these?
234 -+ * XXX Can we remove these checks? (or if not, remove RhostsRSAAuthentication?)
235 -+ */
236 -+
237 -+static char *
238 -+remote_hostname(struct ssh *ssh)
239 -+{
240 -+ struct sockaddr_storage from;
241 -+ socklen_t fromlen;
242 -+ struct addrinfo hints, *ai, *aitop;
243 -+ char name[NI_MAXHOST], ntop2[NI_MAXHOST];
244 -+ const char *ntop = ssh_remote_ipaddr(ssh);
245 -+
246 -+ /* Get IP address of client. */
247 -+ fromlen = sizeof(from);
248 -+ memset(&from, 0, sizeof(from));
249 -+ if (getpeername(ssh_packet_get_connection_in(ssh),
250 -+ (struct sockaddr *)&from, &fromlen) < 0) {
251 -+ debug("getpeername failed: %.100s", strerror(errno));
252 -+ return strdup(ntop);
253 -+ }
254 -+
255 -+ ipv64_normalise_mapped(&from, &fromlen);
256 -+ if (from.ss_family == AF_INET6)
257 -+ fromlen = sizeof(struct sockaddr_in6);
258 -+
259 -+ debug3("Trying to reverse map address %.100s.", ntop);
260 -+ /* Map the IP address to a host name. */
261 -+ if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
262 -+ NULL, 0, NI_NAMEREQD) != 0) {
263 -+ /* Host name not found. Use ip address. */
264 -+ return strdup(ntop);
265 -+ }
266 -+
267 -+ /*
268 -+ * if reverse lookup result looks like a numeric hostname,
269 -+ * someone is trying to trick us by PTR record like following:
270 -+ * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5
271 -+ */
272 -+ memset(&hints, 0, sizeof(hints));
273 -+ hints.ai_socktype = SOCK_DGRAM; /*dummy*/
274 -+ hints.ai_flags = AI_NUMERICHOST;
275 -+ if (getaddrinfo(name, NULL, &hints, &ai) == 0) {
276 -+ logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
277 -+ name, ntop);
278 -+ freeaddrinfo(ai);
279 -+ return strdup(ntop);
280 -+ }
281 -+
282 -+ /* Names are stored in lowercase. */
283 -+ lowercase(name);
284 -+
285 -+ /*
286 -+ * Map it back to an IP address and check that the given
287 -+ * address actually is an address of this host. This is
288 -+ * necessary because anyone with access to a name server can
289 -+ * define arbitrary names for an IP address. Mapping from
290 -+ * name to IP address can be trusted better (but can still be
291 -+ * fooled if the intruder has access to the name server of
292 -+ * the domain).
293 -+ */
294 -+ memset(&hints, 0, sizeof(hints));
295 -+ hints.ai_family = from.ss_family;
296 -+ hints.ai_socktype = SOCK_STREAM;
297 -+ if (getaddrinfo(name, NULL, &hints, &aitop) != 0) {
298 -+ logit("reverse mapping checking getaddrinfo for %.700s "
299 -+ "[%s] failed.", name, ntop);
300 -+ return strdup(ntop);
301 -+ }
302 -+ /* Look for the address from the list of addresses. */
303 -+ for (ai = aitop; ai; ai = ai->ai_next) {
304 -+ if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop2,
305 -+ sizeof(ntop2), NULL, 0, NI_NUMERICHOST) == 0 &&
306 -+ (strcmp(ntop, ntop2) == 0))
307 -+ break;
308 -+ }
309 -+ freeaddrinfo(aitop);
310 -+ /* If we reached the end of the list, the address was not there. */
311 -+ if (ai == NULL) {
312 -+ /* Address not found for the host name. */
313 -+ logit("Address %.100s maps to %.600s, but this does not "
314 -+ "map back to the address.", ntop, name);
315 -+ return strdup(ntop);
316 -+ }
317 -+ return strdup(name);
318 -+}
319 -+
320 -+/*
321 -+ * Return the canonical name of the host in the other side of the current
322 -+ * connection. The host name is cached, so it is efficient to call this
323 -+ * several times.
324 -+ */
325 -+
326 -+const char *
327 -+auth_get_canonical_hostname(struct ssh *ssh, int use_dns)
328 -+{
329 -+ static char *dnsname;
330 -+
331 -+ if (!use_dns)
332 -+ return ssh_remote_ipaddr(ssh);
333 -+ else if (dnsname != NULL)
334 -+ return dnsname;
335 -+ else {
336 -+ dnsname = remote_hostname(ssh);
337 -+ return dnsname;
338 -+ }
339 -+}
340 ---- a/readconf.c
341 -+++ b/readconf.c
342 -@@ -160,6 +160,7 @@ typedef enum {
343 - oClearAllForwardings, oNoHostAuthenticationForLocalhost,
344 - oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
345 - oAddressFamily, oGssAuthentication, oGssDelegateCreds,
346 -+ oGssTrustDns,
347 - oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
348 - oSendEnv, oControlPath, oControlMaster, oControlPersist,
349 - oHashKnownHosts,
350 -@@ -200,9 +201,11 @@ static struct {
351 - #if defined(GSSAPI)
352 - { "gssapiauthentication", oGssAuthentication },
353 - { "gssapidelegatecredentials", oGssDelegateCreds },
354 -+ { "gssapitrustdns", oGssTrustDns },
355 - # else
356 - { "gssapiauthentication", oUnsupported },
357 - { "gssapidelegatecredentials", oUnsupported },
358 -+ { "gssapitrustdns", oUnsupported },
359 - #endif
360 - #ifdef ENABLE_PKCS11
361 - { "smartcarddevice", oPKCS11Provider },
362 -@@ -954,6 +957,10 @@ parse_time:
363 - intptr = &options->gss_deleg_creds;
364 - goto parse_flag;
365 -
366 -+ case oGssTrustDns:
367 -+ intptr = &options->gss_trust_dns;
368 -+ goto parse_flag;
369 -+
370 - case oBatchMode:
371 - intptr = &options->batch_mode;
372 - goto parse_flag;
373 -@@ -1766,6 +1773,7 @@ initialize_options(Options * options)
374 - options->challenge_response_authentication = -1;
375 - options->gss_authentication = -1;
376 - options->gss_deleg_creds = -1;
377 -+ options->gss_trust_dns = -1;
378 - options->password_authentication = -1;
379 - options->kbd_interactive_authentication = -1;
380 - options->kbd_interactive_devices = NULL;
381 -@@ -1908,6 +1916,8 @@ fill_default_options(Options * options)
382 - options->gss_authentication = 0;
383 - if (options->gss_deleg_creds == -1)
384 - options->gss_deleg_creds = 0;
385 -+ if (options->gss_trust_dns == -1)
386 -+ options->gss_trust_dns = 0;
387 - if (options->password_authentication == -1)
388 - options->password_authentication = 1;
389 - if (options->kbd_interactive_authentication == -1)
390 ---- a/readconf.h
391 -+++ b/readconf.h
392 -@@ -43,6 +43,7 @@ typedef struct {
393 - /* Try S/Key or TIS, authentication. */
394 - int gss_authentication; /* Try GSS authentication */
395 - int gss_deleg_creds; /* Delegate GSS credentials */
396 -+ int gss_trust_dns; /* Trust DNS for GSS canonicalization */
397 - int password_authentication; /* Try password
398 - * authentication. */
399 - int kbd_interactive_authentication; /* Try keyboard-interactive auth. */
400 ---- a/ssh_config.5
401 -+++ b/ssh_config.5
402 -@@ -731,6 +731,16 @@ The default is
403 - Forward (delegate) credentials to the server.
404 - The default is
405 - .Cm no .
406 -+Note that this option applies to protocol version 2 connections using GSSAPI.
407 -+.It Cm GSSAPITrustDns
408 -+Set to
409 -+.Dq yes to indicate that the DNS is trusted to securely canonicalize
410 -+the name of the host being connected to. If
411 -+.Dq no, the hostname entered on the
412 -+command line will be passed untouched to the GSSAPI library.
413 -+The default is
414 -+.Dq no .
415 -+This option only applies to protocol version 2 connections using GSSAPI.
416 - .It Cm HashKnownHosts
417 - Indicates that
418 - .Xr ssh 1
419 ---- a/sshconnect2.c
420 -+++ b/sshconnect2.c
421 -@@ -643,6 +643,13 @@ userauth_gssapi(Authctxt *authctxt)
422 - static u_int mech = 0;
423 - OM_uint32 min;
424 - int ok = 0;
425 -+ const char *gss_host;
426 -+
427 -+ if (options.gss_trust_dns) {
428 -+ extern const char *auth_get_canonical_hostname(struct ssh *ssh, int use_dns);
429 -+ gss_host = auth_get_canonical_hostname(active_state, 1);
430 -+ } else
431 -+ gss_host = authctxt->host;
432 -
433 - /* Try one GSSAPI method at a time, rather than sending them all at
434 - * once. */
435 -@@ -655,7 +662,7 @@ userauth_gssapi(Authctxt *authctxt)
436 - /* My DER encoding requires length<128 */
437 - if (gss_supported->elements[mech].length < 128 &&
438 - ssh_gssapi_check_mechanism(&gssctxt,
439 -- &gss_supported->elements[mech], authctxt->host)) {
440 -+ &gss_supported->elements[mech], gss_host)) {
441 - ok = 1; /* Mechanism works */
442 - } else {
443 - mech++;
444 ---
445
446 diff --git a/net-misc/openssh/files/sshd-r1.confd b/net-misc/openssh/files/sshd-r1.confd
447 deleted file mode 100644
448 index cf43037..0000000
449 --- a/net-misc/openssh/files/sshd-r1.confd
450 +++ /dev/null
451 @@ -1,33 +0,0 @@
452 -# /etc/conf.d/sshd: config file for /etc/init.d/sshd
453 -
454 -# Where is your sshd_config file stored?
455 -
456 -SSHD_CONFDIR="${RC_PREFIX%/}/etc/ssh"
457 -
458 -
459 -# Any random options you want to pass to sshd.
460 -# See the sshd(8) manpage for more info.
461 -
462 -SSHD_OPTS=""
463 -
464 -
465 -# Wait one second (length chosen arbitrarily) to see if sshd actually
466 -# creates a PID file, or if it crashes for some reason like not being
467 -# able to bind to the address in ListenAddress.
468 -
469 -#SSHD_SSD_OPTS="--wait 1000"
470 -
471 -
472 -# Pid file to use (needs to be absolute path).
473 -
474 -#SSHD_PIDFILE="${RC_PREFIX%/}/run/sshd.pid"
475 -
476 -
477 -# Path to the sshd binary (needs to be absolute path).
478 -
479 -#SSHD_BINARY="${RC_PREFIX%/}/usr/sbin/sshd"
480 -
481 -
482 -# Path to the ssh-keygen binary (needs to be absolute path).
483 -
484 -#SSHD_KEYGEN_BINARY="${RC_PREFIX%/}/usr/bin/ssh-keygen"
485
486 diff --git a/net-misc/openssh/files/sshd.pam_include.2 b/net-misc/openssh/files/sshd.pam_include.2
487 deleted file mode 100644
488 index b801aaa..0000000
489 --- a/net-misc/openssh/files/sshd.pam_include.2
490 +++ /dev/null
491 @@ -1,4 +0,0 @@
492 -auth include system-remote-login
493 -account include system-remote-login
494 -password include system-remote-login
495 -session include system-remote-login
496
497 diff --git a/net-misc/openssh/files/sshd.rc6.5 b/net-misc/openssh/files/sshd.rc6.5
498 deleted file mode 100644
499 index 044cbe7..0000000
500 --- a/net-misc/openssh/files/sshd.rc6.5
501 +++ /dev/null
502 @@ -1,89 +0,0 @@
503 -#!/sbin/openrc-run
504 -# Copyright 1999-2018 Gentoo Foundation
505 -# Distributed under the terms of the GNU General Public License v2
506 -
507 -extra_commands="checkconfig"
508 -extra_started_commands="reload"
509 -
510 -: ${SSHD_CONFDIR:=${RC_PREFIX%/}/etc/ssh}
511 -: ${SSHD_CONFIG:=${SSHD_CONFDIR}/sshd_config}
512 -: ${SSHD_PIDFILE:=${RC_PREFIX%/}/run/${SVCNAME}.pid}
513 -: ${SSHD_BINARY:=${RC_PREFIX%/}/usr/sbin/sshd}
514 -: ${SSHD_KEYGEN_BINARY:=${RC_PREFIX%/}/usr/bin/ssh-keygen}
515 -
516 -command="${SSHD_BINARY}"
517 -pidfile="${SSHD_PIDFILE}"
518 -command_args="${SSHD_OPTS} -o PidFile=${pidfile} -f ${SSHD_CONFIG}"
519 -
520 -# Wait one second (length chosen arbitrarily) to see if sshd actually
521 -# creates a PID file, or if it crashes for some reason like not being
522 -# able to bind to the address in ListenAddress (bug 617596).
523 -: ${SSHD_SSD_OPTS:=--wait 1000}
524 -start_stop_daemon_args="${SSHD_SSD_OPTS}"
525 -
526 -depend() {
527 - # Entropy can be used by ssh-keygen, among other things, but
528 - # is not strictly required (bug 470020).
529 - use logger dns entropy
530 - if [ "${rc_need+set}" = "set" ] ; then
531 - : # Do nothing, the user has explicitly set rc_need
532 - else
533 - local x warn_addr
534 - for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do
535 - case "${x}" in
536 - 0.0.0.0|0.0.0.0:*) ;;
537 - ::|\[::\]*) ;;
538 - *) warn_addr="${warn_addr} ${x}" ;;
539 - esac
540 - done
541 - if [ -n "${warn_addr}" ] ; then
542 - need net
543 - ewarn "You are binding an interface in ListenAddress statement in your sshd_config!"
544 - ewarn "You must add rc_need=\"net.FOO\" to your ${RC_PREFIX%/}/etc/conf.d/sshd"
545 - ewarn "where FOO is the interface(s) providing the following address(es):"
546 - ewarn "${warn_addr}"
547 - fi
548 - fi
549 -}
550 -
551 -checkconfig() {
552 - checkpath --directory "${RC_PREFIX%/}/var/empty"
553 -
554 - if [ ! -e "${SSHD_CONFIG}" ] ; then
555 - eerror "You need an ${SSHD_CONFIG} file to run sshd"
556 - eerror "There is a sample file in /usr/share/doc/openssh"
557 - return 1
558 - fi
559 -
560 - ${SSHD_KEYGEN_BINARY} -A || return 2
561 -
562 - "${command}" -t ${command_args} || return 3
563 -}
564 -
565 -start_pre() {
566 - # If this isn't a restart, make sure that the user's config isn't
567 - # busted before we try to start the daemon (this will produce
568 - # better error messages than if we just try to start it blindly).
569 - #
570 - # If, on the other hand, this *is* a restart, then the stop_pre
571 - # action will have ensured that the config is usable and we don't
572 - # need to do that again.
573 - if [ "${RC_CMD}" != "restart" ] ; then
574 - checkconfig || return $?
575 - fi
576 -}
577 -
578 -stop_pre() {
579 - # If this is a restart, check to make sure the user's config
580 - # isn't busted before we stop the running daemon.
581 - if [ "${RC_CMD}" = "restart" ] ; then
582 - checkconfig || return $?
583 - fi
584 -}
585 -
586 -reload() {
587 - checkconfig || return $?
588 - ebegin "Reloading ${SVCNAME}"
589 - start-stop-daemon --signal HUP --pidfile "${pidfile}"
590 - eend $?
591 -}
592
593 diff --git a/net-misc/openssh/files/sshd.service b/net-misc/openssh/files/sshd.service
594 deleted file mode 100644
595 index b5e96b3..0000000
596 --- a/net-misc/openssh/files/sshd.service
597 +++ /dev/null
598 @@ -1,11 +0,0 @@
599 -[Unit]
600 -Description=OpenSSH server daemon
601 -After=syslog.target network.target auditd.service
602 -
603 -[Service]
604 -ExecStartPre=/usr/bin/ssh-keygen -A
605 -ExecStart=/usr/sbin/sshd -D -e
606 -ExecReload=/bin/kill -HUP $MAINPID
607 -
608 -[Install]
609 -WantedBy=multi-user.target
610
611 diff --git a/net-misc/openssh/files/sshd.socket b/net-misc/openssh/files/sshd.socket
612 deleted file mode 100644
613 index 94b9533..0000000
614 --- a/net-misc/openssh/files/sshd.socket
615 +++ /dev/null
616 @@ -1,10 +0,0 @@
617 -[Unit]
618 -Description=OpenSSH Server Socket
619 -Conflicts=sshd.service
620 -
621 -[Socket]
622 -ListenStream=22
623 -Accept=yes
624 -
625 -[Install]
626 -WantedBy=sockets.target
627
628 diff --git a/net-misc/openssh/files/sshd_at.service b/net-misc/openssh/files/sshd_at.service
629 deleted file mode 100644
630 index 2645ad0..0000000
631 --- a/net-misc/openssh/files/sshd_at.service
632 +++ /dev/null
633 @@ -1,8 +0,0 @@
634 -[Unit]
635 -Description=OpenSSH per-connection server daemon
636 -After=syslog.target auditd.service
637 -
638 -[Service]
639 -ExecStart=-/usr/sbin/sshd -i -e
640 -StandardInput=socket
641 -StandardError=syslog
642
643 diff --git a/net-misc/openssh/metadata.xml b/net-misc/openssh/metadata.xml
644 deleted file mode 100644
645 index 03b12f0..0000000
646 --- a/net-misc/openssh/metadata.xml
647 +++ /dev/null
648 @@ -1,39 +0,0 @@
649 -<?xml version="1.0" encoding="UTF-8"?>
650 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
651 -<pkgmetadata>
652 - <maintainer type="project">
653 - <email>base-system@g.o</email>
654 - <name>Gentoo Base System</name>
655 - </maintainer>
656 - <maintainer type="person">
657 - <email>robbat2@g.o</email>
658 - <description>LPK issues. Only assign if it's a direct LPK issue. Do not directly assign for anything else.</description>
659 - </maintainer>
660 - <longdescription>
661 -OpenSSH is a FREE version of the SSH protocol suite of network connectivity tools that
662 -increasing numbers of people on the Internet are coming to rely on. Many users of telnet,
663 -rlogin, ftp, and other such programs might not realize that their password is transmitted
664 -across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords)
665 -to effectively eliminate eavesdropping, connection hijacking, and other network-level attacks.
666 -Additionally, OpenSSH provides a myriad of secure tunneling capabilities, as well as a variety
667 -of authentication methods.
668 -
669 -The OpenSSH suite includes the ssh program which replaces rlogin and telnet, scp which
670 -replaces rcp, and sftp which replaces ftp. Also included is sshd which is the server side of
671 -the package, and the other basic utilities like ssh-add, ssh-agent, ssh-keysign, ssh-keyscan,
672 -ssh-keygen and sftp-server. OpenSSH supports SSH protocol versions 1.3, 1.5, and 2.0.
673 -</longdescription>
674 - <use>
675 - <flag name="bindist">Disable EC/RC5 algorithms in OpenSSL for patent reasons.</flag>
676 - <flag name="hpn">Enable high performance ssh</flag>
677 - <flag name="ldap">Add support for storing SSH public keys in LDAP</flag>
678 - <flag name="ldns">Use LDNS for DNSSEC/SSHFP validation.</flag>
679 - <flag name="livecd">Enable root password logins for live-cd environment.</flag>
680 - <flag name="ssl">Enable additional crypto algorithms via OpenSSL</flag>
681 - <flag name="X509">Adds support for X.509 certificate authentication</flag>
682 - </use>
683 - <upstream>
684 - <remote-id type="cpe">cpe:/a:openssh:openssh</remote-id>
685 - <remote-id type="sourceforge">hpnssh</remote-id>
686 - </upstream>
687 -</pkgmetadata>
688
689 diff --git a/net-misc/openssh/openssh-7.7_p1-r5.ebuild b/net-misc/openssh/openssh-7.7_p1-r5.ebuild
690 deleted file mode 100644
691 index 2425ed8..0000000
692 --- a/net-misc/openssh/openssh-7.7_p1-r5.ebuild
693 +++ /dev/null
694 @@ -1,437 +0,0 @@
695 -# Copyright 1999-2018 Gentoo Foundation
696 -# Distributed under the terms of the GNU General Public License v2
697 -
698 -EAPI=6
699 -
700 -inherit user flag-o-matic multilib autotools pam systemd versionator
701 -
702 -# Make it more portable between straight releases
703 -# and _p? releases.
704 -PARCH=${P/_}
705 -
706 -HPN_VER="14v15-gentoo2" HPN_PATCH="${PARCH}-hpnssh${HPN_VER}.patch.xz"
707 -SCTP_VER="1.1" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
708 -X509_VER="11.3.1" X509_PATCH="${PARCH}-x509-${X509_VER}.patch.xz"
709 -
710 -# Disable LDAP support until someone will rewrite the patch,
711 -# upstream removed auth_parse_options() via commit 7c856857607112a3dfe6414696bf4c7ab7fb0cb3
712 -#LDAP_VER="0.3.14" LDAP_PATCH="${PN}-lpk-7.7p1-${LDAP_VER}.patch.xz"
713 -
714 -PATCH_SET="openssh-7.7p1-patches-1.1"
715 -
716 -DESCRIPTION="Port of OpenBSD's free SSH release"
717 -HOMEPAGE="https://www.openssh.com/"
718 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
719 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
720 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~whissi/dist/openssh/${SCTP_PATCH} )}
721 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~whissi/dist/openssh/${HPN_PATCH} )}
722 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~whissi/dist/openssh/${LDAP_PATCH} )}
723 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~whissi/dist/openssh/${X509_PATCH} )}
724 - "
725 -
726 -LICENSE="BSD GPL-2"
727 -SLOT="0"
728 -KEYWORDS="amd64 arm ~mips ppc x86"
729 -# Probably want to drop ssl defaulting to on in a future version.
730 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
731 -REQUIRED_USE="ldns? ( ssl )
732 - pie? ( !static )
733 - static? ( !kerberos !pam )
734 - X509? ( !ldap !sctp ssl )
735 - test? ( ssl )"
736 -
737 -LIB_DEPEND="
738 - audit? ( sys-process/audit[static-libs(+)] )
739 - ldns? (
740 - net-libs/ldns[static-libs(+)]
741 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
742 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
743 - )
744 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
745 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
746 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
747 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
748 - ssl? (
749 - !libressl? (
750 - >=dev-libs/openssl-1.0.1:0=[bindist=]
751 - dev-libs/openssl:0=[static-libs(+)]
752 - )
753 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
754 - )
755 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
756 -RDEPEND="
757 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
758 - pam? ( virtual/pam )
759 - kerberos? ( virtual/krb5 )
760 - ldap? ( net-nds/openldap )"
761 -DEPEND="${RDEPEND}
762 - static? ( ${LIB_DEPEND} )
763 - virtual/pkgconfig
764 - virtual/os-headers
765 - sys-devel/autoconf"
766 -RDEPEND="${RDEPEND}
767 - pam? ( >=sys-auth/pambase-20081028 )
768 - userland_GNU? ( virtual/shadow )
769 - X? ( x11-apps/xauth )"
770 -
771 -S="${WORKDIR}/${PARCH}"
772 -
773 -pkg_pretend() {
774 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
775 - # than not be able to log in to their server any more
776 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
777 - local fail="
778 - $(use hpn && maybe_fail hpn HPN_PATCH)
779 - $(use ldap && maybe_fail ldap LDAP_PATCH)
780 - $(use sctp && maybe_fail sctp SCTP_PATCH)
781 - $(use X509 && maybe_fail X509 X509_PATCH)
782 - "
783 - fail=$(echo ${fail})
784 - if [[ -n ${fail} ]] ; then
785 - eerror "Sorry, but this version does not yet support features"
786 - eerror "that you requested: ${fail}"
787 - eerror "Please mask ${PF} for now and check back later:"
788 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
789 - die "booooo"
790 - fi
791 -
792 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
793 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
794 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
795 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
796 - fi
797 -}
798 -
799 -src_prepare() {
800 - sed -i \
801 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
802 - pathnames.h || die
803 -
804 - # don't break .ssh/authorized_keys2 for fun
805 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
806 -
807 - eapply "${FILESDIR}"/${PN}-7.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
808 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
809 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
810 -
811 - local PATCHSET_VERSION_MACROS=()
812 -
813 - if use X509 ; then
814 - eapply "${WORKDIR}"/${X509_PATCH%.*}
815 -
816 - # We need to patch package version or any X.509 sshd will reject our ssh client
817 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
818 - # error
819 - einfo "Patching package version for X.509 patch set ..."
820 - sed -i \
821 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
822 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
823 -
824 - einfo "Patching version.h to expose X.509 patch set ..."
825 - sed -i \
826 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
827 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
828 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
829 -
830 - einfo "Disabling broken X.509 agent test ..."
831 - sed -i \
832 - -e "/^ agent$/d" \
833 - "${S}"/tests/CA/config || die "Failed to disable broken X.509 agent test"
834 -
835 - # The following patches don't apply on top of X509 patch
836 - rm "${WORKDIR}"/patch/2002_all_openssh-7.7p1_upstream_bug2840.patch || die
837 - rm "${WORKDIR}"/patch/2009_all_openssh-7.7p1_make-shell-tests-portable.patch || die
838 - rm "${WORKDIR}"/patch/2016_all_openssh-7.7p1_implement-EMFILE-mitigation-for-ssh-agent.patch || die
839 - rm "${WORKDIR}"/patch/2025_all_openssh-7.7p1_prefer-argv0-to-ssh-when-re-executing-ssh-for-proxyjump.patch || die
840 - else
841 - rm "${WORKDIR}"/patch/2016_all_openssh-7.7p1-X509_implement-EMFILE-mitigation-for-ssh-agent.patch || die
842 - rm "${WORKDIR}"/patch/2025_all_openssh-7.7p1-X509_prefer-argv0-to-ssh-when-re-executing-ssh-for-proxyjump.patch || die
843 - fi
844 -
845 - if use ldap ; then
846 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
847 -
848 - einfo "Patching version.h to expose LDAP patch set ..."
849 - sed -i \
850 - -e "/^#define SSH_PORTABLE.*/a #define SSH_LDAP \"-ldap-${LDAP_VER}\"" \
851 - "${S}"/version.h || die "Failed to sed-in LDAP patch version"
852 - PATCHSET_VERSION_MACROS+=( 'SSH_LDAP' )
853 - fi
854 -
855 - if use sctp ; then
856 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
857 -
858 - einfo "Patching version.h to expose SCTP patch set ..."
859 - sed -i \
860 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
861 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
862 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
863 -
864 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
865 - sed -i \
866 - -e "/\t\tcfgparse \\\/d" \
867 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
868 - fi
869 -
870 - if use hpn ; then
871 - eapply "${WORKDIR}"/${HPN_PATCH%.*}
872 -
873 - einfo "Patching Makefile.in for HPN patch set ..."
874 - sed -i \
875 - -e "/^LIBS=/ s/\$/ -lpthread/" \
876 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
877 -
878 - einfo "Patching version.h to expose HPN patch set ..."
879 - sed -i \
880 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER}\"" \
881 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
882 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
883 -
884 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
885 - einfo "Disabling known non-working MT AES cipher per default ..."
886 -
887 - cat > "${T}"/disable_mtaes.conf <<- EOF
888 -
889 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
890 - # and therefore disabled per default.
891 - DisableMTAES yes
892 - EOF
893 - sed -i \
894 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
895 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
896 -
897 - sed -i \
898 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
899 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
900 - fi
901 - fi
902 -
903 - if use X509 || use hpn ; then
904 - einfo "Patching packet.c for X509 and/or HPN patch set ..."
905 - sed -i \
906 - -e "s/const struct sshcipher/struct sshcipher/" \
907 - "${S}"/packet.c || die "Failed to patch ssh_packet_set_connection() (packet.c)"
908 - fi
909 -
910 - if use X509 || use sctp || use ldap || use hpn ; then
911 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
912 - sed -i \
913 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
914 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
915 -
916 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
917 - sed -i \
918 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
919 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
920 -
921 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
922 - sed -i \
923 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
924 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
925 - fi
926 -
927 - sed -i \
928 - -e "/#UseLogin no/d" \
929 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
930 -
931 - eapply "${WORKDIR}"/patch/*.patch
932 -
933 - eapply_user #473004
934 -
935 - tc-export PKG_CONFIG
936 - local sed_args=(
937 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
938 - # Disable PATH reset, trust what portage gives us #254615
939 - -e 's:^PATH=/:#PATH=/:'
940 - # Disable fortify flags ... our gcc does this for us
941 - -e 's:-D_FORTIFY_SOURCE=2::'
942 - )
943 -
944 - # The -ftrapv flag ICEs on hppa #505182
945 - use hppa && sed_args+=(
946 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
947 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
948 - )
949 - # _XOPEN_SOURCE causes header conflicts on Solaris
950 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
951 - -e 's/-D_XOPEN_SOURCE//'
952 - )
953 - sed -i "${sed_args[@]}" configure{.ac,} || die
954 -
955 - eautoreconf
956 -}
957 -
958 -src_configure() {
959 - addwrite /dev/ptmx
960 -
961 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
962 - use static && append-ldflags -static
963 -
964 - local myconf=(
965 - --with-ldflags="${LDFLAGS}"
966 - --disable-strip
967 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
968 - --sysconfdir="${EPREFIX%/}"/etc/ssh
969 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
970 - --datadir="${EPREFIX%/}"/usr/share/openssh
971 - --with-privsep-path="${EPREFIX%/}"/var/empty
972 - --with-privsep-user=sshd
973 - $(use_with audit audit linux)
974 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
975 - # We apply the ldap and sctp patch conditionally, so can't pass --without-{ldap,sctp}
976 - # unconditionally else we get unknown flag warnings.
977 - $(use ldap && use_with ldap)
978 - $(use sctp && use_with sctp)
979 - $(use_with ldns)
980 - $(use_with libedit)
981 - $(use_with pam)
982 - $(use_with pie)
983 - $(use_with selinux)
984 - $(use_with skey)
985 - $(use_with ssl openssl)
986 - $(use_with ssl md5-passwords)
987 - $(use_with ssl ssl-engine)
988 - )
989 -
990 - if [[ $(tc-arch) == x86 ]]; then
991 - myconf+=( --without-stackprotect)
992 - fi
993 -
994 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
995 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
996 -
997 - econf "${myconf[@]}"
998 -}
999 -
1000 -src_test() {
1001 - local t skipped=() failed=() passed=()
1002 - local tests=( interop-tests compat-tests )
1003 -
1004 - local shell=$(egetshell "${UID}")
1005 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1006 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1007 - elog "user, so we will run a subset only."
1008 - skipped+=( tests )
1009 - else
1010 - tests+=( tests )
1011 - fi
1012 -
1013 - # It will also attempt to write to the homedir .ssh.
1014 - local sshhome=${T}/homedir
1015 - mkdir -p "${sshhome}"/.ssh
1016 - for t in "${tests[@]}" ; do
1017 - # Some tests read from stdin ...
1018 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1019 - emake -k -j1 ${t} </dev/null \
1020 - && passed+=( "${t}" ) \
1021 - || failed+=( "${t}" )
1022 - done
1023 -
1024 - einfo "Passed tests: ${passed[*]}"
1025 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1026 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1027 -}
1028 -
1029 -src_install() {
1030 - emake install-nokeys DESTDIR="${D}"
1031 - fperms 600 /etc/ssh/sshd_config
1032 - dobin contrib/ssh-copy-id
1033 - newinitd "${FILESDIR}"/sshd.rc6.5 sshd
1034 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1035 -
1036 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1037 - if use pam ; then
1038 - sed -i \
1039 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1040 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1041 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1042 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1043 - "${ED%/}"/etc/ssh/sshd_config || die
1044 - fi
1045 -
1046 - # Gentoo tweaks to default config files
1047 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1048 -
1049 - # Allow client to pass locale environment variables #367017
1050 - AcceptEnv LANG LC_*
1051 - EOF
1052 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1053 -
1054 - # Send locale environment variables #367017
1055 - SendEnv LANG LC_*
1056 - EOF
1057 -
1058 - if use livecd ; then
1059 - sed -i \
1060 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1061 - "${ED%/}"/etc/ssh/sshd_config || die
1062 - fi
1063 -
1064 - if use ldap && [[ -n ${LDAP_PATCH} ]] ; then
1065 - insinto /etc/openldap/schema/
1066 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1067 - fi
1068 -
1069 - doman contrib/ssh-copy-id.1
1070 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1071 - use hpn && dodoc HPN-README
1072 - use X509 || dodoc ChangeLog
1073 -
1074 - diropts -m 0700
1075 - dodir /etc/skel/.ssh
1076 -
1077 - keepdir /var/empty
1078 -
1079 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1080 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1081 -}
1082 -
1083 -pkg_preinst() {
1084 - enewgroup sshd 22
1085 - enewuser sshd 22 -1 /var/empty sshd
1086 -}
1087 -
1088 -pkg_postinst() {
1089 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1090 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1091 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1092 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1093 - fi
1094 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1095 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1096 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1097 - elog "be an alternative for you as it supports USE=tcpd."
1098 - fi
1099 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1100 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1101 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1102 - elog "adding to your sshd_config or ~/.ssh/config files:"
1103 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1104 - elog "You should however generate new keys using rsa or ed25519."
1105 -
1106 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1107 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1108 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1109 - fi
1110 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1111 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1112 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1113 - fi
1114 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1115 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1116 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1117 - elog "and update all clients/servers that utilize them."
1118 - fi
1119 -
1120 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1121 - elog ""
1122 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1123 - elog "and therefore disabled at runtime per default."
1124 - elog "Make sure your sshd_config is up to date and contains"
1125 - elog ""
1126 - elog " DisableMTAES yes"
1127 - elog ""
1128 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1129 - elog ""
1130 - fi
1131 -}
1132
1133 diff --git a/net-misc/openssh/openssh-7.7_p1-r6.ebuild b/net-misc/openssh/openssh-7.7_p1-r6.ebuild
1134 deleted file mode 100644
1135 index 9eeea10..0000000
1136 --- a/net-misc/openssh/openssh-7.7_p1-r6.ebuild
1137 +++ /dev/null
1138 @@ -1,460 +0,0 @@
1139 -# Copyright 1999-2018 Gentoo Foundation
1140 -# Distributed under the terms of the GNU General Public License v2
1141 -
1142 -EAPI=6
1143 -
1144 -inherit user flag-o-matic multilib autotools pam systemd versionator
1145 -
1146 -# Make it more portable between straight releases
1147 -# and _p? releases.
1148 -PARCH=${P/_}
1149 -
1150 -HPN_VER="14v15-gentoo2" HPN_PATCH="${PARCH}-hpnssh${HPN_VER}.patch.xz"
1151 -SCTP_VER="1.1" SCTP_PATCH="${PARCH}-sctp-${SCTP_VER}.patch.xz"
1152 -X509_VER="11.3.1" X509_PATCH="${PARCH}-x509-${X509_VER}.patch.xz"
1153 -
1154 -# Disable LDAP support until someone will rewrite the patch,
1155 -# upstream removed auth_parse_options() via commit 7c856857607112a3dfe6414696bf4c7ab7fb0cb3
1156 -#LDAP_VER="0.3.14" LDAP_PATCH="${PN}-lpk-7.7p1-${LDAP_VER}.patch.xz"
1157 -
1158 -PATCH_SET="openssh-7.7p1-patches-1.1"
1159 -
1160 -DESCRIPTION="Port of OpenBSD's free SSH release"
1161 -HOMEPAGE="https://www.openssh.com/"
1162 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1163 - https://dev.gentoo.org/~whissi/dist/${PN}/${PATCH_SET}.tar.xz
1164 - ${SCTP_PATCH:+sctp? ( https://dev.gentoo.org/~whissi/dist/openssh/${SCTP_PATCH} )}
1165 - ${HPN_PATCH:+hpn? ( https://dev.gentoo.org/~whissi/dist/openssh/${HPN_PATCH} )}
1166 - ${LDAP_PATCH:+ldap? ( https://dev.gentoo.org/~whissi/dist/openssh/${LDAP_PATCH} )}
1167 - ${X509_PATCH:+X509? ( https://dev.gentoo.org/~whissi/dist/openssh/${X509_PATCH} )}
1168 - "
1169 -
1170 -LICENSE="BSD GPL-2"
1171 -SLOT="0"
1172 -KEYWORDS="amd64 arm ~mips ppc x86"
1173 -# Probably want to drop ssl defaulting to on in a future version.
1174 -IUSE="abi_mips_n32 audit bindist debug hpn kerberos kernel_linux ldap ldns libedit libressl livecd pam +pie sctp selinux skey +ssl static test X X509"
1175 -REQUIRED_USE="ldns? ( ssl )
1176 - pie? ( !static )
1177 - static? ( !kerberos !pam )
1178 - X509? ( !ldap !sctp ssl )
1179 - test? ( ssl )"
1180 -
1181 -LIB_DEPEND="
1182 - audit? ( sys-process/audit[static-libs(+)] )
1183 - ldns? (
1184 - net-libs/ldns[static-libs(+)]
1185 - !bindist? ( net-libs/ldns[ecdsa,ssl(+)] )
1186 - bindist? ( net-libs/ldns[-ecdsa,ssl(+)] )
1187 - )
1188 - libedit? ( dev-libs/libedit:=[static-libs(+)] )
1189 - sctp? ( net-misc/lksctp-tools[static-libs(+)] )
1190 - selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
1191 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
1192 - ssl? (
1193 - !libressl? (
1194 - >=dev-libs/openssl-1.0.1:0=[bindist=]
1195 - dev-libs/openssl:0=[static-libs(+)]
1196 - )
1197 - libressl? ( dev-libs/libressl:0=[static-libs(+)] )
1198 - )
1199 - >=sys-libs/zlib-1.2.3:=[static-libs(+)]"
1200 -RDEPEND="
1201 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
1202 - pam? ( virtual/pam )
1203 - kerberos? ( virtual/krb5 )
1204 - ldap? ( net-nds/openldap )"
1205 -DEPEND="${RDEPEND}
1206 - static? ( ${LIB_DEPEND} )
1207 - virtual/pkgconfig
1208 - virtual/os-headers
1209 - sys-devel/autoconf"
1210 -RDEPEND="${RDEPEND}
1211 - pam? ( >=sys-auth/pambase-20081028 )
1212 - userland_GNU? ( virtual/shadow )
1213 - X? ( x11-apps/xauth )"
1214 -
1215 -S="${WORKDIR}/${PARCH}"
1216 -
1217 -pkg_pretend() {
1218 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
1219 - # than not be able to log in to their server any more
1220 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
1221 - local fail="
1222 - $(use hpn && maybe_fail hpn HPN_PATCH)
1223 - $(use ldap && maybe_fail ldap LDAP_PATCH)
1224 - $(use sctp && maybe_fail sctp SCTP_PATCH)
1225 - $(use X509 && maybe_fail X509 X509_PATCH)
1226 - "
1227 - fail=$(echo ${fail})
1228 - if [[ -n ${fail} ]] ; then
1229 - eerror "Sorry, but this version does not yet support features"
1230 - eerror "that you requested: ${fail}"
1231 - eerror "Please mask ${PF} for now and check back later:"
1232 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
1233 - die "booooo"
1234 - fi
1235 -
1236 - # Make sure people who are using tcp wrappers are notified of its removal. #531156
1237 - if grep -qs '^ *sshd *:' "${EROOT%/}"/etc/hosts.{allow,deny} ; then
1238 - ewarn "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
1239 - ewarn "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
1240 - fi
1241 -}
1242 -
1243 -src_prepare() {
1244 - sed -i \
1245 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX%/}/usr/bin/xauth:" \
1246 - pathnames.h || die
1247 -
1248 - # don't break .ssh/authorized_keys2 for fun
1249 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
1250 -
1251 - eapply "${FILESDIR}"/${PN}-7.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
1252 - eapply "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
1253 - eapply "${FILESDIR}"/${PN}-7.5_p1-disable-conch-interop-tests.patch
1254 -
1255 - local PATCHSET_VERSION_MACROS=()
1256 -
1257 - if use X509 ; then
1258 - eapply "${WORKDIR}"/${X509_PATCH%.*}
1259 -
1260 - # We need to patch package version or any X.509 sshd will reject our ssh client
1261 - # with "userauth_pubkey: could not parse key: string is too large [preauth]"
1262 - # error
1263 - einfo "Patching package version for X.509 patch set ..."
1264 - sed -i \
1265 - -e "s/^AC_INIT(\[OpenSSH\], \[Portable\]/AC_INIT([OpenSSH], [${X509_VER}]/" \
1266 - "${S}"/configure.ac || die "Failed to patch package version for X.509 patch"
1267 -
1268 - einfo "Patching version.h to expose X.509 patch set ..."
1269 - sed -i \
1270 - -e "/^#define SSH_PORTABLE.*/a #define SSH_X509 \"-PKIXSSH-${X509_VER}\"" \
1271 - "${S}"/version.h || die "Failed to sed-in X.509 patch version"
1272 - PATCHSET_VERSION_MACROS+=( 'SSH_X509' )
1273 -
1274 - einfo "Disabling broken X.509 agent test ..."
1275 - sed -i \
1276 - -e "/^ agent$/d" \
1277 - "${S}"/tests/CA/config || die "Failed to disable broken X.509 agent test"
1278 -
1279 - # The following patches don't apply on top of X509 patch
1280 - rm "${WORKDIR}"/patch/2002_all_openssh-7.7p1_upstream_bug2840.patch || die
1281 - rm "${WORKDIR}"/patch/2009_all_openssh-7.7p1_make-shell-tests-portable.patch || die
1282 - rm "${WORKDIR}"/patch/2016_all_openssh-7.7p1_implement-EMFILE-mitigation-for-ssh-agent.patch || die
1283 - rm "${WORKDIR}"/patch/2025_all_openssh-7.7p1_prefer-argv0-to-ssh-when-re-executing-ssh-for-proxyjump.patch || die
1284 - else
1285 - rm "${WORKDIR}"/patch/2016_all_openssh-7.7p1-X509_implement-EMFILE-mitigation-for-ssh-agent.patch || die
1286 - rm "${WORKDIR}"/patch/2025_all_openssh-7.7p1-X509_prefer-argv0-to-ssh-when-re-executing-ssh-for-proxyjump.patch || die
1287 - fi
1288 -
1289 - if use ldap ; then
1290 - eapply "${WORKDIR}"/${LDAP_PATCH%.*}
1291 -
1292 - einfo "Patching version.h to expose LDAP patch set ..."
1293 - sed -i \
1294 - -e "/^#define SSH_PORTABLE.*/a #define SSH_LDAP \"-ldap-${LDAP_VER}\"" \
1295 - "${S}"/version.h || die "Failed to sed-in LDAP patch version"
1296 - PATCHSET_VERSION_MACROS+=( 'SSH_LDAP' )
1297 - fi
1298 -
1299 - if use sctp ; then
1300 - eapply "${WORKDIR}"/${SCTP_PATCH%.*}
1301 -
1302 - einfo "Patching version.h to expose SCTP patch set ..."
1303 - sed -i \
1304 - -e "/^#define SSH_PORTABLE/a #define SSH_SCTP \"-sctp-${SCTP_VER}\"" \
1305 - "${S}"/version.h || die "Failed to sed-in SCTP patch version"
1306 - PATCHSET_VERSION_MACROS+=( 'SSH_SCTP' )
1307 -
1308 - einfo "Disabling know failing test (cfgparse) caused by SCTP patch ..."
1309 - sed -i \
1310 - -e "/\t\tcfgparse \\\/d" \
1311 - "${S}"/regress/Makefile || die "Failed to disable known failing test (cfgparse) caused by SCTP patch"
1312 - fi
1313 -
1314 - if use hpn ; then
1315 - eapply "${WORKDIR}"/${HPN_PATCH%.*}
1316 -
1317 - einfo "Patching Makefile.in for HPN patch set ..."
1318 - sed -i \
1319 - -e "/^LIBS=/ s/\$/ -lpthread/" \
1320 - "${S}"/Makefile.in || die "Failed to patch Makefile.in"
1321 -
1322 - einfo "Patching version.h to expose HPN patch set ..."
1323 - sed -i \
1324 - -e "/^#define SSH_PORTABLE/a #define SSH_HPN \"-hpn${HPN_VER}\"" \
1325 - "${S}"/version.h || die "Failed to sed-in HPN patch version"
1326 - PATCHSET_VERSION_MACROS+=( 'SSH_HPN' )
1327 -
1328 - if [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1329 - einfo "Disabling known non-working MT AES cipher per default ..."
1330 -
1331 - cat > "${T}"/disable_mtaes.conf <<- EOF
1332 -
1333 - # HPN's Multi-Threaded AES CTR cipher is currently known to be broken
1334 - # and therefore disabled per default.
1335 - DisableMTAES yes
1336 - EOF
1337 - sed -i \
1338 - -e "/^#HPNDisabled.*/r ${T}/disable_mtaes.conf" \
1339 - "${S}"/sshd_config || die "Failed to disabled MT AES ciphers in sshd_config"
1340 -
1341 - sed -i \
1342 - -e "/AcceptEnv.*_XXX_TEST$/a \\\tDisableMTAES\t\tyes" \
1343 - "${S}"/regress/test-exec.sh || die "Failed to disable MT AES ciphers in test config"
1344 - fi
1345 - fi
1346 -
1347 - if use X509 || use hpn ; then
1348 - einfo "Patching packet.c for X509 and/or HPN patch set ..."
1349 - sed -i \
1350 - -e "s/const struct sshcipher/struct sshcipher/" \
1351 - "${S}"/packet.c || die "Failed to patch ssh_packet_set_connection() (packet.c)"
1352 - fi
1353 -
1354 - if use X509 || use sctp || use ldap || use hpn ; then
1355 - einfo "Patching sshconnect.c to use SSH_RELEASE in send_client_banner() ..."
1356 - sed -i \
1357 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1358 - "${S}"/sshconnect.c || die "Failed to patch send_client_banner() to use SSH_RELEASE (sshconnect.c)"
1359 -
1360 - einfo "Patching sshd.c to use SSH_RELEASE in sshd_exchange_identification() ..."
1361 - sed -i \
1362 - -e "s/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION/PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE/" \
1363 - "${S}"/sshd.c || die "Failed to patch sshd_exchange_identification() to use SSH_RELEASE (sshd.c)"
1364 -
1365 - einfo "Patching version.h to add our patch sets to SSH_RELEASE ..."
1366 - sed -i \
1367 - -e "s/^#define SSH_RELEASE.*/#define SSH_RELEASE SSH_VERSION SSH_PORTABLE ${PATCHSET_VERSION_MACROS[*]}/" \
1368 - "${S}"/version.h || die "Failed to patch SSH_RELEASE (version.h)"
1369 - fi
1370 -
1371 - sed -i \
1372 - -e "/#UseLogin no/d" \
1373 - "${S}"/sshd_config || die "Failed to remove removed UseLogin option (sshd_config)"
1374 -
1375 - eapply "${WORKDIR}"/patch/*.patch
1376 -
1377 - eapply_user #473004
1378 -
1379 - tc-export PKG_CONFIG
1380 - local sed_args=(
1381 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1382 - # Disable PATH reset, trust what portage gives us #254615
1383 - -e 's:^PATH=/:#PATH=/:'
1384 - # Disable fortify flags ... our gcc does this for us
1385 - -e 's:-D_FORTIFY_SOURCE=2::'
1386 - )
1387 -
1388 - # The -ftrapv flag ICEs on hppa #505182
1389 - use hppa && sed_args+=(
1390 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
1391 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
1392 - )
1393 - # _XOPEN_SOURCE causes header conflicts on Solaris
1394 - [[ ${CHOST} == *-solaris* ]] && sed_args+=(
1395 - -e 's/-D_XOPEN_SOURCE//'
1396 - )
1397 - sed -i "${sed_args[@]}" configure{.ac,} || die
1398 -
1399 - eautoreconf
1400 -}
1401 -
1402 -src_configure() {
1403 - addwrite /dev/ptmx
1404 -
1405 - use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
1406 - use static && append-ldflags -static
1407 -
1408 - local myconf=(
1409 - --with-ldflags="${LDFLAGS}"
1410 - --disable-strip
1411 - --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
1412 - --sysconfdir="${EPREFIX%/}"/etc/ssh
1413 - --libexecdir="${EPREFIX%/}"/usr/$(get_libdir)/misc
1414 - --datadir="${EPREFIX%/}"/usr/share/openssh
1415 - --with-privsep-path="${EPREFIX%/}"/var/empty
1416 - --with-privsep-user=sshd
1417 - $(use_with audit audit linux)
1418 - $(use_with kerberos kerberos5 "${EPREFIX%/}"/usr)
1419 - # We apply the ldap and sctp patch conditionally, so can't pass --without-{ldap,sctp}
1420 - # unconditionally else we get unknown flag warnings.
1421 - $(use ldap && use_with ldap)
1422 - $(use sctp && use_with sctp)
1423 - $(use_with ldns)
1424 - $(use_with libedit)
1425 - $(use_with pam)
1426 - $(use_with pie)
1427 - $(use_with selinux)
1428 - $(use_with skey)
1429 - $(use_with ssl openssl)
1430 - $(use_with ssl md5-passwords)
1431 - $(use_with ssl ssl-engine)
1432 - )
1433 -
1434 - # stackprotect is broken on musl x86
1435 - use elibc_musl && use x86 && myconf+=( --without-stackprotect )
1436 -
1437 - # The seccomp sandbox is broken on x32, so use the older method for now. #553748
1438 - use amd64 && [[ ${ABI} == "x32" ]] && myconf+=( --with-sandbox=rlimit )
1439 -
1440 - econf "${myconf[@]}"
1441 -}
1442 -
1443 -src_test() {
1444 - local t skipped=() failed=() passed=()
1445 - local tests=( interop-tests compat-tests )
1446 -
1447 - local shell=$(egetshell "${UID}")
1448 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1449 - elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'"
1450 - elog "user, so we will run a subset only."
1451 - skipped+=( tests )
1452 - else
1453 - tests+=( tests )
1454 - fi
1455 -
1456 - # It will also attempt to write to the homedir .ssh.
1457 - local sshhome=${T}/homedir
1458 - mkdir -p "${sshhome}"/.ssh
1459 - for t in "${tests[@]}" ; do
1460 - # Some tests read from stdin ...
1461 - HOMEDIR="${sshhome}" HOME="${sshhome}" \
1462 - emake -k -j1 ${t} </dev/null \
1463 - && passed+=( "${t}" ) \
1464 - || failed+=( "${t}" )
1465 - done
1466 -
1467 - einfo "Passed tests: ${passed[*]}"
1468 - [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}"
1469 - [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}"
1470 -}
1471 -
1472 -# Gentoo tweaks to default config files.
1473 -tweak_ssh_configs() {
1474 - local locale_vars=(
1475 - # These are language variables that POSIX defines.
1476 - # http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
1477 - LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
1478 -
1479 - # These are the GNU extensions.
1480 - # https://www.gnu.org/software/autoconf/manual/html_node/Special-Shell-Variables.html
1481 - LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
1482 - )
1483 -
1484 - # First the server config.
1485 - cat <<-EOF >> "${ED%/}"/etc/ssh/sshd_config
1486 -
1487 - # Allow client to pass locale environment variables. #367017
1488 - AcceptEnv ${locale_vars[*]}
1489 -
1490 - # Allow client to pass COLORTERM to match TERM. #658540
1491 - AcceptEnv COLORTERM
1492 - EOF
1493 -
1494 - # Then the client config.
1495 - cat <<-EOF >> "${ED%/}"/etc/ssh/ssh_config
1496 -
1497 - # Send locale environment variables. #367017
1498 - SendEnv ${locale_vars[*]}
1499 -
1500 - # Send COLORTERM to match TERM. #658540
1501 - SendEnv COLORTERM
1502 - EOF
1503 -
1504 - if use pam ; then
1505 - sed -i \
1506 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1507 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1508 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1509 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1510 - "${ED%/}"/etc/ssh/sshd_config || die
1511 - fi
1512 -
1513 - if use livecd ; then
1514 - sed -i \
1515 - -e '/^#PermitRootLogin/c# Allow root login with password on livecds.\nPermitRootLogin Yes' \
1516 - "${ED%/}"/etc/ssh/sshd_config || die
1517 - fi
1518 -}
1519 -
1520 -src_install() {
1521 - emake install-nokeys DESTDIR="${D}"
1522 - fperms 600 /etc/ssh/sshd_config
1523 - dobin contrib/ssh-copy-id
1524 - newinitd "${FILESDIR}"/sshd.rc6.5 sshd
1525 - newconfd "${FILESDIR}"/sshd-r1.confd sshd
1526 -
1527 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1528 -
1529 - tweak_ssh_configs
1530 -
1531 - if use ldap && [[ -n ${LDAP_PATCH} ]] ; then
1532 - insinto /etc/openldap/schema/
1533 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1534 - fi
1535 -
1536 - doman contrib/ssh-copy-id.1
1537 - dodoc CREDITS OVERVIEW README* TODO sshd_config
1538 - use hpn && dodoc HPN-README
1539 - use X509 || dodoc ChangeLog
1540 -
1541 - diropts -m 0700
1542 - dodir /etc/skel/.ssh
1543 -
1544 - keepdir /var/empty
1545 -
1546 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1547 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1548 -}
1549 -
1550 -pkg_preinst() {
1551 - enewgroup sshd 22
1552 - enewuser sshd 22 -1 /var/empty sshd
1553 -}
1554 -
1555 -pkg_postinst() {
1556 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1557 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1558 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1559 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1560 - fi
1561 - if has_version "<${CATEGORY}/${PN}-7.0_p1" ; then
1562 - elog "Starting with openssh-6.7, support for USE=tcpd has been dropped by upstream."
1563 - elog "Make sure to update any configs that you might have. Note that xinetd might"
1564 - elog "be an alternative for you as it supports USE=tcpd."
1565 - fi
1566 - if has_version "<${CATEGORY}/${PN}-7.1_p1" ; then #557388 #555518
1567 - elog "Starting with openssh-7.0, support for ssh-dss keys were disabled due to their"
1568 - elog "weak sizes. If you rely on these key types, you can re-enable the key types by"
1569 - elog "adding to your sshd_config or ~/.ssh/config files:"
1570 - elog " PubkeyAcceptedKeyTypes=+ssh-dss"
1571 - elog "You should however generate new keys using rsa or ed25519."
1572 -
1573 - elog "Starting with openssh-7.0, the default for PermitRootLogin changed from 'yes'"
1574 - elog "to 'prohibit-password'. That means password auth for root users no longer works"
1575 - elog "out of the box. If you need this, please update your sshd_config explicitly."
1576 - fi
1577 - if has_version "<${CATEGORY}/${PN}-7.6_p1" ; then
1578 - elog "Starting with openssh-7.6p1, openssh upstream has removed ssh1 support entirely."
1579 - elog "Furthermore, rsa keys with less than 1024 bits will be refused."
1580 - fi
1581 - if ! use ssl && has_version "${CATEGORY}/${PN}[ssl]" ; then
1582 - elog "Be aware that by disabling openssl support in openssh, the server and clients"
1583 - elog "no longer support dss/rsa/ecdsa keys. You will need to generate ed25519 keys"
1584 - elog "and update all clients/servers that utilize them."
1585 - fi
1586 -
1587 - if use hpn && [[ -n "${HPN_DISABLE_MTAES}" ]] ; then
1588 - elog ""
1589 - elog "HPN's multi-threaded AES CTR cipher is currently known to be broken"
1590 - elog "and therefore disabled at runtime per default."
1591 - elog "Make sure your sshd_config is up to date and contains"
1592 - elog ""
1593 - elog " DisableMTAES yes"
1594 - elog ""
1595 - elog "Otherwise you maybe unable to connect to this sshd using any AES CTR cipher."
1596 - elog ""
1597 - fi
1598 -}