Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lessfs/, sys-fs/lessfs/files/
Date: Sat, 26 Jan 2019 12:43:17
Message-Id: 1548506551.a0435f350a1be5d73c2d0a7dc6377669ec7668dc.pacho@gentoo
1 commit: a0435f350a1be5d73c2d0a7dc6377669ec7668dc
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 26 11:35:43 2019 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 26 12:42:31 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0435f35
7
8 sys-fs/lessfs: Fix openssl-1.1
9
10 Closes: https://bugs.gentoo.org/674422
11 Package-Manager: Portage-2.3.58, Repoman-2.3.12
12 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
13
14 sys-fs/lessfs/files/lessfs-1.7.0-openssl11.patch | 72 ++++++++++++++++++++++++
15 sys-fs/lessfs/lessfs-1.7.0-r1.ebuild | 5 ++
16 2 files changed, 77 insertions(+)
17
18 diff --git a/sys-fs/lessfs/files/lessfs-1.7.0-openssl11.patch b/sys-fs/lessfs/files/lessfs-1.7.0-openssl11.patch
19 new file mode 100644
20 index 00000000000..45f24eba3b1
21 --- /dev/null
22 +++ b/sys-fs/lessfs/files/lessfs-1.7.0-openssl11.patch
23 @@ -0,0 +1,72 @@
24 +--- lessfs-1.7.0/lib_crypto.c.org 2011-09-30 20:13:08.000000000 +0200
25 ++++ lessfs-1.7.0/lib_crypto.c 2018-09-26 13:16:08.995599693 +0200
26 +@@ -78,7 +78,7 @@ unsigned char *safepassword()
27 + DAT *lfsencrypt(unsigned char *unenc, unsigned long size)
28 + {
29 + unsigned char *safepasswd;
30 +- EVP_CIPHER_CTX ctx;
31 ++ EVP_CIPHER_CTX *ctx;
32 + DAT *encoded;
33 + int olen, tlen;
34 +
35 +@@ -86,19 +86,24 @@ DAT *lfsencrypt(unsigned char *unenc, un
36 +
37 + pthread_mutex_lock(&crypto_mutex);
38 + safepasswd = safepassword();
39 +- EVP_CIPHER_CTX_init(&ctx);
40 +- EVP_EncryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv);
41 ++ ctx = EVP_CIPHER_CTX_new();
42 ++ if (ctx == NULL) {
43 ++ die_cryptoerr("can't allocate memory for new ctx");
44 ++ }
45 ++ EVP_EncryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv);
46 + encoded = s_malloc(sizeof(DAT));
47 + encoded->data = s_malloc(8 + size); //Blowfish can grow 64 bits
48 +
49 +- if (EVP_EncryptUpdate(&ctx, encoded->data, &olen, unenc, size) != 1) {
50 ++ if (EVP_EncryptUpdate(ctx, encoded->data, &olen, unenc, size) != 1) {
51 ++ EVP_CIPHER_CTX_free(ctx);
52 + die_cryptoerr("error in encrypt update\n");
53 + }
54 +
55 +- if (EVP_EncryptFinal(&ctx, encoded->data + olen, &tlen) != 1) {
56 ++ if (EVP_EncryptFinal(ctx, encoded->data + olen, &tlen) != 1) {
57 ++ EVP_CIPHER_CTX_free(ctx);
58 + die_cryptoerr("error in encrypt final\n");
59 + }
60 +- EVP_CIPHER_CTX_cleanup(&ctx);
61 ++ EVP_CIPHER_CTX_free(ctx);
62 + encoded->size = olen + tlen;
63 + if (encoded->size > 8 + size) {
64 + die_cryptoerr
65 +@@ -123,20 +128,24 @@ DAT *lfsdecrypt(DAT * data)
66 + decrypted->data = s_malloc(data->size);
67 + safepasswd = safepassword();
68 +
69 +- EVP_CIPHER_CTX ctx;
70 +- EVP_CIPHER_CTX_init(&ctx);
71 +- EVP_DecryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv);
72 ++ EVP_CIPHER_CTX *ctx;
73 ++ ctx = EVP_CIPHER_CTX_new();
74 ++ if (ctx == NULL)
75 ++ die_cryptoerr("can't allocate memory for new ctx");
76 ++ EVP_DecryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv);
77 +
78 + if (EVP_DecryptUpdate
79 +- (&ctx, decrypted->data, &olen, data->data, data->size) != 1) {
80 ++ (ctx, decrypted->data, &olen, data->data, data->size) != 1) {
81 ++ EVP_CIPHER_CTX_free(ctx);
82 + die_cryptoerr("Unexpected fatal error while decrypting.\n");
83 + }
84 +
85 +- if (EVP_DecryptFinal(&ctx, decrypted->data + olen, &tlen) != 1) {
86 ++ if (EVP_DecryptFinal(ctx, decrypted->data + olen, &tlen) != 1) {
87 ++ EVP_CIPHER_CTX_free(ctx);
88 + die_cryptoerr("Unexpected fatal error in decrypt final.\n");
89 + }
90 + olen += tlen;
91 +- EVP_CIPHER_CTX_cleanup(&ctx);
92 ++ EVP_CIPHER_CTX_free(ctx);
93 + decrypted->size = olen;
94 + s_free(safepasswd);
95 + pthread_mutex_unlock(&crypto_mutex);
96
97 diff --git a/sys-fs/lessfs/lessfs-1.7.0-r1.ebuild b/sys-fs/lessfs/lessfs-1.7.0-r1.ebuild
98 index f0b3e0a95f0..aa7091174a6 100644
99 --- a/sys-fs/lessfs/lessfs-1.7.0-r1.ebuild
100 +++ b/sys-fs/lessfs/lessfs-1.7.0-r1.ebuild
101 @@ -33,6 +33,11 @@ DOC_CONTENTS="Default configuration file: /etc/${PN}.cfg.
102 If your host is a client consult the following configuration
103 file: /usr/share/doc/${PF}/${PN}.cfg-slave.*"
104
105 +PATCHES=(
106 + # From PLD-Linux, bug #674422
107 + "${FILESDIR}/${P}-openssl11.patch"
108 +)
109 +
110 src_configure() {
111 econf \
112 $(use_enable debug) $(use_enable debug lckdebug) \