From e81a89f1b6ccd3da8cffc51b431e0026126e34b9 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Sun, 18 Aug 2019 16:29:50 +0200 Subject: 20190818.2 global branch merge. Signed-off-by: Matteo Bernardini --- system/ecryptfs-utils/ecryptfs-utils.SlackBuild | 4 +- system/ecryptfs-utils/openssl.patch | 76 +++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 system/ecryptfs-utils/openssl.patch (limited to 'system/ecryptfs-utils') diff --git a/system/ecryptfs-utils/ecryptfs-utils.SlackBuild b/system/ecryptfs-utils/ecryptfs-utils.SlackBuild index 27ba7c2bbb..8a32014071 100644 --- a/system/ecryptfs-utils/ecryptfs-utils.SlackBuild +++ b/system/ecryptfs-utils/ecryptfs-utils.SlackBuild @@ -72,6 +72,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +patch -p0 < $CWD/openssl.patch + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -84,7 +86,7 @@ CXXFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --disable-pam \ --enable-gpg \ - --enable-tests \ + --disable-tests \ --build=$ARCH-slackware-linux make -j1 all check diff --git a/system/ecryptfs-utils/openssl.patch b/system/ecryptfs-utils/openssl.patch new file mode 100644 index 0000000000..5c3e419a91 --- /dev/null +++ b/system/ecryptfs-utils/openssl.patch @@ -0,0 +1,76 @@ +=== modified file 'src/key_mod/ecryptfs_key_mod_openssl.c' +--- src/key_mod/ecryptfs_key_mod_openssl.c 2013-10-25 19:45:09 +0000 ++++ src/key_mod/ecryptfs_key_mod_openssl.c 2017-03-13 20:34:27 +0000 +@@ -50,6 +50,20 @@ + #include "../include/ecryptfs.h" + #include "../include/decision_graph.h" + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++#endif ++ ++ + struct openssl_data { + char *path; + char *passphrase; +@@ -142,6 +156,7 @@ + { + int len, nbits, ebits, i; + int nbytes, ebytes; ++ const BIGNUM *key_n, *key_e; + unsigned char *hash; + unsigned char *data = NULL; + int rc = 0; +@@ -152,11 +167,13 @@ + rc = -ENOMEM; + goto out; + } +- nbits = BN_num_bits(key->n); ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ nbits = BN_num_bits(key_n); + nbytes = nbits / 8; + if (nbits % 8) + nbytes++; +- ebits = BN_num_bits(key->e); ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ ebits = BN_num_bits(key_e); + ebytes = ebits / 8; + if (ebits % 8) + ebytes++; +@@ -179,11 +196,13 @@ + data[i++] = '\02'; + data[i++] = (nbits >> 8); + data[i++] = nbits; +- BN_bn2bin(key->n, &(data[i])); ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ BN_bn2bin(key_n, &(data[i])); + i += nbytes; + data[i++] = (ebits >> 8); + data[i++] = ebits; +- BN_bn2bin(key->e, &(data[i])); ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ BN_bn2bin(key_e, &(data[i])); + i += ebytes; + SHA1(data, len + 3, hash); + to_hex(sig, (char *)hash, ECRYPTFS_SIG_SIZE); +@@ -278,7 +297,9 @@ + BIO *in = NULL; + int rc; + ++ #if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_malloc_init(); ++ #endif + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + ENGINE_load_builtin_engines(); + + -- cgit v1.2.3