Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ell for openSUSE:Factory checked in at 2025-06-10 08:57:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ell (Old) and /work/SRC/openSUSE:Factory/.ell.new.19631 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ell" Tue Jun 10 08:57:40 2025 rev:49 rq:1283366 version:0.77 Changes: -------- --- /work/SRC/openSUSE:Factory/ell/ell.changes 2025-04-08 17:50:27.748562591 +0200 +++ /work/SRC/openSUSE:Factory/.ell.new.19631/ell.changes 2025-06-10 08:58:31.634645518 +0200 @@ -1,0 +2,7 @@ +Thu Jun 5 08:31:10 UTC 2025 - Luigi Baldoni <aloi...@gmx.com> + +- Update to version 0.77 + * Add support for precheck feature for unit tests. + * Add support for license variable for pkg-config. + +------------------------------------------------------------------- Old: ---- ell-0.76.tar.sign ell-0.76.tar.xz New: ---- ell-0.77.tar.sign ell-0.77.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ell.spec ++++++ --- /var/tmp/diff_new_pack.FPCwqQ/_old 2025-06-10 08:58:32.418677855 +0200 +++ /var/tmp/diff_new_pack.FPCwqQ/_new 2025-06-10 08:58:32.418677855 +0200 @@ -18,7 +18,7 @@ %define lname libell0 Name: ell -Version: 0.76 +Version: 0.77 Release: 0 Summary: Wireless setup and cryptography library License: LGPL-2.1-or-later ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.FPCwqQ/_old 2025-06-10 08:58:32.450679176 +0200 +++ /var/tmp/diff_new_pack.FPCwqQ/_new 2025-06-10 08:58:32.454679341 +0200 @@ -1,5 +1,5 @@ -mtime: 1743950600 -commit: 7883261da5cd56cb6fae0ecc9974922378896f89f13ca6949c3fe7df6e1a5b8f +mtime: 1749126419 +commit: 15c459b5eea2706f1562c6de9e9c11429fe14efa56994a59bd7b24b152374dd4 url: https://src.opensuse.org/jengelh/ell revision: master ++++++ build.specials.obscpio ++++++ ++++++ ell-0.76.tar.xz -> ell-0.77.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/ChangeLog new/ell-0.77/ChangeLog --- old/ell-0.76/ChangeLog 2025-04-02 20:33:28.000000000 +0200 +++ new/ell-0.77/ChangeLog 2025-05-07 12:33:02.000000000 +0200 @@ -1,3 +1,7 @@ +ver 0.77: + Add support for precheck feature for unit tests. + Add support for license variable for pkg-config. + ver 0.76: Fix issue with random scalar generation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/configure new/ell-0.77/configure --- old/ell-0.76/configure 2025-04-02 20:35:43.000000000 +0200 +++ new/ell-0.77/configure 2025-05-07 12:34:59.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for ell 0.76. +# Generated by GNU Autoconf 2.72 for ell 0.77. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, @@ -611,8 +611,8 @@ # Identity of this package. PACKAGE_NAME='ell' PACKAGE_TARNAME='ell' -PACKAGE_VERSION='0.76' -PACKAGE_STRING='ell 0.76' +PACKAGE_VERSION='0.77' +PACKAGE_STRING='ell 0.77' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1380,7 +1380,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures ell 0.76 to adapt to many kinds of systems. +'configure' configures ell 0.77 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1451,7 +1451,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ell 0.76:";; + short | recursive ) echo "Configuration of ell 0.77:";; esac cat <<\_ACEOF @@ -1581,7 +1581,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ell configure 0.76 +ell configure 0.77 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -1849,7 +1849,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ell $as_me 0.76, which was +It was created by ell $as_me 0.77, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3150,7 +3150,7 @@ # Define the identity of the package. PACKAGE='ell' - VERSION='0.76' + VERSION='0.77' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -14692,7 +14692,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ell $as_me 0.76, which was +This file was extended by ell $as_me 0.77, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14760,7 +14760,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ell config.status 0.76 +ell config.status 0.77 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/configure.ac new/ell-0.77/configure.ac --- old/ell-0.76/configure.ac 2025-04-02 20:33:28.000000000 +0200 +++ new/ell-0.77/configure.ac 2025-05-07 12:33:02.000000000 +0200 @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([ell],[0.76]) +AC_INIT([ell],[0.77]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_AUX_DIR(build-aux) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/ell/ell.pc.in new/ell-0.77/ell/ell.pc.in --- old/ell-0.76/ell/ell.pc.in 2020-11-29 22:35:22.000000000 +0100 +++ new/ell-0.77/ell/ell.pc.in 2025-05-07 12:33:02.000000000 +0200 @@ -8,3 +8,4 @@ Version: @VERSION@ Libs: -L${libdir} -lell Cflags: -I${includedir} +License: LGPL-2.1-or-later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/ell/ell.sym new/ell-0.77/ell/ell.sym --- old/ell-0.76/ell/ell.sym 2025-03-26 10:29:30.000000000 +0100 +++ new/ell-0.77/ell/ell.sym 2025-05-07 12:33:02.000000000 +0200 @@ -37,6 +37,8 @@ l_test_add; l_test_add_func; l_test_add_data_func; + l_test_add_func_precheck; + l_test_add_data_func_precheck; l_test_set_default_flags; /* strv */ l_strfreev; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/ell/test.c new/ell-0.77/ell/test.c --- old/ell-0.76/ell/test.c 2025-02-12 23:42:15.000000000 +0100 +++ new/ell-0.77/ell/test.c 2025-05-07 12:33:02.000000000 +0200 @@ -55,6 +55,7 @@ const char *name; const void *data; l_test_func_t function; + l_test_precheck_t precheck; unsigned long flags; unsigned int num; struct test *next; @@ -260,7 +261,7 @@ if (!run_all && (test->flags & L_TEST_FLAG_EXPENSIVE_COMPUTATION)) { /* * Abort test cases with long running computation task - * to fail and with the be gracefully skipped + * to fail and with that be gracefully skipped */ abort(); return; @@ -314,15 +315,39 @@ static void run_next_test(void *user_data) { + struct test *test = test_head; pid_t pid; - if (!test_head) { + if (!test) { testing_active = false; return; } if (!tap_enable) - printf("TEST: %s\n", test_head->name); + printf("TEST: %s\n", test->name); + + if (test->precheck) { + bool result = test->precheck(test->data); + + if (test->flags & L_TEST_FLAG_INVERT_PRECHECK_RESULT) + result = !result; + + if (!result) { + if (tap_enable) + printf("ok %u - %s # SKIP not-supported\n", + test->num, test->name); + + test_head = test->next; + free(test); + + if (!test_head) + test_tail = NULL; + + /* Trigger the main pollfd loop */ + kill(getpid(), SIGUSR1); + return; + } + } pid = fork(); if (pid < 0) { @@ -341,9 +366,9 @@ /* Close stdout to not interfere with TAP */ close(STDOUT_FILENO); - test_setup(test_head); - test_function(test_head); - test_teardown(test_head); + test_setup(test); + test_function(test); + test_teardown(test); exit(EXIT_SUCCESS); } @@ -439,6 +464,7 @@ sigaddset(&sig_mask, SIGINT); sigaddset(&sig_mask, SIGTERM); sigaddset(&sig_mask, SIGCHLD); + sigaddset(&sig_mask, SIGUSR1); /* * Block signals so that they aren't handled according to their @@ -489,6 +515,9 @@ case SIGCHLD: sigchld_handler(NULL); break; + case SIGUSR1: + run_next_test(NULL); + break; } } @@ -499,32 +528,10 @@ return exit_status; } -/** - * l_test_add_data_func: - * @name: test name - * @function: test function - * @flags: test flags; - * - * Add new test. - **/ -LIB_EXPORT void l_test_add_func(const char *name, l_test_func_t function, - unsigned long flags) -{ - l_test_add_data_func(name, NULL, function, flags); -} - -/** - * l_test_add_data_func: - * @name: test name - * @function: test function - * @data: test data - * @flags: test flags; - * - * Add new test. - **/ -LIB_EXPORT void l_test_add_data_func(const char *name, const void *data, - l_test_func_t function, - unsigned long flags) +static void common_add(const char *name, const void *data, + l_test_func_t function, + l_test_precheck_t precheck, + unsigned long flags) { struct test *test; @@ -539,6 +546,7 @@ test->name = name; test->data = data; test->function = function; + test->precheck = precheck; test->flags = flags; test->num = ++test_count; test->next = NULL; @@ -553,6 +561,73 @@ } /** + * l_test_add_func_precheck: + * @name: test name + * @data: test data + * @function: test function + * @precheck: precheck function + * @flags: test flags; + * + * Add new test. + **/ +LIB_EXPORT void l_test_add_func_precheck(const char *name, + l_test_func_t function, + l_test_precheck_t precheck, + unsigned long flags) +{ + common_add(name, NULL, function, precheck, flags); +} + +/** + * l_test_add_data_func_precheck: + * @name: test name + * @data: test data + * @function: test function + * @precheck: precheck function + * @flags: test flags; + * + * Add new test. + **/ +LIB_EXPORT void l_test_add_data_func_precheck(const char *name, + const void *data, + l_test_func_t function, + l_test_precheck_t precheck, + unsigned long flags) +{ + common_add(name, data, function, precheck, flags); +} + +/** + * l_test_add_data_func: + * @name: test name + * @function: test function + * @flags: test flags; + * + * Add new test. + **/ +LIB_EXPORT void l_test_add_func(const char *name, l_test_func_t function, + unsigned long flags) +{ + common_add(name, NULL, function, NULL, flags); +} + +/** + * l_test_add_data_func: + * @name: test name + * @data: test data + * @function: test function + * @flags: test flags; + * + * Add new test. + **/ +LIB_EXPORT void l_test_add_data_func(const char *name, const void *data, + l_test_func_t function, + unsigned long flags) +{ + common_add(name, data, function, NULL, flags); +} + +/** * l_test_add: * @name: test name * @function: test function @@ -563,7 +638,7 @@ LIB_EXPORT void l_test_add(const char *name, l_test_func_t function, const void *data) { - l_test_add_data_func(name, data, function, default_flags); + common_add(name, data, function, NULL, default_flags); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/ell/test.h new/ell-0.77/ell/test.h --- old/ell-0.76/ell/test.h 2025-02-12 23:42:15.000000000 +0100 +++ new/ell-0.77/ell/test.h 2025-05-07 12:33:02.000000000 +0200 @@ -8,6 +8,8 @@ #ifndef __ELL_TEST_H #define __ELL_TEST_H +#include <stdbool.h> + #ifdef __cplusplus extern "C" { #endif @@ -16,13 +18,23 @@ int l_test_run(void); typedef void (*l_test_func_t) (const void *data); +typedef bool (*l_test_precheck_t) (const void *data); #define L_TEST_FLAG_FAILURE_EXPECTED (1 << 1) #define L_TEST_FLAG_ALLOW_FAILURE (1 << 2) #define L_TEST_FLAG_LITTLE_ENDIAN_ONLY (1 << 3) #define L_TEST_FLAG_EXPENSIVE_COMPUTATION (1 << 4) -#define L_TEST_FLAG_REQUIRE_DBUS_SYSTEM_BUS (1 << 5) -#define L_TEST_FLAG_REQUIRE_DBUS_SESSION_BUS (1 << 6) +#define L_TEST_FLAG_INVERT_PRECHECK_RESULT (1 << 5) +#define L_TEST_FLAG_REQUIRE_DBUS_SYSTEM_BUS (1 << 8) +#define L_TEST_FLAG_REQUIRE_DBUS_SESSION_BUS (1 << 9) + +void l_test_add_func_precheck(const char *name, l_test_func_t function, + l_test_precheck_t precheck, + unsigned long flags); +void l_test_add_data_func_precheck(const char *name, const void *data, + l_test_func_t function, + l_test_precheck_t precheck, + unsigned long flags); void l_test_add_func(const char *name, l_test_func_t function, unsigned long flags); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-checksum.c new/ell-0.77/unit/test-checksum.c --- old/ell-0.76/unit/test-checksum.c 2025-03-26 10:29:30.000000000 +0100 +++ new/ell-0.77/unit/test-checksum.c 2025-05-07 12:33:02.000000000 +0200 @@ -30,6 +30,11 @@ assert(!checksum); } +static bool md4_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_MD4, false); +} + static void test_md4(const void *data) { struct l_checksum *checksum; @@ -53,6 +58,11 @@ l_checksum_free(checksum); } +static bool md5_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_MD5, false); +} + static void test_md5(const void *data) { struct l_checksum *checksum; @@ -76,6 +86,11 @@ l_checksum_free(checksum); } +static bool sha1_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_SHA1, false); +} + static void test_sha1(const void *data) { struct l_checksum *checksum; @@ -99,6 +114,11 @@ l_checksum_free(checksum); } +static bool sha256_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_SHA256, false); +} + static void test_sha256(const void *data) { struct l_checksum *checksum; @@ -484,6 +504,13 @@ "ed0fb440d187f382270cb455f21dd185", }; +static bool sha_precheck(const void *data) +{ + const struct sha_test *test = data; + + return l_checksum_is_supported(test->type, false); +} + static void test_sha(const void *data) { const struct sha_test *test = data; @@ -833,6 +860,13 @@ "134676fb6de0446065c97440fa8c6a58", }; +static bool hmac_sha_precheck(const void *data) +{ + const struct hmac_sha_test *test = data; + + return l_checksum_is_supported(test->type, true); +} + static void test_hmac_sha(const void *data) { const struct hmac_sha_test *test = data; @@ -1004,6 +1038,11 @@ .hash = "2ea6467aa3378c4c545eda62935b9b86", }; +static bool cmac_aes_precheck(const void *data) +{ + return l_checksum_cmac_aes_supported(); +} + static void test_cmac_aes(const void *data) { const struct cmac_aes_test *test = data; @@ -1046,14 +1085,14 @@ l_free(key); } -#define add_sha_test(name, data) l_test_add_data_func(name, data, \ - test_sha, L_TEST_FLAG_ALLOW_FAILURE) +#define add_sha_test(name, data) l_test_add_data_func_precheck(name, \ + data, test_sha, sha_precheck, 0) -#define add_hmac_sha_test(name, data) l_test_add_data_func(name, data, \ - test_hmac_sha, L_TEST_FLAG_ALLOW_FAILURE) +#define add_hmac_sha_test(name, data) l_test_add_data_func_precheck(name, \ + data, test_hmac_sha, hmac_sha_precheck, 0) -#define add_cmac_aes_test(name, data) l_test_add_data_func(name, data, \ - test_cmac_aes, L_TEST_FLAG_ALLOW_FAILURE) +#define add_cmac_aes_test(name, data) l_test_add_data_func_precheck(name, \ + data, test_cmac_aes, cmac_aes_precheck, 0) int main(int argc, char *argv[]) { @@ -1061,15 +1100,15 @@ l_test_add("unsupported", test_unsupported, NULL); - l_test_add_func("md4-1", test_md4, L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("md5-1", test_md5, L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("sha1-1", test_sha1, L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("sha256-1", test_sha256, L_TEST_FLAG_ALLOW_FAILURE); - - l_test_add_func("checksum reset", test_reset, - L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("checksum updatev", test_updatev, - L_TEST_FLAG_ALLOW_FAILURE); + l_test_add_func_precheck("md4-1", test_md4, md4_precheck, 0); + l_test_add_func_precheck("md5-1", test_md5, md5_precheck, 0); + l_test_add_func_precheck("sha1-1", test_sha1, sha1_precheck, 0); + l_test_add_func_precheck("sha256-1", test_sha256, sha256_precheck, 0); + + l_test_add_func_precheck("checksum reset", test_reset, + md5_precheck, 0); + l_test_add_func_precheck("checksum updatev", test_updatev, + sha1_precheck, 0); add_sha_test("SHA-1/1", &sha1_test1); add_sha_test("SHA-1/2", &sha1_test2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-cipher.c new/ell-0.77/unit/test-cipher.c --- old/ell-0.76/unit/test-cipher.c 2025-03-26 10:29:30.000000000 +0100 +++ new/ell-0.77/unit/test-cipher.c 2025-05-07 12:33:02.000000000 +0200 @@ -34,6 +34,11 @@ assert(!cipher); } +static bool aes_precheck(const void *data) +{ + return l_cipher_is_supported(L_CIPHER_AES); +} + static void test_aes(const void *data) { struct l_cipher *cipher; @@ -62,6 +67,11 @@ l_cipher_free(cipher); } +static bool aes_ctr_precheck(const void *data) +{ + return l_cipher_is_supported(L_CIPHER_AES_CTR); +} + static void test_aes_ctr(const void *data) { struct l_cipher *cipher; @@ -226,6 +236,13 @@ "DFC9C58DB67AADA613C2DD08457941A6", }; +static bool cipher_precheck(const void *data) +{ + const struct cipher_test *test = data; + + return l_cipher_is_supported(test->type); +} + static void test_encrypt(const void *data) { const struct cipher_test *test = data; @@ -462,8 +479,16 @@ .tag = "f2a9a836e155106aa8dcd618e4099aaa", }; +static bool aead_cipher_precheck(const void *data) +{ + const struct aead_test_vector *tv = data; + + return l_aead_cipher_is_supported(tv->type); +} + static void test_aead(const void *data) { + const struct aead_test_vector *tv = data; struct l_aead_cipher *cipher; char *encbuf; size_t encbuflen; @@ -471,7 +496,6 @@ size_t decbuflen; int r; bool success; - const struct aead_test_vector *tv = data; size_t ptlen = 0; uint8_t *pt = NULL; @@ -613,10 +637,13 @@ "828AC9B453E0E653", }; -#define add_encrypt_test(name, data) l_test_add_data_func(name, data, \ - test_encrypt, L_TEST_FLAG_ALLOW_FAILURE) -#define add_decrypt_test(name, data) l_test_add_data_func(name, data, \ - test_decrypt, L_TEST_FLAG_ALLOW_FAILURE) +#define add_encrypt_test(name, data) l_test_add_data_func_precheck(name, \ + data, test_encrypt, cipher_precheck, 0) +#define add_decrypt_test(name, data) l_test_add_data_func_precheck(name, \ + data, test_decrypt, cipher_precheck, 0) + +#define add_aead_test(name, data) l_test_add_data_func_precheck(name, data, \ + test_aead, aead_cipher_precheck, 0); int main(int argc, char *argv[]) { @@ -624,23 +651,19 @@ l_test_add("unsupported", test_unsupported, NULL); - l_test_add_func("aes", test_aes, L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("aes_ctr", test_aes_ctr, L_TEST_FLAG_ALLOW_FAILURE); + l_test_add_func_precheck("aes", test_aes, aes_precheck, 0); + l_test_add_func_precheck("aes_ctr", test_aes_ctr, aes_ctr_precheck, 0); - if (l_aead_cipher_is_supported(L_AEAD_CIPHER_AES_CCM)) { - l_test_add("aes_ccm long nonce", test_aead, &ccm_long_nonce); - l_test_add("aes_ccm short nonce", test_aead, &ccm_short_nonce); - l_test_add("aes_ccm no AAD", test_aead, &ccm_no_aad); - } - - if (l_aead_cipher_is_supported(L_AEAD_CIPHER_AES_GCM)) { - l_test_add("aes_gcm test 1", test_aead, &gcm_test1); - l_test_add("aes_gcm test 2", test_aead, &gcm_test2); - l_test_add("aes_gcm test 3", test_aead, &gcm_test3); - l_test_add("aes_gcm test 4", test_aead, &gcm_test4); - l_test_add("aes_gcm test 5", test_aead, &gcm_test5); - l_test_add("aes_gcm test 6", test_aead, &gcm_test6); - } + add_aead_test("aes_ccm long nonce", &ccm_long_nonce); + add_aead_test("aes_ccm short nonce", &ccm_short_nonce); + add_aead_test("aes_ccm no AAD", &ccm_no_aad); + + add_aead_test("aes_gcm test 1", &gcm_test1); + add_aead_test("aes_gcm test 2", &gcm_test2); + add_aead_test("aes_gcm test 3", &gcm_test3); + add_aead_test("aes_gcm test 4", &gcm_test4); + add_aead_test("aes_gcm test 5", &gcm_test5); + add_aead_test("aes_gcm test 6", &gcm_test6); add_encrypt_test("ARC4/encrypt/test 1", &arc4_test1); add_decrypt_test("ARC4/decrypt/test 1", &arc4_test1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-ecdh.c new/ell-0.77/unit/test-ecdh.c --- old/ell-0.76/unit/test-ecdh.c 2025-03-26 10:29:30.000000000 +0100 +++ new/ell-0.77/unit/test-ecdh.c 2025-05-07 12:33:02.000000000 +0200 @@ -44,6 +44,11 @@ return true; } +static bool getrandom_precheck(const void *data) +{ + return l_getrandom_is_supported(); +} + /* * Tests the most basic case. Generate two full public keys and use to create * two identical shared secrets. @@ -408,9 +413,9 @@ l_ecc_scalar_free(b_shared); } -#define add_basic_test(name, group) l_test_add_data_func(name, \ +#define add_basic_test(name, group) l_test_add_data_func_precheck(name, \ L_UINT_TO_PTR(group), \ - test_basic, L_TEST_FLAG_ALLOW_FAILURE) + test_basic, getrandom_precheck, 0) int main(int argc, char *argv[]) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-key.c new/ell-0.77/unit/test-key.c --- old/ell-0.76/unit/test-key.c 2025-02-12 23:42:15.000000000 +0100 +++ new/ell-0.77/unit/test-key.c 2025-05-07 12:33:02.000000000 +0200 @@ -646,6 +646,21 @@ l_key_free(pubkey); } +static bool key_dh_precheck(const void *data) +{ + return l_key_is_supported(L_KEY_FEATURE_DH); +} + +static bool key_restrict_precheck(const void *data) +{ + return l_key_is_supported(L_KEY_FEATURE_RESTRICT); +} + +static bool key_crypto_precheck(const void *data) +{ + return l_key_is_supported(L_KEY_FEATURE_CRYPTO); +} + int main(int argc, char *argv[]) { l_test_init(&argc, &argv); @@ -654,30 +669,25 @@ l_test_add_func("user key", test_user, 0); - if (l_key_is_supported(L_KEY_FEATURE_DH)) { - l_test_add_data_func("Diffie-Hellman 1", + l_test_add_data_func_precheck("Diffie-Hellman 1", &dh_valid1, test_dh, - L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_data_func("Diffie-Hellman 2", + key_dh_precheck, 0); + l_test_add_data_func_precheck("Diffie-Hellman 2", &dh_valid2, test_dh, - L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_data_func("Diffie-Hellman 3", + key_dh_precheck, 0); + l_test_add_data_func_precheck("Diffie-Hellman 3", &dh_degenerate, test_dh, - L_TEST_FLAG_ALLOW_FAILURE); - } + key_dh_precheck, 0); - l_test_add_func("simple keyring", test_simple_keyring, - L_TEST_FLAG_ALLOW_FAILURE); + l_test_add_func("simple keyring", test_simple_keyring, 0); - if (l_key_is_supported(L_KEY_FEATURE_RESTRICT)) { - l_test_add_func("trusted keyring", test_trusted_keyring, - L_TEST_FLAG_ALLOW_FAILURE); - l_test_add_func("trust chain", test_trust_chain, - L_TEST_FLAG_ALLOW_FAILURE); - } + l_test_add_func_precheck("trusted keyring", test_trusted_keyring, + key_restrict_precheck, 0); + l_test_add_func_precheck("trust chain", test_trust_chain, + key_restrict_precheck, 0); - if (l_key_is_supported(L_KEY_FEATURE_CRYPTO)) - l_test_add_func("key crypto", test_key_crypto, + l_test_add_func_precheck("key crypto", test_key_crypto, + key_crypto_precheck, L_TEST_FLAG_ALLOW_FAILURE); return l_test_run(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-pbkdf2.c new/ell-0.77/unit/test-pbkdf2.c --- old/ell-0.76/unit/test-pbkdf2.c 2025-02-12 23:42:15.000000000 +0100 +++ new/ell-0.77/unit/test-pbkdf2.c 2025-05-07 12:33:02.000000000 +0200 @@ -140,42 +140,46 @@ .key = "6b9cf26d45455a43a5b8bb276a403b39", }; +static bool test_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_SHA1, true); +} + +#define add_test(name, func, data) l_test_add_data_func_precheck(name, \ + data, func, test_precheck, 0) +#define add_test_exp(name, func, data) l_test_add_data_func_precheck(name, \ + data, func, test_precheck, \ + L_TEST_FLAG_EXPENSIVE_COMPUTATION) + int main(int argc, char *argv[]) { l_test_init(&argc, &argv); - if (!l_checksum_is_supported(L_CHECKSUM_SHA1, true)) { - printf("SHA1 support missing, skipping...\n"); - goto done; - } - - l_test_add("/pbkdf2-sha1/PBKDF2 Test vector 1", + add_test("/pbkdf2-sha1/PBKDF2 Test vector 1", pbkdf2_test, &pbkdf2_test_vector_1); - l_test_add("/pbkdf2-sha1/PBKDF2 Test vector 2", + add_test("/pbkdf2-sha1/PBKDF2 Test vector 2", pbkdf2_test, &pbkdf2_test_vector_2); - l_test_add("/pbkdf2-sha1/PBKDF2 Test vector 3", + add_test("/pbkdf2-sha1/PBKDF2 Test vector 3", pbkdf2_test, &pbkdf2_test_vector_3); - l_test_add_data_func("/pbkdf2-sha1/PBKDF2 Test vector 4", - &pbkdf2_test_vector_4, pbkdf2_test, - L_TEST_FLAG_EXPENSIVE_COMPUTATION); - l_test_add("/pbkdf2-sha1/PBKDF2 Test vector 5", + add_test_exp("/pbkdf2-sha1/PBKDF2 Test vector 4", + pbkdf2_test, &pbkdf2_test_vector_4); + add_test("/pbkdf2-sha1/PBKDF2 Test vector 5", pbkdf2_test, &pbkdf2_test_vector_5); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 1", + add_test("/pbkdf2-sha1/ATHENA Test vector 1", pbkdf2_test, &athena_test_vector_1); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 2", + add_test("/pbkdf2-sha1/ATHENA Test vector 2", pbkdf2_test, &athena_test_vector_2); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 3", + add_test("/pbkdf2-sha1/ATHENA Test vector 3", pbkdf2_test, &athena_test_vector_3); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 4", + add_test("/pbkdf2-sha1/ATHENA Test vector 4", pbkdf2_test, &athena_test_vector_4); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 5", + add_test("/pbkdf2-sha1/ATHENA Test vector 5", pbkdf2_test, &athena_test_vector_5); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 6", + add_test("/pbkdf2-sha1/ATHENA Test vector 6", pbkdf2_test, &athena_test_vector_6); - l_test_add("/pbkdf2-sha1/ATHENA Test vector 7", + add_test("/pbkdf2-sha1/ATHENA Test vector 7", pbkdf2_test, &athena_test_vector_7); -done: return l_test_run(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-random.c new/ell-0.77/unit/test-random.c --- old/ell-0.76/unit/test-random.c 2023-09-27 11:03:04.000000000 +0200 +++ new/ell-0.77/unit/test-random.c 2025-05-07 12:33:02.000000000 +0200 @@ -33,17 +33,17 @@ assert(memcmp(buf1, buf2, 128)); } +static bool getrandom_precheck(const void *data) +{ + return l_getrandom_is_supported(); +} + int main(int argc, char *argv[]) { l_test_init(&argc, &argv); - if (!l_getrandom_is_supported()) { - printf("getrandom syscall missing, skipping..."); - goto done; - } - - l_test_add("l_getrandom sanity check", test_random, NULL); + l_test_add_func_precheck("l_getrandom sanity check", test_random, + getrandom_precheck, 0); -done: return l_test_run(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-unit.c new/ell-0.77/unit/test-unit.c --- old/ell-0.76/unit/test-unit.c 2025-02-10 23:50:01.000000000 +0100 +++ new/ell-0.77/unit/test-unit.c 2025-05-07 12:33:02.000000000 +0200 @@ -67,6 +67,26 @@ l_dbus_set_disconnect_handler(dbus, disconnect_callback, NULL, NULL); } +static void test_ok(const void *data) +{ + assert(1); +} + +static void test_fail(const void *data) +{ + assert(0); +} + +static bool precheck_success(const void *data) +{ + return true; +} + +static bool precheck_failure(const void *data) +{ + return false; +} + int main(int argc, char *argv[]) { l_test_init(&argc, &argv); @@ -84,5 +104,14 @@ L_TEST_FLAG_ALLOW_FAILURE | L_TEST_FLAG_REQUIRE_DBUS_SESSION_BUS); + l_test_add_func_precheck("add-precheck-success", + test_ok, precheck_success, 0); + l_test_add_func_precheck("add-precheck-failure", + test_ok, precheck_failure, + L_TEST_FLAG_INVERT_PRECHECK_RESULT); + l_test_add_func_precheck("add-precheck-success-fail", + test_fail, precheck_success, + L_TEST_FLAG_FAILURE_EXPECTED); + return l_test_run(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.76/unit/test-uuid.c new/ell-0.77/unit/test-uuid.c --- old/ell-0.76/unit/test-uuid.c 2023-09-27 11:03:04.000000000 +0200 +++ new/ell-0.77/unit/test-uuid.c 2025-05-07 12:33:02.000000000 +0200 @@ -208,20 +208,30 @@ assert(!memcmp(uuid, expected_uuid, sizeof(uuid))); } -int main(int argc, char *argv[]) +static bool getrandom_precheck(const void *data) { - l_test_init(&argc, &argv); + return l_getrandom_is_supported(); +} - if (l_checksum_is_supported(L_CHECKSUM_MD5, false)) - l_test_add("/uuid/v3", test_v3, NULL); +static bool md5_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_MD5, false); +} - if (l_getrandom_is_supported()) - l_test_add("/uuid/v4", test_v4, NULL); +static bool sha1_precheck(const void *data) +{ + return l_checksum_is_supported(L_CHECKSUM_SHA1, false); +} + +int main(int argc, char *argv[]) +{ + l_test_init(&argc, &argv); - if (l_checksum_is_supported(L_CHECKSUM_SHA1, false)) { - l_test_add("/uuid/v5", test_v5, NULL); - l_test_add("/uuid/to string", test_to_string, NULL); - } + l_test_add_func_precheck("/uuid/v3", test_v3, md5_precheck, 0); + l_test_add_func_precheck("/uuid/v4", test_v4, getrandom_precheck, 0); + l_test_add_func_precheck("/uuid/v5", test_v5, sha1_precheck, 0); + l_test_add_func_precheck("/uuid/to string", test_to_string, + sha1_precheck, 0); l_test_add("/uuid/from string", test_from_string, NULL); l_test_add("/uuid/from string/too short",