Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/h2o/, www-servers/h2o/files/
Date: Fri, 11 May 2018 10:08:16
Message-Id: 1526031793.020699fb8aa0e91e444e98910fe035ef6bd1cd6c.mgorny@gentoo
1 commit: 020699fb8aa0e91e444e98910fe035ef6bd1cd6c
2 Author: Ian Moone <csmk+gentoo <AT> chaoslab <DOT> org>
3 AuthorDate: Wed May 9 19:06:29 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 11 09:43:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=020699fb
7
8 www-servers/h2o: fix build with LibreSSL 2.7
9
10 - LibreSSL 2.7 implements OpenSSL 1.1 API
11 - Use patch from upstream: h2o/h2o#1706
12
13 Closes: https://github.com/gentoo/gentoo/pull/8329
14 Package-Manager: Portage-2.3.36, Repoman-2.3.9
15
16 www-servers/h2o/files/h2o-2.2.4-libressl.patch | 54 ++++++++++++++++++++++++++
17 www-servers/h2o/h2o-2.2.4.ebuild | 2 +
18 2 files changed, 56 insertions(+)
19
20 diff --git a/www-servers/h2o/files/h2o-2.2.4-libressl.patch b/www-servers/h2o/files/h2o-2.2.4-libressl.patch
21 new file mode 100644
22 index 00000000000..3849dd0e2b6
23 --- /dev/null
24 +++ b/www-servers/h2o/files/h2o-2.2.4-libressl.patch
25 @@ -0,0 +1,54 @@
26 +--- a/include/h2o/openssl_backport.h
27 ++++ b/include/h2o/openssl_backport.h
28 +@@ -25,7 +25,7 @@
29 + #include <stdlib.h>
30 +
31 + /* backports for OpenSSL 1.0.2 */
32 +-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
33 ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
34 +
35 + #define BIO_get_data(bio) ((bio)->ptr)
36 + #define BIO_set_data(bio, p) ((bio)->ptr = (p))
37 +@@ -57,7 +58,7 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
38 + #endif
39 +
40 + /* backports for OpenSSL 1.0.1 and LibreSSL */
41 +-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
42 ++#if OPENSSL_VERSION_NUMBER < 0x10002000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
43 +
44 + #define SSL_is_server(ssl) ((ssl)->server)
45 +
46 +--- a/deps/neverbleed/neverbleed.c
47 ++++ b/deps/neverbleed/neverbleed.c
48 +@@ -547,7 +547,7 @@ static int sign_stub(struct expbuf_t *buf)
49 + return 0;
50 + }
51 +
52 +-#if !OPENSSL_1_1_API
53 ++#if !OPENSSL_1_1_API && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL)
54 +
55 + static void RSA_get0_key(const RSA *rsa, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
56 + {
57 +
58 +--- a/deps/picotls/lib/openssl.c
59 ++++ b/deps/picotls/lib/openssl.c
60 +@@ -41,13 +41,15 @@
61 + #include "picotls.h"
62 + #include "picotls/openssl.h"
63 +
64 +-#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
65 +-#define OPENSSL_1_0_API 1
66 ++#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
67 ++#define OPENSSL_1_1_API 1
68 ++#elif defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL
69 ++#define OPENSSL_1_1_API 1
70 + #else
71 +-#define OPENSSL_1_0_API 0
72 ++#define OPENSSL_1_1_API 0
73 + #endif
74 +
75 +-#if OPENSSL_1_0_API
76 ++#if !OPENSSL_1_1_API
77 +
78 + #define EVP_PKEY_up_ref(p) CRYPTO_add(&(p)->references, 1, CRYPTO_LOCK_EVP_PKEY)
79 + #define X509_STORE_up_ref(p) CRYPTO_add(&(p)->references, 1, CRYPTO_LOCK_X509_STORE)
80
81 diff --git a/www-servers/h2o/h2o-2.2.4.ebuild b/www-servers/h2o/h2o-2.2.4.ebuild
82 index d33e39efe54..ab022fd4783 100644
83 --- a/www-servers/h2o/h2o-2.2.4.ebuild
84 +++ b/www-servers/h2o/h2o-2.2.4.ebuild
85 @@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
86 ${RUBY_DEPS}
87 )"
88
89 +PATCHES=( "${FILESDIR}"/${P}-libressl.patch )
90 +
91 pkg_setup() {
92 enewgroup h2o
93 enewuser h2o -1 -1 -1 h2o