Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: net-misc/openssh/files/, net-misc/openssh/
Date: Wed, 31 Dec 2014 18:23:24
Message-Id: 1420050231.10c887587f0221a5ecd59b10fdc37f717629da74.blueness@gentoo.org@gentoo
1 commit: 10c887587f0221a5ecd59b10fdc37f717629da74
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 31 18:23:51 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 31 18:23:51 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=10c88758
7
8 net-misc/openssh: makre 6.7_p1 stable on all arches
9
10 Package-Manager: portage-2.2.14
11 Manifest-Sign-Key: 0xF52D4BBA
12
13 ---
14 .../openssh-5.9_p1-sshd-gssapi-multihomed.patch | 184 --------
15 .../openssh/files/openssh-6.4p1-avoid-exit.patch | 499 ---------------------
16 .../files/openssh-6.5_p1-hpn-cipher-align.patch | 114 -----
17 .../openssh-6.6.1_p1-x509-hpn14v4-glue-p2.patch | 26 --
18 net-misc/openssh/files/openssh-6.6.1_p1.patch | 167 -------
19 .../openssh-6.6_p1-openssl-ignore-status.patch | 17 -
20 .../openssh/files/openssh-6.6_p1-x509-glue.patch | 16 -
21 .../openssh-6.6_p1-x509-hpn14v4-glue-p2.patch | 26 --
22 net-misc/openssh/metadata.xml | 1 +
23 net-misc/openssh/openssh-6.6.1_p1-r99.ebuild | 323 -------------
24 net-misc/openssh/openssh-6.6_p1-r99.ebuild | 320 -------------
25 net-misc/openssh/openssh-6.7_p1-r99.ebuild | 2 +-
26 12 files changed, 2 insertions(+), 1693 deletions(-)
27
28 diff --git a/net-misc/openssh/files/openssh-5.9_p1-sshd-gssapi-multihomed.patch b/net-misc/openssh/files/openssh-5.9_p1-sshd-gssapi-multihomed.patch
29 deleted file mode 100644
30 index 6377d03..0000000
31 --- a/net-misc/openssh/files/openssh-5.9_p1-sshd-gssapi-multihomed.patch
32 +++ /dev/null
33 @@ -1,184 +0,0 @@
34 -Index: gss-serv.c
35 -===================================================================
36 -RCS file: /cvs/src/usr.bin/ssh/gss-serv.c,v
37 -retrieving revision 1.22
38 -diff -u -p -r1.22 gss-serv.c
39 ---- gss-serv.c 8 May 2008 12:02:23 -0000 1.22
40 -+++ gss-serv.c 11 Jan 2010 05:38:29 -0000
41 -@@ -41,9 +41,12 @@
42 - #include "channels.h"
43 - #include "session.h"
44 - #include "misc.h"
45 -+#include "servconf.h"
46 -
47 - #include "ssh-gss.h"
48 -
49 -+extern ServerOptions options;
50 -+
51 - static ssh_gssapi_client gssapi_client =
52 - { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
53 - GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL}};
54 -@@ -77,25 +80,32 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx)
55 - char lname[MAXHOSTNAMELEN];
56 - gss_OID_set oidset;
57 -
58 -- gss_create_empty_oid_set(&status, &oidset);
59 -- gss_add_oid_set_member(&status, ctx->oid, &oidset);
60 --
61 -- if (gethostname(lname, MAXHOSTNAMELEN)) {
62 -- gss_release_oid_set(&status, &oidset);
63 -- return (-1);
64 -- }
65 -+ if (options.gss_strict_acceptor) {
66 -+ gss_create_empty_oid_set(&status, &oidset);
67 -+ gss_add_oid_set_member(&status, ctx->oid, &oidset);
68 -+
69 -+ if (gethostname(lname, MAXHOSTNAMELEN)) {
70 -+ gss_release_oid_set(&status, &oidset);
71 -+ return (-1);
72 -+ }
73 -+
74 -+ if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
75 -+ gss_release_oid_set(&status, &oidset);
76 -+ return (ctx->major);
77 -+ }
78 -+
79 -+ if ((ctx->major = gss_acquire_cred(&ctx->minor,
80 -+ ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds,
81 -+ NULL, NULL)))
82 -+ ssh_gssapi_error(ctx);
83 -
84 -- if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
85 - gss_release_oid_set(&status, &oidset);
86 - return (ctx->major);
87 -+ } else {
88 -+ ctx->name = GSS_C_NO_NAME;
89 -+ ctx->creds = GSS_C_NO_CREDENTIAL;
90 - }
91 --
92 -- if ((ctx->major = gss_acquire_cred(&ctx->minor,
93 -- ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL)))
94 -- ssh_gssapi_error(ctx);
95 --
96 -- gss_release_oid_set(&status, &oidset);
97 -- return (ctx->major);
98 -+ return GSS_S_COMPLETE;
99 - }
100 -
101 - /* Privileged */
102 -Index: servconf.c
103 -===================================================================
104 -RCS file: /cvs/src/usr.bin/ssh/servconf.c,v
105 -retrieving revision 1.201
106 -diff -u -p -r1.201 servconf.c
107 ---- servconf.c 10 Jan 2010 03:51:17 -0000 1.201
108 -+++ servconf.c 11 Jan 2010 05:34:56 -0000
109 -@@ -86,6 +86,7 @@ initialize_server_options(ServerOptions
110 - options->kerberos_get_afs_token = -1;
111 - options->gss_authentication=-1;
112 - options->gss_cleanup_creds = -1;
113 -+ options->gss_strict_acceptor = -1;
114 - options->password_authentication = -1;
115 - options->kbd_interactive_authentication = -1;
116 - options->challenge_response_authentication = -1;
117 -@@ -200,6 +201,8 @@ fill_default_server_options(ServerOption
118 - options->gss_authentication = 0;
119 - if (options->gss_cleanup_creds == -1)
120 - options->gss_cleanup_creds = 1;
121 -+ if (options->gss_strict_acceptor == -1)
122 -+ options->gss_strict_acceptor = 0;
123 - if (options->password_authentication == -1)
124 - options->password_authentication = 1;
125 - if (options->kbd_interactive_authentication == -1)
126 -@@ -277,7 +280,8 @@ typedef enum {
127 - sBanner, sUseDNS, sHostbasedAuthentication,
128 - sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
129 - sClientAliveCountMax, sAuthorizedKeysFile,
130 -- sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
131 -+ sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor,
132 -+ sAcceptEnv, sPermitTunnel,
133 - sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
134 - sUsePrivilegeSeparation, sAllowAgentForwarding,
135 - sZeroKnowledgePasswordAuthentication, sHostCertificate,
136 -@@ -327,9 +331,11 @@ static struct {
137 - #ifdef GSSAPI
138 - { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL },
139 - { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL },
140 -+ { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL },
141 - #else
142 - { "gssapiauthentication", sUnsupported, SSHCFG_ALL },
143 - { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
144 -+ { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL },
145 - #endif
146 - { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL },
147 - { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL },
148 -@@ -850,6 +856,10 @@ process_server_config_line(ServerOptions
149 -
150 - case sGssCleanupCreds:
151 - intptr = &options->gss_cleanup_creds;
152 -+ goto parse_flag;
153 -+
154 -+ case sGssStrictAcceptor:
155 -+ intptr = &options->gss_strict_acceptor;
156 - goto parse_flag;
157 -
158 - case sPasswordAuthentication:
159 -Index: servconf.h
160 -===================================================================
161 -RCS file: /cvs/src/usr.bin/ssh/servconf.h,v
162 -retrieving revision 1.89
163 -diff -u -p -r1.89 servconf.h
164 ---- servconf.h 9 Jan 2010 23:04:13 -0000 1.89
165 -+++ servconf.h 11 Jan 2010 05:32:28 -0000
166 -@@ -92,6 +92,7 @@ typedef struct {
167 - * authenticated with Kerberos. */
168 - int gss_authentication; /* If true, permit GSSAPI authentication */
169 - int gss_cleanup_creds; /* If true, destroy cred cache on logout */
170 -+ int gss_strict_acceptor; /* If true, restrict the GSSAPI acceptor name */
171 - int password_authentication; /* If true, permit password
172 - * authentication. */
173 - int kbd_interactive_authentication; /* If true, permit */
174 -Index: sshd_config
175 -===================================================================
176 -RCS file: /cvs/src/usr.bin/ssh/sshd_config,v
177 -retrieving revision 1.81
178 -diff -u -p -r1.81 sshd_config
179 ---- sshd_config 8 Oct 2009 14:03:41 -0000 1.81
180 -+++ sshd_config 11 Jan 2010 05:32:28 -0000
181 -@@ -69,6 +69,7 @@
182 - # GSSAPI options
183 - #GSSAPIAuthentication no
184 - #GSSAPICleanupCredentials yes
185 -+#GSSAPIStrictAcceptorCheck yes
186 -
187 - # Set this to 'yes' to enable PAM authentication, account processing,
188 - # and session processing. If this is enabled, PAM authentication will
189 -Index: sshd_config.5
190 -===================================================================
191 -RCS file: /cvs/src/usr.bin/ssh/sshd_config.5,v
192 -retrieving revision 1.116
193 -diff -u -p -r1.116 sshd_config.5
194 ---- sshd_config.5 9 Jan 2010 23:04:13 -0000 1.116
195 -+++ sshd_config.5 11 Jan 2010 05:37:20 -0000
196 -@@ -386,6 +386,21 @@ on logout.
197 - The default is
198 - .Dq yes .
199 - Note that this option applies to protocol version 2 only.
200 -+.It Cm GSSAPIStrictAcceptorCheck
201 -+Determines whether to be strict about the identity of the GSSAPI acceptor
202 -+a client authenticates against.
203 -+If set to
204 -+.Dq yes
205 -+then the client must authenticate against the
206 -+.Pa host
207 -+service on the current hostname.
208 -+If set to
209 -+.Dq no
210 -+then the client may authenticate against any service key stored in the
211 -+machine's default store.
212 -+This facility is provided to assist with operation on multi homed machines.
213 -+The default is
214 -+.Dq yes .
215 - .It Cm HostbasedAuthentication
216 - Specifies whether rhosts or /etc/hosts.equiv authentication together
217 - with successful public key client host authentication is allowed
218
219 diff --git a/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch b/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch
220 deleted file mode 100644
221 index 4c02aeb..0000000
222 --- a/net-misc/openssh/files/openssh-6.4p1-avoid-exit.patch
223 +++ /dev/null
224 @@ -1,499 +0,0 @@
225 -diff -Nuar openssh-6.4p1.orig/configure.ac openssh-6.4p1/configure.ac
226 ---- openssh-6.4p1.orig/configure.ac 2014-01-22 17:05:13.463582250 +0000
227 -+++ openssh-6.4p1/configure.ac 2014-01-22 17:13:08.102608790 +0000
228 -@@ -223,7 +223,7 @@
229 - [AC_LANG_PROGRAM([[
230 - #include <stdlib.h>
231 - __attribute__((__unused__)) static void foo(void){return;}]],
232 -- [[ exit(0); ]])],
233 -+ [[ return 0; ]])],
234 - [ AC_MSG_RESULT([yes]) ],
235 - [ AC_MSG_RESULT([no])
236 - AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1,
237 -@@ -410,7 +410,7 @@
238 - [AC_LANG_PROGRAM([[
239 - #define testmacro foo
240 - #define testmacro bar]],
241 -- [[ exit(0); ]])],
242 -+ [[ return 0; ]])],
243 - [ AC_MSG_RESULT([yes]) ],
244 - [ AC_MSG_RESULT([no])
245 - CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
246 -@@ -526,9 +526,9 @@
247 - AC_MSG_CHECKING([if we have working getaddrinfo])
248 - AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
249 - main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
250 -- exit(0);
251 -+ return 0;
252 - else
253 -- exit(1);
254 -+ return 1;
255 - }
256 - ]])],
257 - [AC_MSG_RESULT([working])],
258 -@@ -1016,7 +1016,7 @@
259 - esac
260 -
261 - AC_MSG_CHECKING([compiler and flags for sanity])
262 --AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
263 -+AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ return 0; ]])],
264 - [ AC_MSG_RESULT([yes]) ],
265 - [
266 - AC_MSG_RESULT([no])
267 -@@ -1048,9 +1048,9 @@
268 - strncpy(buf,"/etc", 32);
269 - s = dirname(buf);
270 - if (!s || strncmp(s, "/", 32) != 0) {
271 -- exit(1);
272 -+ return 1;
273 - } else {
274 -- exit(0);
275 -+ return 0;
276 - }
277 - }
278 - ]])],
279 -@@ -1140,19 +1140,19 @@
280 - int a=0, b=0, c=0, d=0, n, v;
281 - n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
282 - if (n != 3 && n != 4)
283 -- exit(1);
284 -+ return 1;
285 - v = a*1000000 + b*10000 + c*100 + d;
286 - fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
287 -
288 - /* 1.1.4 is OK */
289 - if (a == 1 && b == 1 && c >= 4)
290 -- exit(0);
291 -+ return 0;
292 -
293 - /* 1.2.3 and up are OK */
294 - if (v >= 1020300)
295 -- exit(0);
296 -+ return 0;
297 -
298 -- exit(2);
299 -+ return 2;
300 - ]])],
301 - AC_MSG_RESULT([no]),
302 - [ AC_MSG_RESULT([yes])
303 -@@ -1254,7 +1254,7 @@
304 - #include <dirent.h>]],
305 - [[
306 - struct dirent d;
307 -- exit(sizeof(d.d_name)<=sizeof(char));
308 -+ return (sizeof(d.d_name)<=sizeof(char));
309 - ]])],
310 - [AC_MSG_RESULT([yes])],
311 - [
312 -@@ -1300,7 +1300,7 @@
313 - #include <skey.h>
314 - ]], [[
315 - char *ff = skey_keyinfo(""); ff="";
316 -- exit(0);
317 -+ return 0;
318 - ]])],
319 - [AC_MSG_RESULT([yes])],
320 - [
321 -@@ -1405,7 +1405,7 @@
322 - #include <stdlib.h>
323 - #include <stdint.h>
324 - #include <ldns/ldns.h>
325 --int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); }
326 -+int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; return 0; }
327 - ]])
328 - ],
329 - [AC_MSG_RESULT(yes)],
330 -@@ -1462,7 +1462,7 @@
331 - [[
332 - int i = H_SETSIZE;
333 - el_init("", NULL, NULL, NULL);
334 -- exit(0);
335 -+ return 0;
336 - ]])],
337 - [ AC_MSG_RESULT([yes]) ],
338 - [ AC_MSG_RESULT([no])
339 -@@ -1757,9 +1757,9 @@
340 - errno=0;
341 - setresuid(0,0,0);
342 - if (errno==ENOSYS)
343 -- exit(1);
344 -+ return 1;
345 - else
346 -- exit(0);
347 -+ return 0;
348 - ]])],
349 - [AC_MSG_RESULT([yes])],
350 - [AC_DEFINE([BROKEN_SETRESUID], [1],
351 -@@ -1780,9 +1780,9 @@
352 - errno=0;
353 - setresgid(0,0,0);
354 - if (errno==ENOSYS)
355 -- exit(1);
356 -+ return 1;
357 - else
358 -- exit(0);
359 -+ return 0;
360 - ]])],
361 - [AC_MSG_RESULT([yes])],
362 - [AC_DEFINE([BROKEN_SETRESGID], [1],
363 -@@ -1824,7 +1824,7 @@
364 - [[
365 - char b[5];
366 - snprintf(b,5,"123456789");
367 -- exit(b[4]!='\0');
368 -+ return (b[4]!='\0');
369 - ]])],
370 - [AC_MSG_RESULT([yes])],
371 - [
372 -@@ -1857,7 +1857,7 @@
373 - }
374 - ]], [[
375 - char x[1];
376 -- exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
377 -+ return (x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
378 - ]])],
379 - [AC_MSG_RESULT([yes])],
380 - [
381 -@@ -1909,9 +1909,9 @@
382 - ]], [[
383 - char template[]="conftest.mkstemp-test";
384 - if (mkstemp(template) == -1)
385 -- exit(1);
386 -+ return 1;
387 - unlink(template);
388 -- exit(0);
389 -+ return 0;
390 - ]])],
391 - [
392 - AC_MSG_RESULT([no])
393 -@@ -1942,22 +1942,22 @@
394 -
395 - pid = fork();
396 - if (pid < 0) { /* failed */
397 -- exit(1);
398 -+ return 1;
399 - } else if (pid > 0) { /* parent */
400 - waitpid(pid, &status, 0);
401 - if (WIFEXITED(status))
402 -- exit(WEXITSTATUS(status));
403 -+ return (WEXITSTATUS(status));
404 - else
405 -- exit(2);
406 -+ return 2;
407 - } else { /* child */
408 - close(0); close(1); close(2);
409 - setsid();
410 - openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
411 - fd = open("/dev/tty", O_RDWR | O_NOCTTY);
412 - if (fd >= 0)
413 -- exit(3); /* Acquired ctty: broken */
414 -+ return 3; /* Acquired ctty: broken */
415 - else
416 -- exit(0); /* Did not acquire ctty: OK */
417 -+ return 0; /* Did not acquire ctty: OK */
418 - }
419 - ]])],
420 - [
421 -@@ -1998,7 +1998,7 @@
422 - err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
423 - if (err != 0) {
424 - fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
425 -- exit(1);
426 -+ return 1;
427 - }
428 -
429 - for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
430 -@@ -2015,7 +2015,7 @@
431 - else
432 - fprintf(stderr, "getnameinfo failed: %s\n",
433 - gai_strerror(err));
434 -- exit(2);
435 -+ return 2;
436 - }
437 -
438 - sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
439 -@@ -2023,10 +2023,10 @@
440 - perror("socket");
441 - if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
442 - if (errno == EBADF)
443 -- exit(3);
444 -+ return 3;
445 - }
446 - }
447 -- exit(0);
448 -+ return 0;
449 - ]])],
450 - [
451 - AC_MSG_RESULT([yes])
452 -@@ -2066,7 +2066,7 @@
453 - err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
454 - if (err != 0) {
455 - fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
456 -- exit(1);
457 -+ return 1;
458 - }
459 -
460 - for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
461 -@@ -2079,10 +2079,10 @@
462 -
463 - if (ai->ai_family == AF_INET && err != 0) {
464 - perror("getnameinfo");
465 -- exit(2);
466 -+ return 2;
467 - }
468 - }
469 -- exit(0);
470 -+ return 0;
471 - ]])],
472 - [
473 - AC_MSG_RESULT([yes])
474 -@@ -2103,7 +2103,7 @@
475 - if test "x$check_for_conflicting_getspnam" = "x1"; then
476 - AC_MSG_CHECKING([for conflicting getspnam in shadow.h])
477 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]],
478 -- [[ exit(0); ]])],
479 -+ [[ return 0; ]])],
480 - [
481 - AC_MSG_RESULT([no])
482 - ],
483 -@@ -2191,12 +2191,12 @@
484 -
485 - fd = fopen(DATA,"w");
486 - if(fd == NULL)
487 -- exit(1);
488 -+ return 1;
489 -
490 - if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
491 -- exit(1);
492 -+ return 1;
493 -
494 -- exit(0);
495 -+ return 0;
496 - ]])],
497 - [
498 - ssl_header_ver=`cat conftest.sslincver`
499 -@@ -2226,12 +2226,12 @@
500 -
501 - fd = fopen(DATA,"w");
502 - if(fd == NULL)
503 -- exit(1);
504 -+ return 1;
505 -
506 - if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
507 -- exit(1);
508 -+ return 1;
509 -
510 -- exit(0);
511 -+ return 0;
512 - ]])],
513 - [
514 - ssl_library_ver=`cat conftest.ssllibver`
515 -@@ -2261,7 +2261,7 @@
516 - #include <string.h>
517 - #include <openssl/opensslv.h>
518 - ]], [[
519 -- exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
520 -+ return (SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
521 - ]])],
522 - [
523 - AC_MSG_RESULT([yes])
524 -@@ -2339,7 +2339,7 @@
525 - #include <string.h>
526 - #include <openssl/evp.h>
527 - ]], [[
528 -- exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
529 -+ return (EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
530 - ]])],
531 - [
532 - AC_MSG_RESULT([no])
533 -@@ -2358,7 +2358,7 @@
534 - #include <string.h>
535 - #include <openssl/evp.h>
536 - ]], [[
537 -- exit(EVP_aes_128_ctr() == NULL ||
538 -+ return (EVP_aes_128_ctr() == NULL ||
539 - EVP_aes_192_cbc() == NULL ||
540 - EVP_aes_256_cbc() == NULL);
541 - ]])],
542 -@@ -2379,7 +2379,7 @@
543 - #include <string.h>
544 - #include <openssl/evp.h>
545 - ]], [[
546 -- exit(EVP_aes_128_gcm() == NULL ||
547 -+ return (EVP_aes_128_gcm() == NULL ||
548 - EVP_aes_256_gcm() == NULL ||
549 - EVP_CTRL_GCM_SET_IV_FIXED == 0 ||
550 - EVP_CTRL_GCM_IV_GEN == 0 ||
551 -@@ -2410,7 +2410,7 @@
552 - #include <openssl/evp.h>
553 - ]], [[
554 - if(EVP_DigestUpdate(NULL, NULL,0))
555 -- exit(0);
556 -+ return 0;
557 - ]])],
558 - [
559 - AC_MSG_RESULT([yes])
560 -@@ -2505,7 +2505,7 @@
561 - #include <string.h>
562 - #include <openssl/rand.h>
563 - ]], [[
564 -- exit(RAND_status() == 1 ? 0 : 1);
565 -+ return (RAND_status() == 1 ? 0 : 1);
566 - ]])],
567 - [
568 - OPENSSL_SEEDS_ITSELF=yes
569 -@@ -2702,7 +2702,7 @@
570 - [[ int i = $seccomp_audit_arch;
571 - errno = 0;
572 - prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
573 -- exit(errno == EFAULT ? 0 : 1); ]])],
574 -+ return (errno == EFAULT ? 0 : 1); ]])],
575 - [ AC_MSG_RESULT([yes]) ], [
576 - AC_MSG_RESULT([no])
577 - # Disable seccomp filter as a target
578 -@@ -2756,7 +2756,7 @@
579 - tv.tv_sec = 1;
580 - tv.tv_usec = 0;
581 - r = select(fd+1, &fds, NULL, NULL, &tv);
582 -- exit (r == -1 ? 1 : 0);
583 -+ return (r == -1 ? 1 : 0);
584 - ]])],
585 - [AC_MSG_RESULT([yes])
586 - select_works_with_rlimit=yes],
587 -@@ -2782,7 +2782,7 @@
588 -
589 - rl_zero.rlim_cur = rl_zero.rlim_max = 0;
590 - r = setrlimit(RLIMIT_NOFILE, &rl_zero);
591 -- exit (r == -1 ? 1 : 0);
592 -+ return (r == -1 ? 1 : 0);
593 - ]])],
594 - [AC_MSG_RESULT([yes])
595 - rlimit_nofile_zero_works=yes],
596 -@@ -2801,7 +2801,7 @@
597 - struct rlimit rl_zero;
598 -
599 - rl_zero.rlim_cur = rl_zero.rlim_max = 0;
600 -- exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
601 -+ return (setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
602 - ]])],
603 - [AC_MSG_RESULT([yes])],
604 - [AC_MSG_RESULT([no])
605 -@@ -2925,7 +2925,7 @@
606 - long long i, llmin, llmax = 0;
607 -
608 - if((f = fopen(DATA,"w")) == NULL)
609 -- exit(1);
610 -+ return 1;
611 -
612 - #if defined(LLONG_MIN) && defined(LLONG_MAX)
613 - fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
614 -@@ -2944,16 +2944,16 @@
615 - || llmax - 1 > llmax || llmin == llmax || llmin == 0
616 - || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
617 - fprintf(f, "unknown unknown\n");
618 -- exit(2);
619 -+ return 2;
620 - }
621 -
622 - if (fprint_ll(f, llmin) < 0)
623 -- exit(3);
624 -+ return 3;
625 - if (fprint_ll(f, llmax) < 0)
626 -- exit(4);
627 -+ return 4;
628 - if (fclose(f) < 0)
629 -- exit(5);
630 -- exit(0);
631 -+ return 5;
632 -+ return 0;
633 - ]])],
634 - [
635 - llong_min=`$AWK '{print $1}' conftest.llminmax`
636 -@@ -3337,11 +3337,11 @@
637 - strcpy(expected_out, "9223372036854775807");
638 - snprintf(buf, mazsize, "%lld", num);
639 - if(strcmp(buf, expected_out) != 0)
640 -- exit(1);
641 -- exit(0);
642 -+ return 1;
643 -+ return 0;
644 - }
645 - #else
646 --main() { exit(0); }
647 -+main() { return 0; }
648 - #endif
649 - ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ],
650 - AC_MSG_WARN([cross compiling: Assuming working snprintf()])
651 -@@ -3425,11 +3425,11 @@
652 - ]], [[
653 - #ifdef msg_accrights
654 - #error "msg_accrights is a macro"
655 --exit(1);
656 -+return 1;
657 - #endif
658 - struct msghdr m;
659 - m.msg_accrights = 0;
660 --exit(0);
661 -+return 0;
662 - ]])],
663 - [ ac_cv_have_accrights_in_msghdr="yes" ],
664 - [ ac_cv_have_accrights_in_msghdr="no" ]
665 -@@ -3486,11 +3486,11 @@
666 - ]], [[
667 - #ifdef msg_control
668 - #error "msg_control is a macro"
669 --exit(1);
670 -+return 1;
671 - #endif
672 - struct msghdr m;
673 - m.msg_control = 0;
674 --exit(0);
675 -+return 0;
676 - ]])],
677 - [ ac_cv_have_control_in_msghdr="yes" ],
678 - [ ac_cv_have_control_in_msghdr="no" ]
679 -@@ -3912,22 +3912,22 @@
680 -
681 - fd = fopen(DATA,"w");
682 - if(fd == NULL)
683 -- exit(1);
684 -+ return 1;
685 -
686 - #if defined (_PATH_MAILDIR)
687 - if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
688 -- exit(1);
689 -+ return 1;
690 - #elif defined (MAILDIR)
691 - if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
692 -- exit(1);
693 -+ return 1;
694 - #elif defined (_PATH_MAIL)
695 - if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
696 -- exit(1);
697 -+ return 1;
698 - #else
699 -- exit (2);
700 -+ return 2;
701 - #endif
702 -
703 -- exit(0);
704 -+ return 0;
705 - ]])],
706 - [
707 - maildir_what=`awk -F: '{print $1}' conftest.maildir`
708 -@@ -4162,12 +4162,12 @@
709 -
710 - fd = fopen(DATA,"w");
711 - if(fd == NULL)
712 -- exit(1);
713 -+ return 1;
714 -
715 - if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
716 -- exit(1);
717 -+ return 1;
718 -
719 -- exit(0);
720 -+ return 0;
721 - ]])],
722 - [ user_path=`cat conftest.stdpath` ],
723 - [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
724
725 diff --git a/net-misc/openssh/files/openssh-6.5_p1-hpn-cipher-align.patch b/net-misc/openssh/files/openssh-6.5_p1-hpn-cipher-align.patch
726 deleted file mode 100644
727 index cfb060f..0000000
728 --- a/net-misc/openssh/files/openssh-6.5_p1-hpn-cipher-align.patch
729 +++ /dev/null
730 @@ -1,114 +0,0 @@
731 -https://bugs.gentoo.org/498632
732 -
733 -make sure we do not use unaligned loads/stores as some arches really hate that.
734 -
735 ---- a/cipher-ctr-mt.c
736 -+++ b/cipher-ctr-mt.c
737 -@@ -58,8 +58,16 @@
738 - /* Collect thread stats and print at cancellation when in debug mode */
739 - /* #define CIPHER_THREAD_STATS */
740 -
741 --/* Use single-byte XOR instead of 8-byte XOR */
742 --/* #define CIPHER_BYTE_XOR */
743 -+/* Can the system do unaligned loads natively? */
744 -+#if defined(__aarch64__) || \
745 -+ defined(__i386__) || \
746 -+ defined(__powerpc__) || \
747 -+ defined(__x86_64__)
748 -+# define CIPHER_UNALIGNED_OK
749 -+#endif
750 -+#if defined(__SIZEOF_INT128__)
751 -+# define CIPHER_INT128_OK
752 -+#endif
753 - /*-------------------- END TUNABLES --------------------*/
754 -
755 -
756 -@@ -285,8 +293,20 @@ thread_loop(void *x)
757 -
758 - static int
759 - ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
760 -- u_int len)
761 -+ size_t len)
762 - {
763 -+ typedef union {
764 -+#ifdef CIPHER_INT128_OK
765 -+ __uint128_t *u128;
766 -+#endif
767 -+ uint64_t *u64;
768 -+ uint32_t *u32;
769 -+ uint8_t *u8;
770 -+ const uint8_t *cu8;
771 -+ uintptr_t u;
772 -+ } ptrs_t;
773 -+ ptrs_t destp, srcp, bufp;
774 -+ uintptr_t align;
775 - struct ssh_aes_ctr_ctx *c;
776 - struct kq *q, *oldq;
777 - int ridx;
778 -@@ -301,35 +321,41 @@ ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
779 - ridx = c->ridx;
780 -
781 - /* src already padded to block multiple */
782 -+ srcp.cu8 = src;
783 -+ destp.u8 = dest;
784 - while (len > 0) {
785 - buf = q->keys[ridx];
786 -+ bufp.u8 = buf;
787 -
788 --#ifdef CIPHER_BYTE_XOR
789 -- dest[0] = src[0] ^ buf[0];
790 -- dest[1] = src[1] ^ buf[1];
791 -- dest[2] = src[2] ^ buf[2];
792 -- dest[3] = src[3] ^ buf[3];
793 -- dest[4] = src[4] ^ buf[4];
794 -- dest[5] = src[5] ^ buf[5];
795 -- dest[6] = src[6] ^ buf[6];
796 -- dest[7] = src[7] ^ buf[7];
797 -- dest[8] = src[8] ^ buf[8];
798 -- dest[9] = src[9] ^ buf[9];
799 -- dest[10] = src[10] ^ buf[10];
800 -- dest[11] = src[11] ^ buf[11];
801 -- dest[12] = src[12] ^ buf[12];
802 -- dest[13] = src[13] ^ buf[13];
803 -- dest[14] = src[14] ^ buf[14];
804 -- dest[15] = src[15] ^ buf[15];
805 --#else
806 -- *(uint64_t *)dest = *(uint64_t *)src ^ *(uint64_t *)buf;
807 -- *(uint64_t *)(dest + 8) = *(uint64_t *)(src + 8) ^
808 -- *(uint64_t *)(buf + 8);
809 --#endif
810 -+ /* figure out the alignment on the fly */
811 -+#ifdef CIPHER_UNALIGNED_OK
812 -+ align = 0;
813 -+#else
814 -+ align = destp.u | srcp.u | bufp.u;
815 -+#endif
816 -+
817 -+#ifdef CIPHER_INT128_OK
818 -+ if ((align & 0xf) == 0) {
819 -+ destp.u128[0] = srcp.u128[0] ^ bufp.u128[0];
820 -+ } else
821 -+#endif
822 -+ if ((align & 0x7) == 0) {
823 -+ destp.u64[0] = srcp.u64[0] ^ bufp.u64[0];
824 -+ destp.u64[1] = srcp.u64[1] ^ bufp.u64[1];
825 -+ } else if ((align & 0x3) == 0) {
826 -+ destp.u32[0] = srcp.u32[0] ^ bufp.u32[0];
827 -+ destp.u32[1] = srcp.u32[1] ^ bufp.u32[1];
828 -+ destp.u32[2] = srcp.u32[2] ^ bufp.u32[2];
829 -+ destp.u32[3] = srcp.u32[3] ^ bufp.u32[3];
830 -+ } else {
831 -+ size_t i;
832 -+ for (i = 0; i < AES_BLOCK_SIZE; ++i)
833 -+ dest[i] = src[i] ^ buf[i];
834 -+ }
835 -
836 -- dest += 16;
837 -- src += 16;
838 -- len -= 16;
839 -+ destp.u += AES_BLOCK_SIZE;
840 -+ srcp.u += AES_BLOCK_SIZE;
841 -+ len -= AES_BLOCK_SIZE;
842 - ssh_ctr_inc(ctx->iv, AES_BLOCK_SIZE);
843 -
844 - /* Increment read index, switch queues on rollover */
845
846 diff --git a/net-misc/openssh/files/openssh-6.6.1_p1-x509-hpn14v4-glue-p2.patch b/net-misc/openssh/files/openssh-6.6.1_p1-x509-hpn14v4-glue-p2.patch
847 deleted file mode 100644
848 index c76015d..0000000
849 --- a/net-misc/openssh/files/openssh-6.6.1_p1-x509-hpn14v4-glue-p2.patch
850 +++ /dev/null
851 @@ -1,26 +0,0 @@
852 -make the hpn patch apply when the x509 patch has also been applied
853 -
854 ---- openssh-6.6.1p1-hpnssh14v4.diff
855 -+++ openssh-6.6.1p1-hpnssh14v4.diff
856 -@@ -1742,18 +1742,14 @@
857 - if (options->ip_qos_interactive == -1)
858 - options->ip_qos_interactive = IPTOS_LOWDELAY;
859 - if (options->ip_qos_bulk == -1)
860 --@@ -345,9 +393,10 @@
861 -+@@ -345,6 +393,7 @@
862 - sUsePrivilegeSeparation, sAllowAgentForwarding,
863 - sHostCertificate,
864 - sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
865 --+ sTcpRcvBufPoll, sHPNDisabled, sHPNBufferSize,
866 -++ sTcpRcvBufPoll, sHPNDisabled, sHPNBufferSize, sNoneEnabled,
867 - sKexAlgorithms, sIPQoS, sVersionAddendum,
868 - sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
869 --- sAuthenticationMethods, sHostKeyAgent,
870 --+ sAuthenticationMethods, sNoneEnabled, sHostKeyAgent,
871 -- sDeprecated, sUnsupported
872 -- } ServerOpCodes;
873 --
874 -+ sAuthenticationMethods, sHostKeyAgent,
875 - @@ -468,6 +517,10 @@
876 - { "revokedkeys", sRevokedKeys, SSHCFG_ALL },
877 - { "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL },
878
879 diff --git a/net-misc/openssh/files/openssh-6.6.1_p1.patch b/net-misc/openssh/files/openssh-6.6.1_p1.patch
880 deleted file mode 100644
881 index b11f6fb..0000000
882 --- a/net-misc/openssh/files/openssh-6.6.1_p1.patch
883 +++ /dev/null
884 @@ -1,167 +0,0 @@
885 -Hi,
886 -
887 -So I screwed up when writing the support for the curve25519 KEX method
888 -that doesn't depend on OpenSSL's BIGNUM type - a bug in my code left
889 -leading zero bytes where they should have been skipped. The impact of
890 -this is that OpenSSH 6.5 and 6.6 will fail during key exchange with a
891 -peer that implements curve25519-sha256 at libssh.org properly about 0.2%
892 -of the time (one in every 512ish connections).
893 -
894 -We've fixed this for OpenSSH 6.7 by avoiding the curve25519-sha256
895 -key exchange for previous versions, but I'd recommend distributors
896 -of OpenSSH apply this patch so the affected code doesn't become
897 -too entrenched in LTS releases.
898 -
899 -The patch fixes the bug and makes OpenSSH identify itself as 6.6.1 so as
900 -to distinguish itself from the incorrect versions so the compatibility
901 -code to disable the affected KEX isn't activated.
902 -
903 -I've committed this on the 6.6 branch too.
904 -
905 -Apologies for the hassle.
906 -
907 --d
908 -
909 -Index: version.h
910 -===================================================================
911 -RCS file: /var/cvs/openssh/version.h,v
912 -retrieving revision 1.82
913 -diff -u -p -r1.82 version.h
914 ---- version.h 27 Feb 2014 23:01:54 -0000 1.82
915 -+++ version.h 20 Apr 2014 03:35:15 -0000
916 -@@ -1,6 +1,6 @@
917 - /* $OpenBSD: version.h,v 1.70 2014/02/27 22:57:40 djm Exp $ */
918 -
919 --#define SSH_VERSION "OpenSSH_6.6"
920 -+#define SSH_VERSION "OpenSSH_6.6.1"
921 -
922 - #define SSH_PORTABLE "p1"
923 - #define SSH_RELEASE SSH_VERSION SSH_PORTABLE
924 -Index: compat.c
925 -===================================================================
926 -RCS file: /var/cvs/openssh/compat.c,v
927 -retrieving revision 1.82
928 -retrieving revision 1.85
929 -diff -u -p -r1.82 -r1.85
930 ---- compat.c 31 Dec 2013 01:25:41 -0000 1.82
931 -+++ compat.c 20 Apr 2014 03:33:59 -0000 1.85
932 -@@ -95,6 +95,9 @@ compat_datafellows(const char *version)
933 - { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF},
934 - { "OpenSSH_4*", 0 },
935 - { "OpenSSH_5*", SSH_NEW_OPENSSH|SSH_BUG_DYNAMIC_RPORT},
936 -+ { "OpenSSH_6.6.1*", SSH_NEW_OPENSSH},
937 -+ { "OpenSSH_6.5*,"
938 -+ "OpenSSH_6.6*", SSH_NEW_OPENSSH|SSH_BUG_CURVE25519PAD},
939 - { "OpenSSH*", SSH_NEW_OPENSSH },
940 - { "*MindTerm*", 0 },
941 - { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
942 -@@ -251,7 +254,6 @@ compat_cipher_proposal(char *cipher_prop
943 - return cipher_prop;
944 - }
945 -
946 --
947 - char *
948 - compat_pkalg_proposal(char *pkalg_prop)
949 - {
950 -@@ -263,5 +265,18 @@ compat_pkalg_proposal(char *pkalg_prop)
951 - if (*pkalg_prop == '\0')
952 - fatal("No supported PK algorithms found");
953 - return pkalg_prop;
954 -+}
955 -+
956 -+char *
957 -+compat_kex_proposal(char *kex_prop)
958 -+{
959 -+ if (!(datafellows & SSH_BUG_CURVE25519PAD))
960 -+ return kex_prop;
961 -+ debug2("%s: original KEX proposal: %s", __func__, kex_prop);
962 -+ kex_prop = filter_proposal(kex_prop, "curve25519-sha256 at libssh.org");
963 -+ debug2("%s: compat KEX proposal: %s", __func__, kex_prop);
964 -+ if (*kex_prop == '\0')
965 -+ fatal("No supported key exchange algorithms found");
966 -+ return kex_prop;
967 - }
968 -
969 -Index: compat.h
970 -===================================================================
971 -RCS file: /var/cvs/openssh/compat.h,v
972 -retrieving revision 1.42
973 -retrieving revision 1.43
974 -diff -u -p -r1.42 -r1.43
975 ---- compat.h 31 Dec 2013 01:25:41 -0000 1.42
976 -+++ compat.h 20 Apr 2014 03:25:31 -0000 1.43
977 -@@ -59,6 +59,7 @@
978 - #define SSH_BUG_RFWD_ADDR 0x02000000
979 - #define SSH_NEW_OPENSSH 0x04000000
980 - #define SSH_BUG_DYNAMIC_RPORT 0x08000000
981 -+#define SSH_BUG_CURVE25519PAD 0x10000000
982 -
983 - void enable_compat13(void);
984 - void enable_compat20(void);
985 -@@ -66,6 +67,7 @@ void compat_datafellows(const char *
986 - int proto_spec(const char *);
987 - char *compat_cipher_proposal(char *);
988 - char *compat_pkalg_proposal(char *);
989 -+char *compat_kex_proposal(char *);
990 -
991 - extern int compat13;
992 - extern int compat20;
993 -Index: sshd.c
994 -===================================================================
995 -RCS file: /var/cvs/openssh/sshd.c,v
996 -retrieving revision 1.448
997 -retrieving revision 1.453
998 -diff -u -p -r1.448 -r1.453
999 ---- sshd.c 26 Feb 2014 23:20:08 -0000 1.448
1000 -+++ sshd.c 20 Apr 2014 03:28:41 -0000 1.453
1001 -@@ -2462,6 +2438,9 @@ do_ssh2_kex(void)
1002 - if (options.kex_algorithms != NULL)
1003 - myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms;
1004 -
1005 -+ myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal(
1006 -+ myproposal[PROPOSAL_KEX_ALGS]);
1007 -+
1008 - if (options.rekey_limit || options.rekey_interval)
1009 - packet_set_rekey_limits((u_int32_t)options.rekey_limit,
1010 - (time_t)options.rekey_interval);
1011 -Index: sshconnect2.c
1012 -===================================================================
1013 -RCS file: /var/cvs/openssh/sshconnect2.c,v
1014 -retrieving revision 1.197
1015 -retrieving revision 1.199
1016 -diff -u -p -r1.197 -r1.199
1017 ---- sshconnect2.c 4 Feb 2014 00:20:16 -0000 1.197
1018 -+++ sshconnect2.c 20 Apr 2014 03:25:31 -0000 1.199
1019 -@@ -195,6 +196,8 @@ ssh_kex2(char *host, struct sockaddr *ho
1020 - }
1021 - if (options.kex_algorithms != NULL)
1022 - myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms;
1023 -+ myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal(
1024 -+ myproposal[PROPOSAL_KEX_ALGS]);
1025 -
1026 - if (options.rekey_limit || options.rekey_interval)
1027 - packet_set_rekey_limits((u_int32_t)options.rekey_limit,
1028 -Index: bufaux.c
1029 -===================================================================
1030 -RCS file: /var/cvs/openssh/bufaux.c,v
1031 -retrieving revision 1.62
1032 -retrieving revision 1.63
1033 -diff -u -p -r1.62 -r1.63
1034 ---- bufaux.c 4 Feb 2014 00:20:15 -0000 1.62
1035 -+++ bufaux.c 20 Apr 2014 03:24:50 -0000 1.63
1036 -@@ -1,4 +1,4 @@
1037 --/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */
1038 -+/* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */
1039 - /*
1040 - * Author: Tatu Ylonen <ylo at cs.hut.fi>
1041 - * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
1042 -@@ -372,6 +372,9 @@ buffer_put_bignum2_from_string(Buffer *b
1043 -
1044 - if (l > 8 * 1024)
1045 - fatal("%s: length %u too long", __func__, l);
1046 -+ /* Skip leading zero bytes */
1047 -+ for (; l > 0 && *s == 0; l--, s++)
1048 -+ ;
1049 - p = buf = xmalloc(l + 1);
1050 - /*
1051 - * If most significant bit is set then prepend a zero byte to
1052
1053 diff --git a/net-misc/openssh/files/openssh-6.6_p1-openssl-ignore-status.patch b/net-misc/openssh/files/openssh-6.6_p1-openssl-ignore-status.patch
1054 deleted file mode 100644
1055 index 6db6b97..0000000
1056 --- a/net-misc/openssh/files/openssh-6.6_p1-openssl-ignore-status.patch
1057 +++ /dev/null
1058 @@ -1,17 +0,0 @@
1059 -the last nibble of the openssl version represents the status. that is,
1060 -whether it is a beta or release. when it comes to version checks in
1061 -openssh, this component does not matter, so ignore it.
1062 -
1063 -https://bugzilla.mindrot.org/show_bug.cgi?id=2212
1064 -
1065 ---- a/entropy.c
1066 -+++ b/entropy.c
1067 -@@ -216,7 +216,7 @@ seed_rng(void)
1068 - * allow 1.0.1 to work with 1.0.0). Going backwards is only allowed
1069 - * within a patch series.
1070 - */
1071 -- u_long version_mask = SSLeay() >= 0x1000000f ? ~0xffff0L : ~0xff0L;
1072 -+ u_long version_mask = SSLeay() >= 0x1000000f ? ~0xfffffL : ~0xff0L;
1073 - if (((SSLeay() ^ OPENSSL_VERSION_NUMBER) & version_mask) ||
1074 - (SSLeay() >> 12) < (OPENSSL_VERSION_NUMBER >> 12))
1075 - fatal("OpenSSL version mismatch. Built against %lx, you "
1076
1077 diff --git a/net-misc/openssh/files/openssh-6.6_p1-x509-glue.patch b/net-misc/openssh/files/openssh-6.6_p1-x509-glue.patch
1078 deleted file mode 100644
1079 index 0ba3e45..0000000
1080 --- a/net-misc/openssh/files/openssh-6.6_p1-x509-glue.patch
1081 +++ /dev/null
1082 @@ -1,16 +0,0 @@
1083 -Make x509 apply after openssh-5.9_p1-sshd-gssapi-multihomed.patch.
1084 -
1085 ---- openssh-6.6p1+x509-7.9.diff
1086 -+++ openssh-6.6p1+x509-7.9.diff
1087 -@@ -15473,10 +15473,9 @@
1088 - .It Cm ChallengeResponseAuthentication
1089 - Specifies whether challenge-response authentication is allowed (e.g. via
1090 - PAM or though authentication styles supported in
1091 --@@ -499,6 +576,16 @@
1092 -+@@ -499,5 +576,15 @@
1093 - The default is
1094 - .Dq yes .
1095 -- Note that this option applies to protocol version 2 only.
1096 - +.It Cm HostbasedAlgorithms
1097 - +Specifies the protocol version 2 algorithms used in
1098 - +.Dq hostbased
1099
1100 diff --git a/net-misc/openssh/files/openssh-6.6_p1-x509-hpn14v4-glue-p2.patch b/net-misc/openssh/files/openssh-6.6_p1-x509-hpn14v4-glue-p2.patch
1101 deleted file mode 100644
1102 index a69830e..0000000
1103 --- a/net-misc/openssh/files/openssh-6.6_p1-x509-hpn14v4-glue-p2.patch
1104 +++ /dev/null
1105 @@ -1,26 +0,0 @@
1106 -make the hpn patch apply when the x509 patch has also been applied
1107 -
1108 ---- openssh-6.6p1-hpnssh14v4.diff
1109 -+++ openssh-6.6p1-hpnssh14v4.diff
1110 -@@ -1742,18 +1742,14 @@
1111 - if (options->ip_qos_interactive == -1)
1112 - options->ip_qos_interactive = IPTOS_LOWDELAY;
1113 - if (options->ip_qos_bulk == -1)
1114 --@@ -345,9 +393,10 @@
1115 -+@@ -345,6 +393,7 @@
1116 - sUsePrivilegeSeparation, sAllowAgentForwarding,
1117 - sHostCertificate,
1118 - sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
1119 --+ sTcpRcvBufPoll, sHPNDisabled, sHPNBufferSize,
1120 -++ sTcpRcvBufPoll, sHPNDisabled, sHPNBufferSize, sNoneEnabled,
1121 - sKexAlgorithms, sIPQoS, sVersionAddendum,
1122 - sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
1123 --- sAuthenticationMethods, sHostKeyAgent,
1124 --+ sAuthenticationMethods, sNoneEnabled, sHostKeyAgent,
1125 -- sDeprecated, sUnsupported
1126 -- } ServerOpCodes;
1127 --
1128 -+ sAuthenticationMethods, sHostKeyAgent,
1129 - @@ -468,6 +517,10 @@
1130 - { "revokedkeys", sRevokedKeys, SSHCFG_ALL },
1131 - { "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL },
1132
1133 diff --git a/net-misc/openssh/metadata.xml b/net-misc/openssh/metadata.xml
1134 index 5765fa2..885648b 100644
1135 --- a/net-misc/openssh/metadata.xml
1136 +++ b/net-misc/openssh/metadata.xml
1137 @@ -25,6 +25,7 @@ ssh-keygen and sftp-server. OpenSSH supports SSH protocol versions 1.3, 1.5, and
1138 <flag name="hpn">Enable high performance ssh</flag>
1139 <flag name="ldap">Add support for storing SSH public keys in LDAP</flag>
1140 <flag name="ldns">Use LDNS for DNSSEC/SSHFP validation.</flag>
1141 + <flag name="sctp">Support for Stream Control Transmission Protocol</flag>
1142 <flag name="X509">Adds support for X.509 certificate authentication</flag>
1143 </use>
1144 <upstream>
1145
1146 diff --git a/net-misc/openssh/openssh-6.6.1_p1-r99.ebuild b/net-misc/openssh/openssh-6.6.1_p1-r99.ebuild
1147 deleted file mode 100644
1148 index f12f244..0000000
1149 --- a/net-misc/openssh/openssh-6.6.1_p1-r99.ebuild
1150 +++ /dev/null
1151 @@ -1,323 +0,0 @@
1152 -# Copyright 1999-2014 Gentoo Foundation
1153 -# Distributed under the terms of the GNU General Public License v2
1154 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.6.1_p1-r99.ebuild,v 1.2 2014/03/20 20:58:31 vapier Exp $
1155 -
1156 -EAPI="4"
1157 -inherit eutils user flag-o-matic multilib autotools pam systemd versionator
1158 -
1159 -# Make it more portable between straight releases
1160 -# and _p? releases.
1161 -PARCH=${P/.1_}
1162 -
1163 -#HPN_PATCH="${PN}-6.6p1-hpnssh14v4.diff.gz"
1164 -HPN_PATCH="${PN}-6.6.1p1-hpnssh14v4.diff.xz"
1165 -LDAP_PATCH="${PN}-lpk-6.5p1-0.3.14.patch.gz"
1166 -X509_VER="7.9" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
1167 -
1168 -DESCRIPTION="Port of OpenBSD's free SSH release"
1169 -HOMEPAGE="http://www.openssh.org/"
1170 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1171 - ${HPN_PATCH:+hpn? ( http://dev.gentoo.org/~polynomial-c/${HPN_PATCH} )}
1172 - ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
1173 - ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
1174 - "
1175 - #${HPN_PATCH:+hpn? ( mirror://sourceforge/hpnssh/${HPN_PATCH} )}
1176 -
1177 -LICENSE="BSD GPL-2"
1178 -SLOT="0"
1179 -KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
1180 -IUSE="bindist ${HPN_PATCH:++}hpn kerberos ldap ldns libedit pam selinux skey static tcpd X X509"
1181 -
1182 -LIB_DEPEND="selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
1183 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
1184 - libedit? ( dev-libs/libedit[static-libs(+)] )
1185 - >=dev-libs/openssl-0.9.6d:0[bindist=]
1186 - dev-libs/openssl[static-libs(+)]
1187 - >=sys-libs/zlib-1.2.3[static-libs(+)]
1188 - tcpd? ( >=sys-apps/tcp-wrappers-7.6[static-libs(+)] )"
1189 -RDEPEND="
1190 - !static? (
1191 - ${LIB_DEPEND//\[static-libs(+)]}
1192 - ldns? (
1193 - !bindist? ( net-libs/ldns[ecdsa,ssl] )
1194 - bindist? ( net-libs/ldns[-ecdsa,ssl] )
1195 - )
1196 - )
1197 - pam? ( virtual/pam )
1198 - kerberos? ( virtual/krb5 )
1199 - ldap? ( net-nds/openldap )"
1200 -DEPEND="${RDEPEND}
1201 - static? (
1202 - ${LIB_DEPEND}
1203 - ldns? (
1204 - !bindist? ( net-libs/ldns[ecdsa,ssl,static-libs(+)] )
1205 - bindist? ( net-libs/ldns[-ecdsa,ssl,static-libs(+)] )
1206 - )
1207 - )
1208 - virtual/pkgconfig
1209 - virtual/os-headers
1210 - sys-devel/autoconf"
1211 -RDEPEND="${RDEPEND}
1212 - pam? ( >=sys-auth/pambase-20081028 )
1213 - userland_GNU? ( virtual/shadow )
1214 - X? ( x11-apps/xauth )"
1215 -
1216 -S=${WORKDIR}/${PARCH}
1217 -
1218 -pkg_setup() {
1219 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
1220 - # than not be able to log in to their server any more
1221 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
1222 - local fail="
1223 - $(use X509 && maybe_fail X509 X509_PATCH)
1224 - $(use ldap && maybe_fail ldap LDAP_PATCH)
1225 - $(use hpn && maybe_fail hpn HPN_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 -
1237 -save_version() {
1238 - # version.h patch conflict avoidence
1239 - mv version.h version.h.$1
1240 - cp -f version.h.pristine version.h
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 - # keep this as we need it to avoid the conflict between LPK and HPN changing
1248 - # this file.
1249 - cp version.h version.h.pristine
1250 -
1251 - # don't break .ssh/authorized_keys2 for fun
1252 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
1253 -
1254 - epatch "${FILESDIR}"/${P}.patch #508604
1255 -
1256 - epatch "${FILESDIR}"/${PN}-5.9_p1-sshd-gssapi-multihomed.patch #378361
1257 - if use X509 ; then
1258 - pushd .. >/dev/null
1259 - epatch "${FILESDIR}"/${PN}-6.6_p1-x509-glue.patch
1260 - use hpn && epatch "${FILESDIR}"/${PN}-6.6.1_p1-x509-hpn14v4-glue-p2.patch
1261 - popd >/dev/null
1262 - epatch "${WORKDIR}"/${X509_PATCH%.*}
1263 - epatch "${FILESDIR}"/${PN}-6.3_p1-x509-hpn14v2-glue.patch
1264 - save_version X509
1265 - fi
1266 - if ! use X509 ; then
1267 - if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
1268 - epatch "${WORKDIR}"/${LDAP_PATCH%.*}
1269 - save_version LPK
1270 - fi
1271 - else
1272 - use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
1273 - fi
1274 - epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
1275 - epatch "${FILESDIR}"/${PN}-6.6_p1-openssl-ignore-status.patch
1276 - if [[ -n ${HPN_PATCH} ]] && use hpn; then
1277 - epatch "${WORKDIR}"/${HPN_PATCH%.*}
1278 - epatch "${FILESDIR}"/${PN}-6.5_p1-hpn-cipher-align.patch #498632
1279 - save_version HPN
1280 - fi
1281 -
1282 - tc-export PKG_CONFIG
1283 - local sed_args=(
1284 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1285 - # Disable PATH reset, trust what portage gives us #254615
1286 - -e 's:^PATH=/:#PATH=/:'
1287 - # Disable fortify flags ... our gcc does this for us
1288 - -e 's:-D_FORTIFY_SOURCE=2::'
1289 - )
1290 - # The -ftrapv flag ICEs on hppa #505182
1291 - use hppa && sed_args+=(
1292 - -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
1293 - -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
1294 - )
1295 - sed -i "${sed_args[@]}" configure{.ac,} || die
1296 -
1297 - epatch "${FILESDIR}"/${PN}-6.4p1-avoid-exit.patch
1298 - epatch "${FILESDIR}"/${PN}-6.4p1-missing-sys_param_h.patch
1299 - epatch "${FILESDIR}"/${PN}-6.4p1-fix-typo-construct_utmpx.patch
1300 -
1301 - epatch_user #473004
1302 -
1303 - # Now we can build a sane merged version.h
1304 - (
1305 - sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
1306 - macros=()
1307 - for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
1308 - printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
1309 - ) > version.h
1310 -
1311 - eautoreconf
1312 -}
1313 -
1314 -static_use_with() {
1315 - local flag=$1
1316 - if use static && use ${flag} ; then
1317 - ewarn "Disabling '${flag}' support because of USE='static'"
1318 - # rebuild args so that we invert the first one (USE flag)
1319 - # but otherwise leave everything else working so we can
1320 - # just leverage use_with
1321 - shift
1322 - [[ -z $1 ]] && flag="${flag} ${flag}"
1323 - set -- !${flag} "$@"
1324 - fi
1325 - use_with "$@"
1326 -}
1327 -
1328 -src_configure() {
1329 - local myconf
1330 - addwrite /dev/ptmx
1331 - addpredict /etc/skey/skeykeys #skey configure code triggers this
1332 -
1333 - use static && append-ldflags -static
1334 -
1335 - # Special settings for Gentoo/FreeBSD 9.0 or later (see bug #391011)
1336 - if use elibc_FreeBSD && version_is_at_least 9.0 "$(uname -r|sed 's/\(.\..\).*/\1/')" ; then
1337 - myconf="${myconf} --disable-utmp --disable-wtmp --disable-wtmpx"
1338 - append-ldflags -lutil
1339 - fi
1340 -
1341 - econf \
1342 - --with-ldflags="${LDFLAGS}" \
1343 - --disable-strip \
1344 - --with-pid-dir="${EPREFIX}"/var/run \
1345 - --sysconfdir="${EPREFIX}"/etc/ssh \
1346 - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc \
1347 - --datadir="${EPREFIX}"/usr/share/openssh \
1348 - --with-privsep-path="${EPREFIX}"/var/empty \
1349 - --with-privsep-user=sshd \
1350 - --with-md5-passwords \
1351 - --with-ssl-engine \
1352 - $(static_use_with pam) \
1353 - $(static_use_with kerberos kerberos5 /usr) \
1354 - ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
1355 - $(use_with ldns) \
1356 - $(use_with libedit) \
1357 - $(use_with selinux) \
1358 - $(use_with skey) \
1359 - $(use_with tcpd tcp-wrappers) \
1360 - ${myconf}
1361 -}
1362 -
1363 -src_install() {
1364 - emake install-nokeys DESTDIR="${D}"
1365 - fperms 600 /etc/ssh/sshd_config
1366 - dobin contrib/ssh-copy-id
1367 - newinitd "${FILESDIR}"/sshd.rc6.4 sshd
1368 - newconfd "${FILESDIR}"/sshd.confd sshd
1369 - keepdir /var/empty
1370 -
1371 - # not all openssl installs support ecc, or are functional #352645
1372 - if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
1373 - elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
1374 - sed -i 's:&& gen_key ecdsa::' "${ED}"/etc/init.d/sshd || die
1375 - fi
1376 -
1377 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1378 - if use pam ; then
1379 - sed -i \
1380 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1381 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1382 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1383 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1384 - "${ED}"/etc/ssh/sshd_config || die "sed of configuration file failed"
1385 - fi
1386 -
1387 - # Gentoo tweaks to default config files
1388 - cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
1389 -
1390 - # Allow client to pass locale environment variables #367017
1391 - AcceptEnv LANG LC_*
1392 - EOF
1393 - cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
1394 -
1395 - # Send locale environment variables #367017
1396 - SendEnv LANG LC_*
1397 - EOF
1398 -
1399 - # This instruction is from the HPN webpage,
1400 - # Used for the server logging functionality
1401 - if [[ -n ${HPN_PATCH} ]] && use hpn ; then
1402 - keepdir /var/empty/dev
1403 - fi
1404 -
1405 - if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
1406 - insinto /etc/openldap/schema/
1407 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1408 - fi
1409 -
1410 - doman contrib/ssh-copy-id.1
1411 - dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
1412 -
1413 - diropts -m 0700
1414 - dodir /etc/skel/.ssh
1415 -
1416 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1417 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1418 -}
1419 -
1420 -src_test() {
1421 - local t tests skipped failed passed shell
1422 - tests="interop-tests compat-tests"
1423 - skipped=""
1424 - shell=$(egetshell ${UID})
1425 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1426 - elog "Running the full OpenSSH testsuite"
1427 - elog "requires a usable shell for the 'portage'"
1428 - elog "user, so we will run a subset only."
1429 - skipped="${skipped} tests"
1430 - else
1431 - tests="${tests} tests"
1432 - fi
1433 - # It will also attempt to write to the homedir .ssh
1434 - local sshhome=${T}/homedir
1435 - mkdir -p "${sshhome}"/.ssh
1436 - for t in ${tests} ; do
1437 - # Some tests read from stdin ...
1438 - HOMEDIR="${sshhome}" \
1439 - emake -k -j1 ${t} </dev/null \
1440 - && passed="${passed}${t} " \
1441 - || failed="${failed}${t} "
1442 - done
1443 - einfo "Passed tests: ${passed}"
1444 - ewarn "Skipped tests: ${skipped}"
1445 - if [[ -n ${failed} ]] ; then
1446 - ewarn "Failed tests: ${failed}"
1447 - die "Some tests failed: ${failed}"
1448 - else
1449 - einfo "Failed tests: ${failed}"
1450 - return 0
1451 - fi
1452 -}
1453 -
1454 -pkg_preinst() {
1455 - enewgroup sshd 22
1456 - enewuser sshd 22 -1 /var/empty sshd
1457 -}
1458 -
1459 -pkg_postinst() {
1460 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1461 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1462 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1463 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1464 - fi
1465 - ewarn "Remember to merge your config files in /etc/ssh/ and then"
1466 - ewarn "reload sshd: '/etc/init.d/sshd reload'."
1467 - # This instruction is from the HPN webpage,
1468 - # Used for the server logging functionality
1469 - if [[ -n ${HPN_PATCH} ]] && use hpn ; then
1470 - echo
1471 - einfo "For the HPN server logging patch, you must ensure that"
1472 - einfo "your syslog application also listens at /var/empty/dev/log."
1473 - fi
1474 -}
1475
1476 diff --git a/net-misc/openssh/openssh-6.6_p1-r99.ebuild b/net-misc/openssh/openssh-6.6_p1-r99.ebuild
1477 deleted file mode 100644
1478 index 3d51e6e..0000000
1479 --- a/net-misc/openssh/openssh-6.6_p1-r99.ebuild
1480 +++ /dev/null
1481 @@ -1,320 +0,0 @@
1482 -# Copyright 1999-2014 Gentoo Foundation
1483 -# Distributed under the terms of the GNU General Public License v2
1484 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.6_p1-r1.ebuild,v 1.2 2014/03/20 20:58:31 vapier Exp $
1485 -
1486 -EAPI="4"
1487 -inherit eutils user flag-o-matic multilib autotools pam systemd versionator
1488 -
1489 -# Make it more portable between straight releases
1490 -# and _p? releases.
1491 -PARCH=${P/_}
1492 -
1493 -#HPN_PATCH="${PN}-6.6p1-hpnssh14v4.diff.gz"
1494 -HPN_PATCH="${PN}-6.6p1-hpnssh14v4.diff.xz"
1495 -LDAP_PATCH="${PN}-lpk-6.5p1-0.3.14.patch.gz"
1496 -X509_VER="7.9" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
1497 -
1498 -DESCRIPTION="Port of OpenBSD's free SSH release"
1499 -HOMEPAGE="http://www.openssh.org/"
1500 -SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1501 - ${HPN_PATCH:+hpn? ( http://dev.gentoo.org/~polynomial-c/${HPN_PATCH} )}
1502 - ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
1503 - ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
1504 - "
1505 - #${HPN_PATCH:+hpn? ( mirror://sourceforge/hpnssh/${HPN_PATCH} )}
1506 -
1507 -LICENSE="BSD GPL-2"
1508 -SLOT="0"
1509 -KEYWORDS="amd64 arm ~mips ppc x86"
1510 -IUSE="bindist ${HPN_PATCH:++}hpn kerberos ldap ldns libedit pam selinux skey static tcpd X X509"
1511 -
1512 -LIB_DEPEND="selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
1513 - skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
1514 - libedit? ( dev-libs/libedit[static-libs(+)] )
1515 - >=dev-libs/openssl-0.9.6d:0[bindist=]
1516 - dev-libs/openssl[static-libs(+)]
1517 - >=sys-libs/zlib-1.2.3[static-libs(+)]
1518 - tcpd? ( >=sys-apps/tcp-wrappers-7.6[static-libs(+)] )"
1519 -RDEPEND="
1520 - !static? (
1521 - ${LIB_DEPEND//\[static-libs(+)]}
1522 - ldns? (
1523 - !bindist? ( net-libs/ldns[ecdsa,ssl] )
1524 - bindist? ( net-libs/ldns[-ecdsa,ssl] )
1525 - )
1526 - )
1527 - pam? ( virtual/pam )
1528 - kerberos? ( virtual/krb5 )
1529 - ldap? ( net-nds/openldap )"
1530 -DEPEND="${RDEPEND}
1531 - static? (
1532 - ${LIB_DEPEND}
1533 - ldns? (
1534 - !bindist? ( net-libs/ldns[ecdsa,ssl,static-libs(+)] )
1535 - bindist? ( net-libs/ldns[-ecdsa,ssl,static-libs(+)] )
1536 - )
1537 - )
1538 - virtual/pkgconfig
1539 - virtual/os-headers
1540 - sys-devel/autoconf"
1541 -RDEPEND="${RDEPEND}
1542 - pam? ( >=sys-auth/pambase-20081028 )
1543 - userland_GNU? ( virtual/shadow )
1544 - X? ( x11-apps/xauth )"
1545 -
1546 -S=${WORKDIR}/${PARCH}
1547 -
1548 -pkg_setup() {
1549 - # this sucks, but i'd rather have people unable to `emerge -u openssh`
1550 - # than not be able to log in to their server any more
1551 - maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
1552 - local fail="
1553 - $(use X509 && maybe_fail X509 X509_PATCH)
1554 - $(use ldap && maybe_fail ldap LDAP_PATCH)
1555 - $(use hpn && maybe_fail hpn HPN_PATCH)
1556 - "
1557 - fail=$(echo ${fail})
1558 - if [[ -n ${fail} ]] ; then
1559 - eerror "Sorry, but this version does not yet support features"
1560 - eerror "that you requested: ${fail}"
1561 - eerror "Please mask ${PF} for now and check back later:"
1562 - eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
1563 - die "booooo"
1564 - fi
1565 -}
1566 -
1567 -save_version() {
1568 - # version.h patch conflict avoidence
1569 - mv version.h version.h.$1
1570 - cp -f version.h.pristine version.h
1571 -}
1572 -
1573 -src_prepare() {
1574 - sed -i \
1575 - -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX}/usr/bin/xauth:" \
1576 - pathnames.h || die
1577 - # keep this as we need it to avoid the conflict between LPK and HPN changing
1578 - # this file.
1579 - cp version.h version.h.pristine
1580 -
1581 - # don't break .ssh/authorized_keys2 for fun
1582 - sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
1583 -
1584 - epatch "${FILESDIR}"/${PN}-5.9_p1-sshd-gssapi-multihomed.patch #378361
1585 - if use X509 ; then
1586 - pushd .. >/dev/null
1587 - epatch "${FILESDIR}"/${PN}-6.6_p1-x509-glue.patch
1588 - use hpn && epatch "${FILESDIR}"/${PN}-6.6_p1-x509-hpn14v4-glue-p2.patch
1589 - popd >/dev/null
1590 - epatch "${WORKDIR}"/${X509_PATCH%.*}
1591 - epatch "${FILESDIR}"/${PN}-6.3_p1-x509-hpn14v2-glue.patch
1592 - save_version X509
1593 - fi
1594 - if ! use X509 ; then
1595 - if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
1596 - epatch "${WORKDIR}"/${LDAP_PATCH%.*}
1597 - save_version LPK
1598 - fi
1599 - else
1600 - use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
1601 - fi
1602 - epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
1603 - epatch "${FILESDIR}"/${PN}-6.6_p1-openssl-ignore-status.patch
1604 - if [[ -n ${HPN_PATCH} ]] && use hpn; then
1605 - epatch "${WORKDIR}"/${HPN_PATCH%.*}
1606 - epatch "${FILESDIR}"/${PN}-6.5_p1-hpn-cipher-align.patch #498632
1607 - save_version HPN
1608 - fi
1609 -
1610 - tc-export PKG_CONFIG
1611 - local sed_args=(
1612 - -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
1613 - # Disable PATH reset, trust what portage gives us #254615
1614 - -e 's:^PATH=/:#PATH=/:'
1615 - # Disable fortify flags ... our gcc does this for us
1616 - -e 's:-D_FORTIFY_SOURCE=2::'
1617 - )
1618 - sed -i "${sed_args[@]}" configure{,.ac} || die
1619 -
1620 - epatch "${FILESDIR}"/${PN}-6.4p1-avoid-exit.patch
1621 - epatch "${FILESDIR}"/${PN}-6.4p1-missing-sys_param_h.patch
1622 - epatch "${FILESDIR}"/${PN}-6.4p1-fix-typo-construct_utmpx.patch
1623 -
1624 - epatch_user #473004
1625 -
1626 - # Now we can build a sane merged version.h
1627 - (
1628 - sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
1629 - macros=()
1630 - for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
1631 - printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
1632 - ) > version.h
1633 -
1634 - eautoreconf
1635 -}
1636 -
1637 -static_use_with() {
1638 - local flag=$1
1639 - if use static && use ${flag} ; then
1640 - ewarn "Disabling '${flag}' support because of USE='static'"
1641 - # rebuild args so that we invert the first one (USE flag)
1642 - # but otherwise leave everything else working so we can
1643 - # just leverage use_with
1644 - shift
1645 - [[ -z $1 ]] && flag="${flag} ${flag}"
1646 - set -- !${flag} "$@"
1647 - fi
1648 - use_with "$@"
1649 -}
1650 -
1651 -src_configure() {
1652 - local myconf
1653 - addwrite /dev/ptmx
1654 - addpredict /etc/skey/skeykeys #skey configure code triggers this
1655 -
1656 - use static && append-ldflags -static
1657 -
1658 - # Special settings for Gentoo/FreeBSD 9.0 or later (see bug #391011)
1659 - if use elibc_FreeBSD && version_is_at_least 9.0 "$(uname -r|sed 's/\(.\..\).*/\1/')" ; then
1660 - myconf="${myconf} --disable-utmp --disable-wtmp --disable-wtmpx"
1661 - append-ldflags -lutil
1662 - fi
1663 -
1664 - # __stack_chk_fail_local
1665 - use x86 && myconf="${myconf} --without-stackprotect"
1666 - use ppc && myconf="${myconf} --without-stackprotect"
1667 -
1668 - econf \
1669 - --with-ldflags="${LDFLAGS}" \
1670 - --disable-strip \
1671 - --with-pid-dir="${EPREFIX}"/var/run \
1672 - --sysconfdir="${EPREFIX}"/etc/ssh \
1673 - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc \
1674 - --datadir="${EPREFIX}"/usr/share/openssh \
1675 - --with-privsep-path="${EPREFIX}"/var/empty \
1676 - --with-privsep-user=sshd \
1677 - --with-md5-passwords \
1678 - --with-ssl-engine \
1679 - $(static_use_with pam) \
1680 - $(static_use_with kerberos kerberos5 /usr) \
1681 - ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
1682 - $(use_with ldns) \
1683 - $(use_with libedit) \
1684 - $(use_with selinux) \
1685 - $(use_with skey) \
1686 - $(use_with tcpd tcp-wrappers) \
1687 - ${myconf}
1688 -}
1689 -
1690 -src_install() {
1691 - emake install-nokeys DESTDIR="${D}"
1692 - fperms 600 /etc/ssh/sshd_config
1693 - dobin contrib/ssh-copy-id
1694 - newinitd "${FILESDIR}"/sshd.rc6.4 sshd
1695 - newconfd "${FILESDIR}"/sshd.confd sshd
1696 - keepdir /var/empty
1697 -
1698 - # not all openssl installs support ecc, or are functional #352645
1699 - if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
1700 - elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
1701 - sed -i 's:&& gen_key ecdsa::' "${ED}"/etc/init.d/sshd || die
1702 - fi
1703 -
1704 - newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
1705 - if use pam ; then
1706 - sed -i \
1707 - -e "/^#UsePAM /s:.*:UsePAM yes:" \
1708 - -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
1709 - -e "/^#PrintMotd /s:.*:PrintMotd no:" \
1710 - -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
1711 - "${ED}"/etc/ssh/sshd_config || die "sed of configuration file failed"
1712 - fi
1713 -
1714 - # Gentoo tweaks to default config files
1715 - cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
1716 -
1717 - # Allow client to pass locale environment variables #367017
1718 - AcceptEnv LANG LC_*
1719 - EOF
1720 - cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
1721 -
1722 - # Send locale environment variables #367017
1723 - SendEnv LANG LC_*
1724 - EOF
1725 -
1726 - # This instruction is from the HPN webpage,
1727 - # Used for the server logging functionality
1728 - if [[ -n ${HPN_PATCH} ]] && use hpn ; then
1729 - keepdir /var/empty/dev
1730 - fi
1731 -
1732 - if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
1733 - insinto /etc/openldap/schema/
1734 - newins openssh-lpk_openldap.schema openssh-lpk.schema
1735 - fi
1736 -
1737 - doman contrib/ssh-copy-id.1
1738 - dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
1739 -
1740 - diropts -m 0700
1741 - dodir /etc/skel/.ssh
1742 -
1743 - systemd_dounit "${FILESDIR}"/sshd.{service,socket}
1744 - systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
1745 -}
1746 -
1747 -src_test() {
1748 - local t tests skipped failed passed shell
1749 - tests="interop-tests compat-tests"
1750 - skipped=""
1751 - shell=$(egetshell ${UID})
1752 - if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
1753 - elog "Running the full OpenSSH testsuite"
1754 - elog "requires a usable shell for the 'portage'"
1755 - elog "user, so we will run a subset only."
1756 - skipped="${skipped} tests"
1757 - else
1758 - tests="${tests} tests"
1759 - fi
1760 - # It will also attempt to write to the homedir .ssh
1761 - local sshhome=${T}/homedir
1762 - mkdir -p "${sshhome}"/.ssh
1763 - for t in ${tests} ; do
1764 - # Some tests read from stdin ...
1765 - HOMEDIR="${sshhome}" \
1766 - emake -k -j1 ${t} </dev/null \
1767 - && passed="${passed}${t} " \
1768 - || failed="${failed}${t} "
1769 - done
1770 - einfo "Passed tests: ${passed}"
1771 - ewarn "Skipped tests: ${skipped}"
1772 - if [[ -n ${failed} ]] ; then
1773 - ewarn "Failed tests: ${failed}"
1774 - die "Some tests failed: ${failed}"
1775 - else
1776 - einfo "Failed tests: ${failed}"
1777 - return 0
1778 - fi
1779 -}
1780 -
1781 -pkg_preinst() {
1782 - enewgroup sshd 22
1783 - enewuser sshd 22 -1 /var/empty sshd
1784 -}
1785 -
1786 -pkg_postinst() {
1787 - if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
1788 - elog "Starting with openssh-5.8p1, the server will default to a newer key"
1789 - elog "algorithm (ECDSA). You are encouraged to manually update your stored"
1790 - elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
1791 - fi
1792 - ewarn "Remember to merge your config files in /etc/ssh/ and then"
1793 - ewarn "reload sshd: '/etc/init.d/sshd reload'."
1794 - # This instruction is from the HPN webpage,
1795 - # Used for the server logging functionality
1796 - if [[ -n ${HPN_PATCH} ]] && use hpn ; then
1797 - echo
1798 - einfo "For the HPN server logging patch, you must ensure that"
1799 - einfo "your syslog application also listens at /var/empty/dev/log."
1800 - fi
1801 -}
1802
1803 diff --git a/net-misc/openssh/openssh-6.7_p1-r99.ebuild b/net-misc/openssh/openssh-6.7_p1-r99.ebuild
1804 index 7a3bfed..7edc50d 100644
1805 --- a/net-misc/openssh/openssh-6.7_p1-r99.ebuild
1806 +++ b/net-misc/openssh/openssh-6.7_p1-r99.ebuild
1807 @@ -28,7 +28,7 @@ SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
1808
1809 LICENSE="BSD GPL-2"
1810 SLOT="0"
1811 -KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
1812 +KEYWORDS="amd64 arm ~mips ppc x86"
1813 IUSE="bindist ${HPN_PATCH:++}hpn kerberos kernel_linux ldap ldns libedit pam +pie sctp selinux skey static X X509"
1814 REQUIRED_USE="pie? ( !static )"