From fa7f5e2d0c2ace70c889f02d5b0ff2451fb3cb9b Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 26 Sep 2017 14:57:40 +0200 Subject: unit-tests: Warn if we skip RSA tests due to dependencies --- src/libstrongswan/tests/suites/test_rsa.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libstrongswan/tests/suites/test_rsa.c b/src/libstrongswan/tests/suites/test_rsa.c index 24406b109..3e7cf2e0b 100644 --- a/src/libstrongswan/tests/suites/test_rsa.c +++ b/src/libstrongswan/tests/suites/test_rsa.c @@ -60,6 +60,8 @@ static void test_good_sig(private_key_t *privkey, public_key_t *pubkey) !lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PRIVKEY_SIGN, schemes[i]))) { + warn("%N not supported, skip scheme", signature_scheme_names, + schemes[i]); continue; } if (schemes[i] == SIGN_RSA_EMSA_PSS) @@ -122,6 +124,8 @@ static void test_bad_sigs(public_key_t *pubkey) if (!lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PUBKEY_VERIFY, schemes[s]))) { + warn("%N not supported, skip scheme", signature_scheme_names, + schemes[s]); continue; } if (schemes[s] == SIGN_RSA_EMSA_PSS) @@ -1411,6 +1415,7 @@ START_TEST(test_sign_pkcs15_2048) !lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PRIVKEY_SIGN, scheme))) { + warn("%N not supported, skip test", signature_scheme_names, scheme); return; } fail_unless(privkey_2048->sign(privkey_2048, scheme, NULL, pkcs15_2048[_i].m, &sig), @@ -2551,6 +2556,7 @@ START_TEST(test_sign_pkcs15_3072) !lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PRIVKEY_SIGN, scheme))) { + warn("%N not supported, skip test", signature_scheme_names, scheme); return; } fail_unless(privkey_3072->sign(privkey_3072, scheme, NULL, pkcs15_3072[_i].m, &sig), @@ -3203,6 +3209,8 @@ START_TEST(test_sign_pss_no_salt) !lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PRIVKEY_SIGN, SIGN_RSA_EMSA_PSS))) { + warn("%N not supported, skip test", signature_scheme_names, + SIGN_RSA_EMSA_PSS); return; } privkey = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, @@ -3452,6 +3460,7 @@ START_TEST(test_verify_pkcs15) if (!lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PUBKEY_VERIFY, scheme))) { + warn("%N not supported, skip test", signature_scheme_names, scheme); return; } for (i = 0; i < countof(pkcs15_verify[_i].tests); i++) @@ -4414,6 +4423,8 @@ START_TEST(test_verify_pss) if (!lib->plugins->has_feature(lib->plugins, PLUGIN_PROVIDE(PUBKEY_VERIFY, SIGN_RSA_EMSA_PSS))) { + warn("%N not supported, skip test", signature_scheme_names, + SIGN_RSA_EMSA_PSS); return; } for (i = 0; i < countof(pss_verify[_i].tests); i++) -- cgit v1.2.3