diff --git a/core/openssl-cryptodev/PKGBUILD b/core/openssl-cryptodev/PKGBUILD index 7d8c6dd64..4af419d21 100644 --- a/core/openssl-cryptodev/PKGBUILD +++ b/core/openssl-cryptodev/PKGBUILD @@ -14,7 +14,7 @@ _ver=1.1.0f # use a pacman compatible version scheme pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}} #pkgver=$_ver -pkgrel=1 +pkgrel=2 pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security' arch=('arm' 'armv7h') url='https://www.openssl.org' @@ -28,23 +28,26 @@ _cryptodevver=1.9 source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz" 'ca-dir.patch' + 'fs54205.patch' "https://github.com/cryptodev-linux/cryptodev-linux/archive/cryptodev-linux-${_cryptodevver}.tar.gz") md5sums=('7b521dea79ab159e8ec879d2333369fa' '02b53865fb70faef763e262b4971aa4b' + '2f1b34d666894f447241c60191e9cfda' 'e5aacd2293cea9c94f71ca2e0b4dea57') prepare() { - cd $srcdir/$_pkgname-$_ver + cd "$srcdir/$_pkgname-$_ver" # set ca dir to /etc/ssl by default - patch -p0 -i $srcdir/ca-dir.patch + patch -p0 -i "$srcdir/ca-dir.patch" + patch -Np1 -i "$srcdir/fs54205.patch" # Copy the header file cp -u ${srcdir}/cryptodev-linux-cryptodev-linux-${_cryptodevver}/crypto/cryptodev.h ${srcdir}/openssl-${_ver}/crypto/ } build() { - cd $srcdir/$_pkgname-$_ver + cd "$srcdir/$_pkgname-$_ver" if [ "${CARCH}" == 'x86_64' ]; then openssltarget='linux-x86_64' @@ -72,16 +75,16 @@ build() { } check() { - cd $srcdir/$_pkgname-$_ver + cd "$srcdir/$_pkgname-$_ver" # the test fails due to missing write permissions in /etc/ssl # revert this patch for make test - patch -p0 -R -i $srcdir/ca-dir.patch + patch -p0 -R -i "$srcdir/ca-dir.patch" make test - patch -p0 -i $srcdir/ca-dir.patch + patch -p0 -i "$srcdir/ca-dir.patch" } package() { - cd $srcdir/$_pkgname-$_ver + cd "$srcdir/$_pkgname-$_ver" make DESTDIR=$pkgdir MANDIR=/usr/share/man MANSUFFIX=ssl install_sw install_ssldirs install_man_docs install -D -m644 LICENSE $pkgdir/usr/share/licenses/$_pkgname/LICENSE } diff --git a/core/openssl-cryptodev/fs54205.patch b/core/openssl-cryptodev/fs54205.patch new file mode 100644 index 000000000..f20068d42 --- /dev/null +++ b/core/openssl-cryptodev/fs54205.patch @@ -0,0 +1,41 @@ +From 6831138ced3804f8ebd2079b671a40c74794a8c4 Mon Sep 17 00:00:00 2001 +From: Rich Salz +Date: Wed, 31 May 2017 12:14:55 -0400 +Subject: [PATCH] Only release thread-local key if we created it. + +Thanks to Jan Alexander Steffens for finding the bug and confirming the +fix. +--- + crypto/err/err.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/crypto/err/err.c b/crypto/err/err.c +index f866f2fdd0a..c55f849590b 100644 +--- a/crypto/err/err.c ++++ b/crypto/err/err.c +@@ -122,6 +122,7 @@ static ERR_STRING_DATA ERR_str_reasons[] = { + #endif + + static CRYPTO_ONCE err_init = CRYPTO_ONCE_STATIC_INIT; ++static int set_err_thread_local; + static CRYPTO_THREAD_LOCAL err_thread_local; + + static CRYPTO_ONCE err_string_init = CRYPTO_ONCE_STATIC_INIT; +@@ -260,7 +261,8 @@ DEFINE_RUN_ONCE_STATIC(do_err_strings_init) + + void err_cleanup(void) + { +- CRYPTO_THREAD_cleanup_local(&err_thread_local); ++ if (set_err_thread_local != 0) ++ CRYPTO_THREAD_cleanup_local(&err_thread_local); + CRYPTO_THREAD_lock_free(err_string_lock); + err_string_lock = NULL; + } +@@ -639,6 +641,7 @@ void ERR_remove_state(unsigned long pid) + + DEFINE_RUN_ONCE_STATIC(err_do_init) + { ++ set_err_thread_local = 1; + return CRYPTO_THREAD_init_local(&err_thread_local, NULL); + } +