1 |
commit: 452494d7ca5dfa6a804e932eadf24b999c51316e |
2 |
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 15 18:45:31 2019 +0000 |
4 |
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 15 18:45:48 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=452494d7 |
7 |
|
8 |
net-libs/gnutls: libressl fix |
9 |
|
10 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=675512 |
11 |
Thanks: Toralf Förster |
12 |
Signed-off-by: Alon Bar-Lev <alonbl <AT> gentoo.org> |
13 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
14 |
|
15 |
net-libs/gnutls/files/gnutls-3.6.5-libressl.patch | 53 +++++++++++++++++++++++ |
16 |
net-libs/gnutls/gnutls-3.6.5.ebuild | 1 + |
17 |
2 files changed, 54 insertions(+) |
18 |
|
19 |
diff --git a/net-libs/gnutls/files/gnutls-3.6.5-libressl.patch b/net-libs/gnutls/files/gnutls-3.6.5-libressl.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..16cac8c13b9 |
22 |
--- /dev/null |
23 |
+++ b/net-libs/gnutls/files/gnutls-3.6.5-libressl.patch |
24 |
@@ -0,0 +1,53 @@ |
25 |
+From bfd036b31f2a47ae40e104b2ea1a0e095900cf52 Mon Sep 17 00:00:00 2001 |
26 |
+From: Dmitry Eremin-Solenikov <dbaryshkov@×××××.com> |
27 |
+Date: Tue, 25 Dec 2018 14:43:56 +0300 |
28 |
+Subject: [PATCH] tests: cipher-openssl-compat: don't fail if OpenSSL doesn't |
29 |
+ provide cipher |
30 |
+ |
31 |
+LibreSSL does not provide ChaCha20-Poly1305 through EVP_CIPHER |
32 |
+interface, so let's skip the test if cipher is not available. |
33 |
+ |
34 |
+Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@×××××.com> |
35 |
+--- |
36 |
+ tests/slow/cipher-openssl-compat.c | 18 +++++++++++++----- |
37 |
+ 1 file changed, 13 insertions(+), 5 deletions(-) |
38 |
+ |
39 |
+diff --git a/tests/slow/cipher-openssl-compat.c b/tests/slow/cipher-openssl-compat.c |
40 |
+index c9b39d026..a4cb3522d 100644 |
41 |
+--- a/tests/slow/cipher-openssl-compat.c |
42 |
++++ b/tests/slow/cipher-openssl-compat.c |
43 |
+@@ -38,6 +38,19 @@ static int cipher_test(const char *ocipher, gnutls_cipher_algorithm_t gcipher, |
44 |
+ |
45 |
+ success("cipher: %s\n", ocipher); |
46 |
+ |
47 |
++ /* decrypt with openssl */ |
48 |
++ evp_cipher = EVP_get_cipherbyname(ocipher); |
49 |
++ if (!evp_cipher) { |
50 |
++ /* XXX: fix version check later when LibreSSL fixes support for aes-ccm and chacha20-poly1305 */ |
51 |
++#ifdef LIBRESSL_VERSION_NUMBER |
52 |
++ fprintf(stderr, "EVP_get_cipherbyname failed for %s\n", ocipher); |
53 |
++ return -1; |
54 |
++#else |
55 |
++ /* OpenSSL should always work! */ |
56 |
++ fail("EVP_get_cipherbyname failed for %s\n", ocipher); |
57 |
++#endif |
58 |
++ } |
59 |
++ |
60 |
+ for (i = 0; i < 32; i++) { /* try with multiple keys and nonces */ |
61 |
+ assert(gnutls_rnd |
62 |
+ (GNUTLS_RND_NONCE, orig_plain_data, |
63 |
+@@ -88,11 +101,6 @@ static int cipher_test(const char *ocipher, gnutls_cipher_algorithm_t gcipher, |
64 |
+ |
65 |
+ gnutls_aead_cipher_deinit(hd); |
66 |
+ |
67 |
+- /* decrypt with openssl */ |
68 |
+- evp_cipher = EVP_get_cipherbyname(ocipher); |
69 |
+- if (!evp_cipher) |
70 |
+- fail("EVP_get_cipherbyname failed for %s\n", ocipher); |
71 |
+- |
72 |
+ ctx = EVP_CIPHER_CTX_new(); |
73 |
+ |
74 |
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000L |
75 |
+-- |
76 |
+2.19.2 |
77 |
+ |
78 |
|
79 |
diff --git a/net-libs/gnutls/gnutls-3.6.5.ebuild b/net-libs/gnutls/gnutls-3.6.5.ebuild |
80 |
index 883584c16a7..9d141a5165c 100644 |
81 |
--- a/net-libs/gnutls/gnutls-3.6.5.ebuild |
82 |
+++ b/net-libs/gnutls/gnutls-3.6.5.ebuild |
83 |
@@ -55,6 +55,7 @@ HTML_DOCS=() |
84 |
|
85 |
PATCHES=( |
86 |
"${FILESDIR}/${P}-build.patch" |
87 |
+ "${FILESDIR}/${P}-libressl.patch" |
88 |
) |
89 |
|
90 |
pkg_setup() { |