diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-04-14 17:27:43 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-04-23 09:36:55 +0200 |
commit | 3565b4b742fb1287b65d16d9b62765a2f894e853 (patch) | |
tree | 1b3769ab8147ffdefd18c46a348e0a20a4d91ed4 | |
parent | cb0f9fc4081dd6776a5c61daf3e6252943ef9b9d (diff) | |
download | gnutls-3565b4b742fb1287b65d16d9b62765a2f894e853.tar.gz |
crypto-selftests: tolerate errors of gnutls_{hash,hmac}_copy
Some hardware accelerated implementations, such as afalg, cannot
support the copy operation. This patch turns it a soft-error, as the
code below is already checking if the copy is non-NULL, before
performing any operation on it.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
-rw-r--r-- | lib/crypto-selftests.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/crypto-selftests.c b/lib/crypto-selftests.c index d076ad1324..36b7d067b2 100644 --- a/lib/crypto-selftests.c +++ b/lib/crypto-selftests.c @@ -2298,8 +2298,10 @@ static int test_digest(gnutls_digest_algorithm_t dig, return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); copy = gnutls_hash_copy(hd); - if (!copy) - return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); + if (!copy) { + _gnutls_debug_log("copy is not supported for: %s\n", + gnutls_digest_get_name(dig)); + } ret = gnutls_hash(hd, &vectors[i].plaintext[1], @@ -2602,8 +2604,10 @@ static int test_mac(gnutls_mac_algorithm_t mac, return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); copy = gnutls_hmac_copy(hd); - if (!copy) - return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); + if (!copy) { + _gnutls_debug_log("copy is not supported for: %s\n", + gnutls_mac_get_name(mac)); + } ret = gnutls_hmac(hd, &vectors[i].plaintext[1], |