Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/qupzilla/, www-client/qupzilla/files/
Date: Sun, 07 May 2017 13:41:19
Message-Id: 1494164461.bf9726be7ed2586dd862f6ff241915c859c3a2cc.asturm@gentoo
1 commit: bf9726be7ed2586dd862f6ff241915c859c3a2cc
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 7 11:33:04 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun May 7 13:41:01 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf9726be
7
8 www-client/qupzilla: Fix build with >=dev-libs/openssl-1.1.0
9
10 See also:
11 https://github.com/openssl/openssl/issues/962#issuecomment-208792020
12
13 Closes: https://github.com/gentoo/gentoo/pull/4560
14
15 Package-Manager: Portage-2.3.5, Repoman-2.3.1
16
17 .../files/qupzilla-2.1.2-openssl-1.1.0.patch | 103 +++++++++++++++++++++
18 www-client/qupzilla/qupzilla-2.1.2.ebuild | 2 +
19 2 files changed, 105 insertions(+)
20
21 diff --git a/www-client/qupzilla/files/qupzilla-2.1.2-openssl-1.1.0.patch b/www-client/qupzilla/files/qupzilla-2.1.2-openssl-1.1.0.patch
22 new file mode 100644
23 index 00000000000..42effa56d5c
24 --- /dev/null
25 +++ b/www-client/qupzilla/files/qupzilla-2.1.2-openssl-1.1.0.patch
26 @@ -0,0 +1,103 @@
27 +From efc4725e91e10ccfef257143408d3a683e74a866 Mon Sep 17 00:00:00 2001
28 +From: Jose Rios <joseriosneto@××××××××××.com>
29 +Date: Mon, 1 May 2017 02:12:26 +0100
30 +Subject: [PATCH] Fixed compilation for Openssl 1.1.0
31 +
32 +Most of libcrypto and libssl internal structures were made
33 +opaque in this version not allowing to instatiate them in
34 +the stack.
35 +
36 +More info:
37 + * https://www.openssl.org/news/openssl-1.1.0-notes.html
38 + * https://github.com/openssl/openssl/issues/962#issuecomment-208792020
39 +---
40 + src/lib/tools/aesinterface.cpp | 28 ++++++++++++++++------------
41 + src/lib/tools/aesinterface.h | 4 ++--
42 + 2 files changed, 18 insertions(+), 14 deletions(-)
43 +
44 +diff --git a/src/lib/tools/aesinterface.cpp b/src/lib/tools/aesinterface.cpp
45 +index fa33eb3..29ed37e 100644
46 +--- a/src/lib/tools/aesinterface.cpp
47 ++++ b/src/lib/tools/aesinterface.cpp
48 +@@ -39,14 +39,18 @@ AesInterface::AesInterface(QObject* parent)
49 + : QObject(parent)
50 + , m_ok(false)
51 + {
52 +- EVP_CIPHER_CTX_init(&m_encodeCTX);
53 +- EVP_CIPHER_CTX_init(&m_decodeCTX);
54 ++ m_encodeCTX = EVP_CIPHER_CTX_new();
55 ++ m_decodeCTX = EVP_CIPHER_CTX_new();
56 ++ EVP_CIPHER_CTX_init(m_encodeCTX);
57 ++ EVP_CIPHER_CTX_init(m_decodeCTX);
58 + }
59 +
60 + AesInterface::~AesInterface()
61 + {
62 +- EVP_CIPHER_CTX_cleanup(&m_encodeCTX);
63 +- EVP_CIPHER_CTX_cleanup(&m_decodeCTX);
64 ++ EVP_CIPHER_CTX_cleanup(m_encodeCTX);
65 ++ EVP_CIPHER_CTX_cleanup(m_decodeCTX);
66 ++ EVP_CIPHER_CTX_free(m_encodeCTX);
67 ++ EVP_CIPHER_CTX_free(m_decodeCTX);
68 + }
69 +
70 + bool AesInterface::isOk()
71 +@@ -78,10 +82,10 @@ bool AesInterface::init(int evpMode, const QByteArray &password, const QByteArra
72 + int result = 0;
73 + if (evpMode == EVP_PKEY_MO_ENCRYPT) {
74 + m_iVector = createRandomData(EVP_MAX_IV_LENGTH);
75 +- result = EVP_EncryptInit_ex(&m_encodeCTX, EVP_aes_256_cbc(), NULL, key, (uchar*)m_iVector.constData());
76 ++ result = EVP_EncryptInit_ex(m_encodeCTX, EVP_aes_256_cbc(), NULL, key, (uchar*)m_iVector.constData());
77 + }
78 + else if (evpMode == EVP_PKEY_MO_DECRYPT) {
79 +- result = EVP_DecryptInit_ex(&m_decodeCTX, EVP_aes_256_cbc(), NULL, key, (uchar*)iVector.constData());
80 ++ result = EVP_DecryptInit_ex(m_decodeCTX, EVP_aes_256_cbc(), NULL, key, (uchar*)iVector.constData());
81 + }
82 +
83 + if (result == 0) {
84 +@@ -106,14 +110,14 @@ QByteArray AesInterface::encrypt(const QByteArray &plainData, const QByteArray &
85 + uchar* ciphertext = (uchar*)malloc(cipherlength);
86 +
87 + // allows reusing of 'm_encodeCTX' for multiple encryption cycles
88 +- EVP_EncryptInit_ex(&m_encodeCTX, NULL, NULL, NULL, NULL);
89 ++ EVP_EncryptInit_ex(m_encodeCTX, NULL, NULL, NULL, NULL);
90 +
91 + // update ciphertext, c_len is filled with the length of ciphertext generated,
92 + // dataLength is the size of plaintext in bytes
93 +- EVP_EncryptUpdate(&m_encodeCTX, ciphertext, &cipherlength, (uchar*)plainData.data(), dataLength);
94 ++ EVP_EncryptUpdate(m_encodeCTX, ciphertext, &cipherlength, (uchar*)plainData.data(), dataLength);
95 +
96 + // update ciphertext with the final remaining bytes
97 +- EVP_EncryptFinal_ex(&m_encodeCTX, ciphertext + cipherlength, &finalLength);
98 ++ EVP_EncryptFinal_ex(m_encodeCTX, ciphertext + cipherlength, &finalLength);
99 +
100 + dataLength = cipherlength + finalLength;
101 + QByteArray out((char*)ciphertext, dataLength);
102 +@@ -163,9 +167,9 @@ QByteArray AesInterface::decrypt(const QByteArray &cipherData, const QByteArray
103 + // because we have padding ON, we must allocate an extra cipher block size of memory
104 + uchar* plainText = (uchar*)malloc(plainTextLength + AES_BLOCK_SIZE);
105 +
106 +- EVP_DecryptInit_ex(&m_decodeCTX, NULL, NULL, NULL, NULL);
107 +- EVP_DecryptUpdate(&m_decodeCTX, plainText, &plainTextLength, cipherText, cipherLength);
108 +- int success = EVP_DecryptFinal_ex(&m_decodeCTX, plainText + plainTextLength, &finalLength);
109 ++ EVP_DecryptInit_ex(m_decodeCTX, NULL, NULL, NULL, NULL);
110 ++ EVP_DecryptUpdate(m_decodeCTX, plainText, &plainTextLength, cipherText, cipherLength);
111 ++ int success = EVP_DecryptFinal_ex(m_decodeCTX, plainText + plainTextLength, &finalLength);
112 +
113 + cipherLength = plainTextLength + finalLength;
114 +
115 +diff --git a/src/lib/tools/aesinterface.h b/src/lib/tools/aesinterface.h
116 +index e0debc6..c3c940c 100644
117 +--- a/src/lib/tools/aesinterface.h
118 ++++ b/src/lib/tools/aesinterface.h
119 +@@ -50,8 +50,8 @@ class QUPZILLA_EXPORT AesInterface : public QObject
120 + private:
121 + bool init(int evpMode, const QByteArray &password, const QByteArray &iVector = QByteArray());
122 +
123 +- EVP_CIPHER_CTX m_encodeCTX;
124 +- EVP_CIPHER_CTX m_decodeCTX;
125 ++ EVP_CIPHER_CTX* m_encodeCTX;
126 ++ EVP_CIPHER_CTX* m_decodeCTX;
127 +
128 + bool m_ok;
129 + QByteArray m_iVector;
130
131 diff --git a/www-client/qupzilla/qupzilla-2.1.2.ebuild b/www-client/qupzilla/qupzilla-2.1.2.ebuild
132 index d29ba96bcf1..3aa6951284d 100644
133 --- a/www-client/qupzilla/qupzilla-2.1.2.ebuild
134 +++ b/www-client/qupzilla/qupzilla-2.1.2.ebuild
135 @@ -58,6 +58,8 @@ DEPEND="${RDEPEND}
136
137 DOCS=( AUTHORS BUILDING.md CHANGELOG FAQ README.md )
138
139 +PATCHES=( "${FILESDIR}/${P}-openssl-1.1.0.patch" )
140 +
141 src_unpack() {
142 if [[ ${PV} == *9999 ]]; then
143 git-r3_src_unpack