[packages/lessfs] - up to 1.7.0; fix openssl 1.1.1 build

arekm arekm at pld-linux.org
Wed Sep 26 13:17:42 CEST 2018


commit 9603cbc9e1c907ba58562d74bb79bdcc1409c4b3
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Sep 26 13:17:36 2018 +0200

    - up to 1.7.0; fix openssl 1.1.1 build

 lessfs.spec   |  8 ++++---
 openssl.patch | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 3 deletions(-)
---
diff --git a/lessfs.spec b/lessfs.spec
index 43d49cd..b90278f 100644
--- a/lessfs.spec
+++ b/lessfs.spec
@@ -1,12 +1,13 @@
 Summary:	Lessfs is an inline data deduplicating filesystem
 Summary(pl.UTF-8):	Lessfs is an inline data deduplicating filesystem.
 Name:		lessfs
-Version:	1.5.9
-Release:	2
+Version:	1.7.0
+Release:	1
 License:	GPL v3
 Group:		Applications
 Source0:	http://downloads.sourceforge.net/lessfs/%{name}-%{version}.tar.gz
-# Source0-md5:	9b9cc21838446c05cf19e8bcbcbcb809
+# Source0-md5:	8afdb925dba24a58b74fff74d7f3180e
+Patch0:		openssl.patch
 URL:		http://www.lessfs.com/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -28,6 +29,7 @@ Lessfs is an inline data deduplicating filesystem.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__libtoolize}
diff --git a/openssl.patch b/openssl.patch
new file mode 100644
index 0000000..45f24eb
--- /dev/null
+++ b/openssl.patch
@@ -0,0 +1,72 @@
+--- lessfs-1.7.0/lib_crypto.c.org	2011-09-30 20:13:08.000000000 +0200
++++ lessfs-1.7.0/lib_crypto.c	2018-09-26 13:16:08.995599693 +0200
+@@ -78,7 +78,7 @@ unsigned char *safepassword()
+ DAT *lfsencrypt(unsigned char *unenc, unsigned long size)
+ {
+     unsigned char *safepasswd;
+-    EVP_CIPHER_CTX ctx;
++    EVP_CIPHER_CTX *ctx;
+     DAT *encoded;
+     int olen, tlen;
+ 
+@@ -86,19 +86,24 @@ DAT *lfsencrypt(unsigned char *unenc, un
+ 
+     pthread_mutex_lock(&crypto_mutex);
+     safepasswd = safepassword();
+-    EVP_CIPHER_CTX_init(&ctx);
+-    EVP_EncryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv);
++    ctx = EVP_CIPHER_CTX_new();
++    if (ctx == NULL) {
++        die_cryptoerr("can't allocate memory for new ctx");
++    }
++    EVP_EncryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv);
+     encoded = s_malloc(sizeof(DAT));
+     encoded->data = s_malloc(8 + size); //Blowfish can grow 64 bits
+ 
+-    if (EVP_EncryptUpdate(&ctx, encoded->data, &olen, unenc, size) != 1) {
++    if (EVP_EncryptUpdate(ctx, encoded->data, &olen, unenc, size) != 1) {
++        EVP_CIPHER_CTX_free(ctx);
+         die_cryptoerr("error in encrypt update\n");
+     }
+ 
+-    if (EVP_EncryptFinal(&ctx, encoded->data + olen, &tlen) != 1) {
++    if (EVP_EncryptFinal(ctx, encoded->data + olen, &tlen) != 1) {
++        EVP_CIPHER_CTX_free(ctx);
+         die_cryptoerr("error in encrypt final\n");
+     }
+-    EVP_CIPHER_CTX_cleanup(&ctx);
++    EVP_CIPHER_CTX_free(ctx);
+     encoded->size = olen + tlen;
+     if (encoded->size > 8 + size) {
+         die_cryptoerr
+@@ -123,20 +128,24 @@ DAT *lfsdecrypt(DAT * data)
+     decrypted->data = s_malloc(data->size);
+     safepasswd = safepassword();
+ 
+-    EVP_CIPHER_CTX ctx;
+-    EVP_CIPHER_CTX_init(&ctx);
+-    EVP_DecryptInit(&ctx, EVP_bf_cbc(), safepasswd, config->iv);
++    EVP_CIPHER_CTX *ctx;
++    ctx = EVP_CIPHER_CTX_new();
++    if (ctx == NULL)
++        die_cryptoerr("can't allocate memory for new ctx");
++    EVP_DecryptInit(ctx, EVP_bf_cbc(), safepasswd, config->iv);
+ 
+     if (EVP_DecryptUpdate
+-        (&ctx, decrypted->data, &olen, data->data, data->size) != 1) {
++        (ctx, decrypted->data, &olen, data->data, data->size) != 1) {
++        EVP_CIPHER_CTX_free(ctx);
+         die_cryptoerr("Unexpected fatal error while decrypting.\n");
+     }
+ 
+-    if (EVP_DecryptFinal(&ctx, decrypted->data + olen, &tlen) != 1) {
++    if (EVP_DecryptFinal(ctx, decrypted->data + olen, &tlen) != 1) {
++        EVP_CIPHER_CTX_free(ctx);
+         die_cryptoerr("Unexpected fatal error in decrypt final.\n");
+     }
+     olen += tlen;
+-    EVP_CIPHER_CTX_cleanup(&ctx);
++    EVP_CIPHER_CTX_free(ctx);
+     decrypted->size = olen;
+     s_free(safepasswd);
+     pthread_mutex_unlock(&crypto_mutex);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lessfs.git/commitdiff/9603cbc9e1c907ba58562d74bb79bdcc1409c4b3



More information about the pld-cvs-commit mailing list