diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-05-22 16:39:14 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-05-22 23:25:51 +0200 |
commit | f036d7e93887b4885072cdb2e7dfd2de499ccb3c (patch) | |
tree | c9b13fd8524d088772b77676fedd2129af5516c1 /lib/crypto-selftests-pk.c | |
parent | 09f9aa8e9c8f648a085cb0aea7faaa14fa4f8755 (diff) | |
download | gnutls-f036d7e93887b4885072cdb2e7dfd2de499ccb3c.tar.gz |
self-tests: all parameter was replaced by flags
This allows to introduce more options than just check all
ciphers.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/crypto-selftests-pk.c')
-rw-r--r-- | lib/crypto-selftests-pk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/crypto-selftests-pk.c b/lib/crypto-selftests-pk.c index 84a9963cea..9a7f3505bf 100644 --- a/lib/crypto-selftests-pk.c +++ b/lib/crypto-selftests-pk.c @@ -475,7 +475,7 @@ static int test_known_sig(gnutls_pk_algorithm_t pk, unsigned bits, gnutls_assert(); \ goto cleanup; \ } \ - if (all == 0) \ + if (!(flags & GNUTLS_SELF_TEST_FLAG_ALL)) \ return 0 #define PK_KNOWN_TEST(pk, det, bits, dig, pkey, sig) \ @@ -484,7 +484,7 @@ static int test_known_sig(gnutls_pk_algorithm_t pk, unsigned bits, gnutls_assert(); \ goto cleanup; \ } \ - if (all == 0) \ + if (!(flags & GNUTLS_SELF_TEST_FLAG_ALL)) \ return 0 @@ -683,7 +683,7 @@ cleanup: /*- * gnutls_pk_self_test: - * @all: if non-zero then tests to all public key algorithms are performed. + * @flags: GNUTLS_SELF_TEST_FLAG flags * @pk: the algorithm to use * * This function will run self tests on the provided public key algorithm. @@ -692,11 +692,11 @@ cleanup: * * Since: 3.3.0-FIPS140 -*/ -int gnutls_pk_self_test(unsigned all, gnutls_pk_algorithm_t pk) +int gnutls_pk_self_test(unsigned flags, gnutls_pk_algorithm_t pk) { int ret; - if (all != 0) + if (flags & GNUTLS_SELF_TEST_FLAG_ALL) pk = GNUTLS_PK_UNKNOWN; switch (pk) { @@ -710,7 +710,7 @@ int gnutls_pk_self_test(unsigned all, gnutls_pk_algorithm_t pk) goto cleanup; } - if (all == 0) + if (!(flags & GNUTLS_SELF_TEST_FLAG_ALL)) return 0; #endif case GNUTLS_PK_RSA: @@ -731,7 +731,7 @@ int gnutls_pk_self_test(unsigned all, gnutls_pk_algorithm_t pk) goto cleanup; } - if (all == 0) + if (!(flags & GNUTLS_SELF_TEST_FLAG_ALL)) return 0; #endif |