diff --git a/src/libstrongswan/tests/test_ecdsa.c b/src/libstrongswan/tests/test_ecdsa.c index 7ab8b63fd..2955bae2f 100644 --- a/src/libstrongswan/tests/test_ecdsa.c +++ b/src/libstrongswan/tests/test_ecdsa.c @@ -15,6 +15,8 @@ #include "test_suite.h" +#include + /** * Signature schemes to test */ @@ -43,6 +45,13 @@ static void test_good_sig(private_key_t *privkey, public_key_t *pubkey) for (i = 0; i < countof(schemes); i++) { + if (!lib->plugins->has_feature(lib->plugins, + PLUGIN_PROVIDE(PUBKEY_VERIFY, schemes[i].scheme)) || + !lib->plugins->has_feature(lib->plugins, + PLUGIN_PROVIDE(PRIVKEY_SIGN, schemes[i].scheme))) + { + continue; + } if (schemes[i].key_size != 0 && schemes[i].scheme != privkey->get_keysize(privkey)) { @@ -104,6 +113,11 @@ static void test_bad_sigs(public_key_t *pubkey) { continue; } + if (!lib->plugins->has_feature(lib->plugins, + PLUGIN_PROVIDE(PUBKEY_VERIFY, schemes[s].scheme))) + { + continue; + } for (i = 0; i < countof(invalid_sigs); i++) { fail_if(