From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C2D7E139694 for ; Thu, 30 Mar 2017 18:30:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1088821C1D7; Thu, 30 Mar 2017 18:30:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D243D21C1D7 for ; Thu, 30 Mar 2017 18:30:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8408133D3CE for ; Thu, 30 Mar 2017 18:30:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F24427300 for ; Thu, 30 Mar 2017 18:30:55 +0000 (UTC) From: "Patrick McLean" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Patrick McLean" Message-ID: <1490898645.baf822f58e1e881b5f3dbf553ed550d93329fffa.chutzpah@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openssh/files/, net-misc/openssh/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/openssh/files/openssh-7.5p1-x509-libressl.patch net-misc/openssh/openssh-7.5_p1-r1.ebuild X-VCS-Directories: net-misc/openssh/files/ net-misc/openssh/ X-VCS-Committer: chutzpah X-VCS-Committer-Name: Patrick McLean X-VCS-Revision: baf822f58e1e881b5f3dbf553ed550d93329fffa X-VCS-Branch: master Date: Thu, 30 Mar 2017 18:30:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8e883a4a-d755-488d-94c3-b1057ba151eb X-Archives-Hash: 98833325016af9c1e5c427853a568cf0 commit: baf822f58e1e881b5f3dbf553ed550d93329fffa Author: Patrick McLean gentoo org> AuthorDate: Thu Mar 30 18:30:18 2017 +0000 Commit: Patrick McLean gentoo org> CommitDate: Thu Mar 30 18:30:45 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=baf822f5 net-misc/openssh: Add patch to allow 7.4_p1 to build with X509+libressl Package-Manager: Portage-2.3.5, Repoman-2.3.2 .../files/openssh-7.5p1-x509-libressl.patch | 202 +++++++++++++++++++++ net-misc/openssh/openssh-7.5_p1-r1.ebuild | 1 + 2 files changed, 203 insertions(+) diff --git a/net-misc/openssh/files/openssh-7.5p1-x509-libressl.patch b/net-misc/openssh/files/openssh-7.5p1-x509-libressl.patch new file mode 100644 index 00000000000..b4f36a51318 --- /dev/null +++ b/net-misc/openssh/files/openssh-7.5p1-x509-libressl.patch @@ -0,0 +1,202 @@ +diff -urN openssh-7.5p1.orig/a_utf8.c openssh-7.5p1/a_utf8.c +--- openssh-7.5p1.orig/a_utf8.c 1970-01-01 00:00:00.000000000 +0000 ++++ openssh-7.5p1/a_utf8.c 2017-03-30 17:38:25.179532110 +0000 +@@ -0,0 +1,186 @@ ++/* ++ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. ++ * ++ * Licensed under the OpenSSL license (the "License"). You may not use ++ * this file except in compliance with the License. You can obtain a copy ++ * in the file LICENSE in the source distribution or at ++ * https://www.openssl.org/source/license.html ++ */ ++ ++#include ++ ++/* UTF8 utilities */ ++ ++/*- ++ * This parses a UTF8 string one character at a time. It is passed a pointer ++ * to the string and the length of the string. It sets 'value' to the value of ++ * the current character. It returns the number of characters read or a ++ * negative error code: ++ * -1 = string too short ++ * -2 = illegal character ++ * -3 = subsequent characters not of the form 10xxxxxx ++ * -4 = character encoded incorrectly (not minimal length). ++ */ ++ ++int UTF8_getc(const unsigned char *str, int len, unsigned long *val) ++{ ++ const unsigned char *p; ++ unsigned long value; ++ int ret; ++ if (len <= 0) ++ return 0; ++ p = str; ++ ++ /* Check syntax and work out the encoded value (if correct) */ ++ if ((*p & 0x80) == 0) { ++ value = *p++ & 0x7f; ++ ret = 1; ++ } else if ((*p & 0xe0) == 0xc0) { ++ if (len < 2) ++ return -1; ++ if ((p[1] & 0xc0) != 0x80) ++ return -3; ++ value = (*p++ & 0x1f) << 6; ++ value |= *p++ & 0x3f; ++ if (value < 0x80) ++ return -4; ++ ret = 2; ++ } else if ((*p & 0xf0) == 0xe0) { ++ if (len < 3) ++ return -1; ++ if (((p[1] & 0xc0) != 0x80) ++ || ((p[2] & 0xc0) != 0x80)) ++ return -3; ++ value = (*p++ & 0xf) << 12; ++ value |= (*p++ & 0x3f) << 6; ++ value |= *p++ & 0x3f; ++ if (value < 0x800) ++ return -4; ++ ret = 3; ++ } else if ((*p & 0xf8) == 0xf0) { ++ if (len < 4) ++ return -1; ++ if (((p[1] & 0xc0) != 0x80) ++ || ((p[2] & 0xc0) != 0x80) ++ || ((p[3] & 0xc0) != 0x80)) ++ return -3; ++ value = ((unsigned long)(*p++ & 0x7)) << 18; ++ value |= (*p++ & 0x3f) << 12; ++ value |= (*p++ & 0x3f) << 6; ++ value |= *p++ & 0x3f; ++ if (value < 0x10000) ++ return -4; ++ ret = 4; ++ } else if ((*p & 0xfc) == 0xf8) { ++ if (len < 5) ++ return -1; ++ if (((p[1] & 0xc0) != 0x80) ++ || ((p[2] & 0xc0) != 0x80) ++ || ((p[3] & 0xc0) != 0x80) ++ || ((p[4] & 0xc0) != 0x80)) ++ return -3; ++ value = ((unsigned long)(*p++ & 0x3)) << 24; ++ value |= ((unsigned long)(*p++ & 0x3f)) << 18; ++ value |= ((unsigned long)(*p++ & 0x3f)) << 12; ++ value |= (*p++ & 0x3f) << 6; ++ value |= *p++ & 0x3f; ++ if (value < 0x200000) ++ return -4; ++ ret = 5; ++ } else if ((*p & 0xfe) == 0xfc) { ++ if (len < 6) ++ return -1; ++ if (((p[1] & 0xc0) != 0x80) ++ || ((p[2] & 0xc0) != 0x80) ++ || ((p[3] & 0xc0) != 0x80) ++ || ((p[4] & 0xc0) != 0x80) ++ || ((p[5] & 0xc0) != 0x80)) ++ return -3; ++ value = ((unsigned long)(*p++ & 0x1)) << 30; ++ value |= ((unsigned long)(*p++ & 0x3f)) << 24; ++ value |= ((unsigned long)(*p++ & 0x3f)) << 18; ++ value |= ((unsigned long)(*p++ & 0x3f)) << 12; ++ value |= (*p++ & 0x3f) << 6; ++ value |= *p++ & 0x3f; ++ if (value < 0x4000000) ++ return -4; ++ ret = 6; ++ } else ++ return -2; ++ *val = value; ++ return ret; ++} ++ ++/* ++ * This takes a character 'value' and writes the UTF8 encoded value in 'str' ++ * where 'str' is a buffer containing 'len' characters. Returns the number of ++ * characters written or -1 if 'len' is too small. 'str' can be set to NULL ++ * in which case it just returns the number of characters. It will need at ++ * most 6 characters. ++ */ ++ ++int UTF8_putc(unsigned char *str, int len, unsigned long value) ++{ ++ if (!str) ++ len = 6; /* Maximum we will need */ ++ else if (len <= 0) ++ return -1; ++ if (value < 0x80) { ++ if (str) ++ *str = (unsigned char)value; ++ return 1; ++ } ++ if (value < 0x800) { ++ if (len < 2) ++ return -1; ++ if (str) { ++ *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0); ++ *str = (unsigned char)((value & 0x3f) | 0x80); ++ } ++ return 2; ++ } ++ if (value < 0x10000) { ++ if (len < 3) ++ return -1; ++ if (str) { ++ *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0); ++ *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); ++ *str = (unsigned char)((value & 0x3f) | 0x80); ++ } ++ return 3; ++ } ++ if (value < 0x200000) { ++ if (len < 4) ++ return -1; ++ if (str) { ++ *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0); ++ *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); ++ *str = (unsigned char)((value & 0x3f) | 0x80); ++ } ++ return 4; ++ } ++ if (value < 0x4000000) { ++ if (len < 5) ++ return -1; ++ if (str) { ++ *str++ = (unsigned char)(((value >> 24) & 0x3) | 0xf8); ++ *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); ++ *str = (unsigned char)((value & 0x3f) | 0x80); ++ } ++ return 5; ++ } ++ if (len < 6) ++ return -1; ++ if (str) { ++ *str++ = (unsigned char)(((value >> 30) & 0x1) | 0xfc); ++ *str++ = (unsigned char)(((value >> 24) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 18) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80); ++ *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80); ++ *str = (unsigned char)((value & 0x3f) | 0x80); ++ } ++ return 6; ++} +diff -urN openssh-7.5p1.orig/Makefile.in openssh-7.5p1/Makefile.in +--- openssh-7.5p1.orig/Makefile.in 2017-03-30 17:33:30.983830629 +0000 ++++ openssh-7.5p1/Makefile.in 2017-03-30 17:39:28.392905858 +0000 +@@ -74,7 +74,7 @@ + @OCSP_ON@OCSP_OBJS=ssh-ocsp.o + @OCSP_OFF@OCSP_OBJS= + +-SSHX509_OBJS=ssh-x509.o ssh-xkalg.o x509_nm_cmp.o key-eng.o ++SSHX509_OBJS=ssh-x509.o ssh-xkalg.o x509_nm_cmp.o key-eng.o a_utf8.o + X509STORE_OBJS=x509store.o $(LDAP_OBJS) + + TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) diff --git a/net-misc/openssh/openssh-7.5_p1-r1.ebuild b/net-misc/openssh/openssh-7.5_p1-r1.ebuild index 4ce0ad47678..9652d9263d6 100644 --- a/net-misc/openssh/openssh-7.5_p1-r1.ebuild +++ b/net-misc/openssh/openssh-7.5_p1-r1.ebuild @@ -121,6 +121,7 @@ src_prepare() { fi save_version X509 epatch "${WORKDIR}"/${X509_PATCH%.*} + use libressl && epatch "${FILESDIR}"/${PN}-7.5p1-x509-libressl.patch fi if use ldap ; then