summaryrefslogtreecommitdiff
path: root/lib/hash_int.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-12-20 15:36:59 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-02-19 08:39:36 +0100
commit0bca8ce7c2ed2cdadb52466ae5147ea9cb3997aa (patch)
tree79190e3ca998d82c9d98999970ddcd7a12c8c8ec /lib/hash_int.c
parent76bc340c4815e1e6d03390a6cd2ff4f097755255 (diff)
downloadgnutls-0bca8ce7c2ed2cdadb52466ae5147ea9cb3997aa.tar.gz
fips140: enforcement of hash and MACs use moved to crypto-api.c and hash_int.c
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/hash_int.c')
-rw-r--r--lib/hash_int.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/hash_int.c b/lib/hash_int.c
index ba2a5f01f1..1c33796e77 100644
--- a/lib/hash_int.c
+++ b/lib/hash_int.c
@@ -78,6 +78,9 @@ int _gnutls_digest_exists(gnutls_digest_algorithm_t algo)
{
const gnutls_crypto_digest_st *cc = NULL;
+ if (is_mac_algo_forbidden(algo))
+ return gnutls_assert_val(GNUTLS_E_UNWANTED_ALGORITHM);
+
cc = _gnutls_get_crypto_digest(algo);
if (cc != NULL)
return 1;
@@ -178,6 +181,9 @@ int _gnutls_mac_exists(gnutls_mac_algorithm_t algo)
if (algo == GNUTLS_MAC_AEAD)
return 1;
+ if (is_mac_algo_forbidden(algo))
+ return gnutls_assert_val(GNUTLS_E_UNWANTED_ALGORITHM);
+
cc = _gnutls_get_crypto_mac(algo);
if (cc != NULL)
return 1;