From 0a213fac05bc63451f55fbe98ae60f3828afcbcc Mon Sep 17 00:00:00 2001 From: Piraty Date: Mon, 8 Jul 2019 19:05:39 +0200 Subject: [PATCH] argon2: update to 20190702. --- srcpkgs/argon2/patches/explicit-bzero.patch | 34 +++------------- srcpkgs/argon2/patches/libdir.patch | 21 ++++++++++ .../patches/wait-for-running-threads.patch | 40 ------------------- srcpkgs/argon2/template | 7 ++-- 4 files changed, 31 insertions(+), 71 deletions(-) create mode 100644 srcpkgs/argon2/patches/libdir.patch delete mode 100644 srcpkgs/argon2/patches/wait-for-running-threads.patch diff --git a/srcpkgs/argon2/patches/explicit-bzero.patch b/srcpkgs/argon2/patches/explicit-bzero.patch index ad58d1beeba..57762d70a11 100644 --- a/srcpkgs/argon2/patches/explicit-bzero.patch +++ b/srcpkgs/argon2/patches/explicit-bzero.patch @@ -1,34 +1,12 @@ -# the idea is picked up from upstream/master -# (80dca8559b929a9a08f4344d7dcda0d61677ef9a) -# but the patch is simplified to always use `explicit_bzero()`, so it works -# with musl too +# reason: use explizit_bzero on musl too! --- src/core.c +++ src/core.c -@@ -25,6 +25,9 @@ - #endif - #define VC_GE_2005(version) (version >= 1400) +@@ -27,6 +27,7 @@ + + /* for explicit_bzero() on glibc */ + #define _DEFAULT_SOURCE ++#define HAVE_EXPLICIT_BZERO 1 -+/* for explicit_bzero() */ -+#define _DEFAULT_SOURCE -+ #include #include - #include -@@ -121,16 +124,7 @@ - } - - void NOT_OPTIMIZED secure_wipe_memory(void *v, size_t n) { --#if defined(_MSC_VER) && VC_GE_2005(_MSC_VER) -- SecureZeroMemory(v, n); --#elif defined memset_s -- memset_s(v, n, 0, n); --#elif defined(__OpenBSD__) - explicit_bzero(v, n); --#else -- static void *(*const volatile memset_sec)(void *, int, size_t) = &memset; -- memset_sec(v, 0, n); --#endif - } - - /* Memory clear flag defaults to true. */ diff --git a/srcpkgs/argon2/patches/libdir.patch b/srcpkgs/argon2/patches/libdir.patch new file mode 100644 index 00000000000..6998392b5cf --- /dev/null +++ b/srcpkgs/argon2/patches/libdir.patch @@ -0,0 +1,21 @@ +# reason: +# upstream believes Ubuntu/Debian are the only ones +# to report "$(uname -s)-$(uname -m)" as Linux-x86_64 ... + +--- Makefile ++++ Makefile +@@ -140,14 +140,6 @@ + + else ifeq ($(KERNEL_NAME)-$(MACHINE_NAME), Linux-x86_64) + +-# default for Debian/Ubuntu x86_64 +-BINARY_REL ?= bin +-INCLUDE_REL ?= include +-LIBRARY_REL ?= lib/x86_64-linux-gnu +-PKGCONFIG_REL ?= $(LIBRARY_REL) +- +-else +- + # NetBSD, ... and Linux64/Linux32 variants that use plain lib directory + BINARY_REL ?= bin + INCLUDE_REL ?= include diff --git a/srcpkgs/argon2/patches/wait-for-running-threads.patch b/srcpkgs/argon2/patches/wait-for-running-threads.patch deleted file mode 100644 index 8c2e21eb583..00000000000 --- a/srcpkgs/argon2/patches/wait-for-running-threads.patch +++ /dev/null @@ -1,40 +0,0 @@ -# picked from upstream/master - -From cfa4385e728116989ad88b4be7c23b4868422778 Mon Sep 17 00:00:00 2001 -From: Milan Broz -Date: Mon, 11 Mar 2019 21:21:57 +0100 -Subject: [PATCH] Wait for already running threads if a thread creation failed. - -On memory-constrained systems (like cgroups limited processes) -thread creation often fails. - -The code needs to wait for already running threads on error path; -otherwise these threads can access deallocated memory -(and cause a segfault or another crash). ---- - src/core.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/core.c b/src/core.c -index 8361175..65f0537 100644 ---- src/core.c -+++ src/core.c -@@ -310,7 +310,7 @@ static int fill_memory_blocks_mt(argon2_instance_t *instance) { - - for (r = 0; r < instance->passes; ++r) { - for (s = 0; s < ARGON2_SYNC_POINTS; ++s) { -- uint32_t l; -+ uint32_t l, ll; - - /* 2. Calling threads */ - for (l = 0; l < instance->lanes; ++l) { -@@ -335,6 +335,9 @@ static int fill_memory_blocks_mt(argon2_instance_t *instance) { - sizeof(argon2_position_t)); - if (argon2_thread_create(&thread[l], &fill_segment_thr, - (void *)&thr_data[l])) { -+ /* Wait for already running threads */ -+ for (ll = 0; ll < l; ++ll) -+ argon2_thread_join(thread[ll]); - rc = ARGON2_THREAD_FAIL; - goto fail; - } diff --git a/srcpkgs/argon2/template b/srcpkgs/argon2/template index 66b895aa237..3c3cc7e61df 100644 --- a/srcpkgs/argon2/template +++ b/srcpkgs/argon2/template @@ -1,7 +1,7 @@ # Template file for 'argon2' pkgname=argon2 -version=20171227 -revision=4 +version=20190702 +revision=1 wrksrc="phc-winner-argon2-${version}" build_style=gnu-makefile make_use_env=yes @@ -13,7 +13,7 @@ maintainer="Piraty " license="CC0-1.0, Apache-2.0" homepage="https://github.com/P-H-C/phc-winner-argon2" distfiles="https://github.com/P-H-C/phc-winner-argon2/archive/${version}.tar.gz" -checksum=eaea0172c1f4ee4550d1b6c9ce01aab8d1ab66b4207776aa67991eb5872fdcd8 +checksum=daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c libargon2_package() { short_desc+="Password hashing library" @@ -29,5 +29,6 @@ libargon2-devel_package() { vmove usr/include vmove "usr/lib/*.a" vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig } }