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: x11-misc/x11vnc/, x11-misc/x11vnc/files/
Date: Sat, 01 Jun 2019 08:15:26
Message-Id: 1559376907.8b853a8081e1c2ce0c4966203bdf0f928d782ce3.mgorny@gentoo
1 commit: 8b853a8081e1c2ce0c4966203bdf0f928d782ce3
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Tue May 21 19:29:59 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 1 08:15:07 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b853a80
7
8 x11-misc/x11vnc: fix building with libressl
9
10 Closes: https://bugs.gentoo.org/675610
11 Package-Manager: Portage-2.3.62, Repoman-2.3.11
12 Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 x11-misc/x11vnc/files/x11vnc-0.9.16-libressl.patch | 93 ++++++++++++++++++++++
16 x11-misc/x11vnc/x11vnc-0.9.16-r3.ebuild | 1 +
17 2 files changed, 94 insertions(+)
18
19 diff --git a/x11-misc/x11vnc/files/x11vnc-0.9.16-libressl.patch b/x11-misc/x11vnc/files/x11vnc-0.9.16-libressl.patch
20 new file mode 100644
21 index 00000000000..8e5d8a69217
22 --- /dev/null
23 +++ b/x11-misc/x11vnc/files/x11vnc-0.9.16-libressl.patch
24 @@ -0,0 +1,93 @@
25 +diff --git a/src/sslhelper.c b/src/sslhelper.c
26 +index 04c2e27..fb9daa6 100644
27 +--- a/src/sslhelper.c
28 ++++ b/src/sslhelper.c
29 +@@ -803,7 +803,7 @@ static int pem_passwd_callback(char *buf, int size, int rwflag,
30 + static int crl_callback(X509_STORE_CTX *callback_ctx) {
31 + const ASN1_INTEGER *revoked_serial;
32 + X509_STORE_CTX *store_ctx;
33 +-#if OPENSSL_VERSION_NUMBER > 0x10100000L
34 ++#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
35 + X509_OBJECT *obj;
36 + #else
37 + X509_OBJECT obj;
38 +@@ -829,7 +829,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
39 + * the current certificate in order to verify it's integrity. */
40 + store_ctx = X509_STORE_CTX_new();
41 + X509_STORE_CTX_init(store_ctx, revocation_store, NULL, NULL);
42 +-#if OPENSSL_VERSION_NUMBER > 0x10100000L
43 ++#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
44 + obj = X509_OBJECT_new();
45 + rc=X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, subject, obj);
46 + crl = X509_OBJECT_get0_X509_CRL(obj);
47 +@@ -865,7 +865,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
48 + rfbLog("Invalid signature on CRL\n");
49 + X509_STORE_CTX_set_error(callback_ctx,
50 + X509_V_ERR_CRL_SIGNATURE_FAILURE);
51 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
52 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
53 + X509_OBJECT_free(obj);
54 + #else
55 + X509_OBJECT_free_contents(&obj);
56 +@@ -883,7 +883,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
57 + rfbLog("Found CRL has invalid nextUpdate field\n");
58 + X509_STORE_CTX_set_error(callback_ctx,
59 + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
60 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
61 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
62 + X509_OBJECT_free(obj);
63 + #else
64 + X509_OBJECT_free_contents(&obj);
65 +@@ -894,14 +894,14 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
66 + rfbLog("Found CRL is expired - "
67 + "revoking all certificates until you get updated CRL\n");
68 + X509_STORE_CTX_set_error(callback_ctx, X509_V_ERR_CRL_HAS_EXPIRED);
69 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
70 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
71 + X509_OBJECT_free(obj);
72 + #else
73 + X509_OBJECT_free_contents(&obj);
74 + #endif
75 + return 0; /* Reject connection */
76 + }
77 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
78 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
79 + X509_OBJECT_free(obj);
80 + #else
81 + X509_OBJECT_free_contents(&obj);
82 +@@ -912,7 +912,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
83 + * the current certificate in order to check for revocation. */
84 + store_ctx = X509_STORE_CTX_new();
85 + X509_STORE_CTX_init(store_ctx, revocation_store, NULL, NULL);
86 +-#if OPENSSL_VERSION_NUMBER > 0x10100000L
87 ++#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
88 + obj = X509_OBJECT_new();
89 + rc=X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj);
90 + crl = X509_OBJECT_get0_X509_CRL(obj);
91 +@@ -942,7 +942,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
92 + "revoked per CRL from issuer %s\n", serial, serial, cp);
93 + OPENSSL_free(cp);
94 + X509_STORE_CTX_set_error(callback_ctx, X509_V_ERR_CERT_REVOKED);
95 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
96 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
97 + X509_OBJECT_free(obj);
98 + #else
99 + X509_OBJECT_free_contents(&obj);
100 +@@ -950,7 +950,7 @@ static int crl_callback(X509_STORE_CTX *callback_ctx) {
101 + return 0; /* Reject connection */
102 + }
103 + }
104 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
105 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
106 + X509_OBJECT_free(obj);
107 + #else
108 + X509_OBJECT_free_contents(&obj);
109 +@@ -1596,7 +1596,7 @@ static int switch_to_anon_dh(void) {
110 + if (ssl_client_mode) {
111 + return 1;
112 + }
113 +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
114 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
115 + /* Security level must be set to 0 for unauthenticated suites. */
116 + SSL_CTX_set_security_level(ctx, 0);
117 + #endif
118
119 diff --git a/x11-misc/x11vnc/x11vnc-0.9.16-r3.ebuild b/x11-misc/x11vnc/x11vnc-0.9.16-r3.ebuild
120 index f102419eb68..fa6c2d774e9 100644
121 --- a/x11-misc/x11vnc/x11vnc-0.9.16-r3.ebuild
122 +++ b/x11-misc/x11vnc/x11vnc-0.9.16-r3.ebuild
123 @@ -43,6 +43,7 @@ RDEPEND="${COMMON_DEPEND}
124 PATCHES=(
125 "${FILESDIR}"/${P}-crypto.patch # https://github.com/LibVNC/x11vnc/issues/86
126 "${FILESDIR}"/${P}-anonymous-ssl.patch # https://github.com/LibVNC/x11vnc/pull/85
127 + "${FILESDIR}"/${P}-libressl.patch
128 )
129
130 src_prepare() {