Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/vde/files/, net-misc/vde/
Date: Wed, 08 May 2019 17:05:32
Message-Id: 1557335017.a0bae155d65b5fd1ed4be98f52ec47012d39156a.asturm@gentoo
1 commit: a0bae155d65b5fd1ed4be98f52ec47012d39156a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 6 19:49:16 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed May 8 17:03:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0bae155
7
8 net-misc/vde: Fix build with >=dev-libs/openssl-1.1
9
10 Closes: https://bugs.gentoo.org/673928
11 Package-Manager: Portage-2.3.66, Repoman-2.3.12
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 net-misc/vde/files/vde-2.3.2-openssl-1.1.patch | 104 +++++++++++++++++++++++++
15 net-misc/vde/vde-2.3.2-r4.ebuild | 5 ++
16 2 files changed, 109 insertions(+)
17
18 diff --git a/net-misc/vde/files/vde-2.3.2-openssl-1.1.patch b/net-misc/vde/files/vde-2.3.2-openssl-1.1.patch
19 new file mode 100644
20 index 00000000000..b490b93350f
21 --- /dev/null
22 +++ b/net-misc/vde/files/vde-2.3.2-openssl-1.1.patch
23 @@ -0,0 +1,104 @@
24 +From 5f2c4c7b67617991af65798a4d177ada90f7e463 Mon Sep 17 00:00:00 2001
25 +From: Sebastian Andrzej Siewior <sebastian@××××××××××.cc>
26 +Date: Fri, 2 Sep 2016 19:52:49 +0000
27 +Subject: [PATCH] vde_cryptcab: compile against openssl 1.1.0
28 +
29 +Signed-off-by: Sebastian Andrzej Siewior <sebastian@××××××××××.cc>
30 +---
31 + src/vde_cryptcab/cryptcab.c | 30 +++++++++++++++++++-----------
32 + 1 file changed, 19 insertions(+), 11 deletions(-)
33 +
34 +diff --git a/src/vde_cryptcab/cryptcab.c b/src/vde_cryptcab/cryptcab.c
35 +index c5b4474..a2780f1 100644
36 +--- a/src/vde_cryptcab/cryptcab.c 2011-11-23 16:41:17.000000000 +0000
37 ++++ b/src/vde_cryptcab/cryptcab.c 2017-03-20 22:54:20.452975075 +0000
38 +@@ -22,7 +22,7 @@
39 + exit(1);
40 + }
41 +
42 +-static EVP_CIPHER_CTX ctx;
43 ++static EVP_CIPHER_CTX *ctx;
44 + static int ctx_initialized = 0;
45 + static int encryption_disabled = 0;
46 + static int nfd;
47 +@@ -30,6 +30,10 @@
48 + static struct vde_open_args open_args={.port=0,.group=NULL,.mode=0700};
49 + static int verbose = 0;
50 +
51 ++#if OPENSSL_VERSION_NUMBER < 0x10100000
52 ++#define EVP_CIPHER_CTX_reset(x) EVP_CIPHER_CTX_cleanup(x)
53 ++#endif
54 ++
55 + void vc_printlog(int priority, const char *format, ...)
56 + {
57 + va_list arg;
58 +@@ -103,19 +107,21 @@
59 + }
60 +
61 + if (!ctx_initialized) {
62 +- EVP_CIPHER_CTX_init (&ctx);
63 ++ ctx = EVP_CIPHER_CTX_new ();
64 ++ if (!ctx)
65 ++ return -1;
66 + ctx_initialized = 1;
67 + }
68 +
69 +- EVP_EncryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv);
70 +- if (EVP_EncryptUpdate (&ctx, dst, &olen, src, len) != 1)
71 ++ EVP_EncryptInit (ctx, EVP_bf_cbc (), p->key, p->iv);
72 ++ if (EVP_EncryptUpdate (ctx, dst, &olen, src, len) != 1)
73 + {
74 + fprintf (stderr,"error in encrypt update\n");
75 + olen = -1;
76 + goto cleanup;
77 + }
78 +
79 +- if (EVP_EncryptFinal (&ctx, dst + olen, &tlen) != 1)
80 ++ if (EVP_EncryptFinal (ctx, dst + olen, &tlen) != 1)
81 + {
82 + fprintf (stderr,"error in encrypt final\n");
83 + olen = -1;
84 +@@ -124,7 +130,7 @@
85 + olen += tlen;
86 +
87 + cleanup:
88 +- EVP_CIPHER_CTX_cleanup(&ctx);
89 ++ EVP_CIPHER_CTX_reset(ctx);
90 + return olen;
91 + }
92 +
93 +@@ -138,19 +144,21 @@
94 + }
95 +
96 + if (!ctx_initialized) {
97 +- EVP_CIPHER_CTX_init (&ctx);
98 ++ ctx = EVP_CIPHER_CTX_new ();
99 ++ if (!ctx)
100 ++ return -1;
101 + ctx_initialized = 1;
102 + }
103 +
104 +- EVP_DecryptInit (&ctx, EVP_bf_cbc (), p->key, p->iv);
105 +- if (EVP_DecryptUpdate (&ctx, dst, &olen, src, len) != 1)
106 ++ EVP_DecryptInit (ctx, EVP_bf_cbc (), p->key, p->iv);
107 ++ if (EVP_DecryptUpdate (ctx, dst, &olen, src, len) != 1)
108 + {
109 + fprintf (stderr,"error in decrypt update\n");
110 + olen = -1;
111 + goto cleanup;
112 + }
113 +
114 +- if (EVP_DecryptFinal (&ctx, dst + olen, &tlen) != 1)
115 ++ if (EVP_DecryptFinal (ctx, dst + olen, &tlen) != 1)
116 + {
117 + fprintf (stderr,"error in decrypt final\n");
118 + olen = -1;
119 +@@ -159,7 +167,7 @@
120 + olen += tlen;
121 +
122 + cleanup:
123 +- EVP_CIPHER_CTX_cleanup(&ctx);
124 ++ EVP_CIPHER_CTX_reset (ctx);
125 + return olen;
126 + }
127 +
128
129 diff --git a/net-misc/vde/vde-2.3.2-r4.ebuild b/net-misc/vde/vde-2.3.2-r4.ebuild
130 index f5df46fa334..93a75bf2b54 100644
131 --- a/net-misc/vde/vde-2.3.2-r4.ebuild
132 +++ b/net-misc/vde/vde-2.3.2-r4.ebuild
133 @@ -39,6 +39,11 @@ pkg_setup() {
134 use python && python-single-r1_pkg_setup
135 }
136
137 +src_prepare() {
138 + default
139 + has_version ">=dev-libs/openssl-1.1.0" && eapply "${FILESDIR}/${P}-openssl-1.1.patch"
140 +}
141 +
142 src_configure() {
143 filter-flags -O0 -Os
144 econf \