From: Martin Willi Date: Wed, 19 Jun 2013 13:31:25 +0000 (+0200) Subject: unit-tests: test supported ECDSA schemes only X-Git-Tag: 5.1.0dr1~97^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0c09c84a59fc0e5e2cab17cb3f4e8bc54f89d22;p=thirdparty%2Fstrongswan.git unit-tests: test supported ECDSA schemes only --- diff --git a/src/libstrongswan/tests/test_ecdsa.c b/src/libstrongswan/tests/test_ecdsa.c index 7ab8b63fd6..2955bae2fc 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(