This is an automated email from the git hooks/post-receive script.
firstyear pushed a change to branch master in repository 389-ds-base.
from 5ecd8ec Ticket 49242 - add gdb script to rpm new e78dfe0 Ticket 49271 - Fix pbkdf2 and openssl missing issue new 9cd5292 Ticket 49268 - master branch fails on big endian systems
The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference.
Summary of changes: configure.ac | 2 +- src/libsds/external/csiphash/csiphash.c | 34 ++++++++++++--------------------- src/libsds/test/test_sds_csiphash.c | 10 +++++++++- test/libslapd/spal/meminfo.c | 15 +++++++++++++++ test/plugins/pwdstorage/pbkdf2.c | 4 ++++ 5 files changed, 41 insertions(+), 24 deletions(-)
This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master in repository 389-ds-base.
commit e78dfe0f2faccd7f63ee5fad857b7518258ff751 Author: William Brown firstyear@redhat.com Date: Mon May 29 12:12:39 2017 +1000
Ticket 49271 - Fix pbkdf2 and openssl missing issue
Bug Description: NSS 3.28 and lower don't support pbkdf2. If we are on this version, don't run the tests. We never released this feature for older rhel, so it only affects the test.
Fix Description: ifdef out the tests if NSS is too old.
https://pagure.io/389-ds-base/issue/49271
Author: wibrown
Review by: mreynolds (Thanks!) --- test/plugins/pwdstorage/pbkdf2.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/test/plugins/pwdstorage/pbkdf2.c b/test/plugins/pwdstorage/pbkdf2.c index 0193fbb..f2cc1b4 100644 --- a/test/plugins/pwdstorage/pbkdf2.c +++ b/test/plugins/pwdstorage/pbkdf2.c @@ -27,6 +27,7 @@ test_plugin_pwdstorage_nss_stop(void **state __attribute__((unused))) { void test_plugin_pwdstorage_pbkdf2_auth(void **state __attribute__((unused))) {
+#if (NSS_VMAJOR * 100 + NSS_VMINOR) > 328 /* Check that given various known passwords and hashes they validate (or don't) */
/* 'password' */ @@ -49,10 +50,12 @@ test_plugin_pwdstorage_pbkdf2_auth(void **state __attribute__((unused))) { assert_false(pbkdf2_sha256_pw_cmp("password", password_a_rounds) == 0); assert_false(pbkdf2_sha256_pw_cmp("password", password_a_salt) == 0); assert_false(pbkdf2_sha256_pw_cmp("password_b", password_a) == 0); +#endif }
void test_plugin_pwdstorage_pbkdf2_rounds(void **state __attribute__((unused))){ +#if (NSS_VMAJOR * 100 + NSS_VMINOR) > 328 /* Check the benchmark, and make sure we get a valid timestamp */ assert_true(pbkdf2_sha256_benchmark_iterations() > 0); /* @@ -69,5 +72,6 @@ test_plugin_pwdstorage_pbkdf2_rounds(void **state __attribute__((unused))){ assert_true(pbkdf2_sha256_calculate_iterations(200000000) == 10000); assert_true(pbkdf2_sha256_calculate_iterations(100000000) == 20000); assert_true(pbkdf2_sha256_calculate_iterations(50000000) == 40000); +#endif }
This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master in repository 389-ds-base.
commit 9cd5292e1862d3b2d6a4955f908501c41d20cc59 Author: William Brown firstyear@redhat.com Date: Thu May 25 12:49:11 2017 +1000
Ticket 49268 - master branch fails on big endian systems
Bug Description: We had a number of tests that did not function on a bigendian system, or a system with different pagesizes
Fix Description: Correct the tests to set the page size to a known value. Fix the hashtest to use correct endianness for inputs.
https://pagure.io/389-ds-base/issue/49268
Author: wibrown
Review by: mreynolds, lslebodn (Thanks!) --- configure.ac | 2 +- src/libsds/external/csiphash/csiphash.c | 34 ++++++++++++--------------------- src/libsds/test/test_sds_csiphash.c | 10 +++++++++- test/libslapd/spal/meminfo.c | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/configure.ac b/configure.ac index ce1589c..03c1eea 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,7 @@ AC_PROG_LIBTOOL AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h mntent.h sys/sysinfo.h]) +AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h mntent.h sys/sysinfo.h sys/endian.h endian.h])
# These are *required* headers without option. AC_CHECK_HEADERS([inttypes.h], [], AC_MSG_ERROR([unable to locate required header inttypes.h])) diff --git a/src/libsds/external/csiphash/csiphash.c b/src/libsds/external/csiphash/csiphash.c index 60066f9..d7a3c94 100644 --- a/src/libsds/external/csiphash/csiphash.c +++ b/src/libsds/external/csiphash/csiphash.c @@ -32,31 +32,21 @@ #include <inttypes.h> #include <stddef.h> /* for size_t */
-#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(_WIN32) -/* Windows is always little endian, unless you're on xbox360 - http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx */ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(__APPLE__) -# include <libkern/OSByteOrder.h> -# define _le64toh(x) OSSwapLittleToHostInt64(x) +#include <config.h> + +#if defined(HAVE_SYS_ENDIAN_H) +# include <sys/endian.h> +#elif defined(HAVE_ENDIAN_H) +# include <endian.h> #else +# error platform header for endian detection not found. +#endif
/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */ -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -# include <sys/endian.h> -# else -# include <endian.h> -# endif -# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ - __BYTE_ORDER == __LITTLE_ENDIAN -# define _le64toh(x) ((uint64_t)(x)) -# else -# define _le64toh(x) le64toh(x) -# endif - +#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN +# define _le64toh(x) ((uint64_t)(x)) +#else +# define _le64toh(x) le64toh(x) #endif
diff --git a/src/libsds/test/test_sds_csiphash.c b/src/libsds/test/test_sds_csiphash.c index 2973504..6e0a662 100644 --- a/src/libsds/test/test_sds_csiphash.c +++ b/src/libsds/test/test_sds_csiphash.c @@ -14,6 +14,14 @@
#include "test_sds.h"
+#if defined(HAVE_SYS_ENDIAN_H) +# include <sys/endian.h> +#elif defined(HAVE_ENDIAN_H) +# include <endian.h> +#else +# error platform header for endian detection not found. +#endif + static void test_siphash(void **state __attribute__((unused))) {
@@ -26,7 +34,7 @@ test_siphash(void **state __attribute__((unused))) { uint64_t test_b = 13042610424265326907U;
// Initial simple test - value = 5; + value = htole64(5); hashout = sds_siphash13(&value, sizeof(uint64_t), key); assert_true(hashout == test_a);
diff --git a/test/libslapd/spal/meminfo.c b/test/libslapd/spal/meminfo.c index 776141a..ff82826 100644 --- a/test/libslapd/spal/meminfo.c +++ b/test/libslapd/spal/meminfo.c @@ -33,6 +33,11 @@ test_libslapd_util_cachesane(void **state __attribute__((unused))) { slapi_pal_meminfo *mi = spal_meminfo_get(); uint64_t request = 0; mi->system_available_bytes = 0; + /* + * PPC 64 has a large page size, so we trigger the 16 page min. + * As a result, we set the pagesize to 4k just for this test. + */ + mi->pagesize_bytes = 4096; assert_true(util_is_cachesize_sane(mi, &request) == UTIL_CACHESIZE_ERROR);
// Set the values to known quantities @@ -47,6 +52,16 @@ test_libslapd_util_cachesane(void **state __attribute__((unused))) { assert_true(util_is_cachesize_sane(mi, &request) == UTIL_CACHESIZE_REDUCED); assert_true(request <= 75000);
+ /* + * we need to test the minimum reduction function. We make a request that gets + * reduced, but falls under the threshold of 16 * page. So we expect the result + * to be 16 * pagesize. + */ + mi->system_available_bytes = 65536; + request = 65537; + assert_true(util_is_cachesize_sane(mi, &request) == UTIL_CACHESIZE_REDUCED); + assert_true(request == (16 * mi->pagesize_bytes)); + spal_meminfo_destroy(mi); }
389-commits@lists.fedoraproject.org