From 6c13b08816b206b3ff2bab09fe55157cb3417fd1 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Aug 16 2017 13:15:51 +0000 Subject: Fix the t-secmem on PPC64 --- diff --git a/libgcrypt-1.8.0-build.patch b/libgcrypt-1.8.0-build.patch new file mode 100644 index 0000000..02d8821 --- /dev/null +++ b/libgcrypt-1.8.0-build.patch @@ -0,0 +1,34 @@ +diff -up libgcrypt-1.8.0/tests/t-secmem.c.build libgcrypt-1.8.0/tests/t-secmem.c +--- libgcrypt-1.8.0/tests/t-secmem.c.build 2017-01-18 15:24:25.000000000 +0100 ++++ libgcrypt-1.8.0/tests/t-secmem.c 2017-08-16 15:12:48.948224849 +0200 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #define PGM "t-secmem" + +@@ -37,17 +38,21 @@ test_secmem (void) + { + void *a[28]; + void *b; ++ long oversize; + int i; + + memset (a, 0, sizeof a); + ++ oversize = sysconf (_SC_PAGESIZE); ++ oversize = oversize <= 16384 ? 2048 : oversize - (16384 - 2048); ++ + /* Allocating 28*512=14k should work in the default 16k pool even + * with extrem alignment requirements. */ + for (i=0; i < DIM(a); i++) + a[i] = gcry_xmalloc_secure (512); + + /* Allocating another 2k should fail for the default 16k pool. */ +- b = gcry_malloc_secure (2048); ++ b = gcry_malloc_secure (oversize); + if (b) + fail ("allocation did not fail as expected\n"); + diff --git a/libgcrypt.spec b/libgcrypt.spec index d38e9b8..91a71c9 100644 --- a/libgcrypt.spec +++ b/libgcrypt.spec @@ -33,6 +33,8 @@ Patch14: libgcrypt-1.7.3-ecc-test-fix.patch Patch18: libgcrypt-1.6.2-fips-ctor.patch # Block some operations if in FIPS non-operational state Patch22: libgcrypt-1.7.3-fips-reqs.patch +# Fix the t-secmem on PPC64 +Patch23: libgcrypt-1.8.0-build.patch %define gcrylibdir %{_libdir} @@ -76,7 +78,7 @@ applications using libgcrypt. %patch14 -p1 -b .eccfix %patch18 -p1 -b .fips-ctor %patch22 -p1 -b .fips-reqs -#%patch23 -p1 -b .aliasing +%patch23 -p1 -b .build cp %{SOURCE4} cipher/ cp %{SOURCE5} %{SOURCE6} tests/