From 8aa5579e6ff9bfdde2c6bb149ddc906d81a9bf38 Mon Sep 17 00:00:00 2001 From: William Brown Date: Mon, 29 May 2017 12:12:39 +1000 Subject: [PATCH] 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: ??? --- 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 } -- 1.8.3.1