diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2019-03-26 11:05:06 +0100 |
---|---|---|
committer | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2019-03-26 11:26:02 +0100 |
commit | 7f897dcd6e846269649a9e64767a575da79148ef (patch) | |
tree | 83a18b240ed9dead21696590c4d8c08193280731 /lib | |
parent | f87e0b3f1164cb582b99b1d7ed646f5b45591e2e (diff) | |
download | gnutls-7f897dcd6e846269649a9e64767a575da79148ef.tar.gz |
fips140: Perform SHA-3 self tests
It is required to perform the self tests to validate SHA-3
implementation.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fips.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/fips.c b/lib/fips.c index d0fb08a0f2..32436ad1f8 100644 --- a/lib/fips.c +++ b/lib/fips.c @@ -323,6 +323,31 @@ int _gnutls_fips_perform_self_checks2(void) goto error; } + /* Digest tests */ + ret = gnutls_digest_self_test(0, GNUTLS_DIG_SHA3_224); + if (ret < 0) { + gnutls_assert(); + goto error; + } + + ret = gnutls_digest_self_test(0, GNUTLS_DIG_SHA3_256); + if (ret < 0) { + gnutls_assert(); + goto error; + } + + ret = gnutls_digest_self_test(0, GNUTLS_DIG_SHA3_384); + if (ret < 0) { + gnutls_assert(); + goto error; + } + + ret = gnutls_digest_self_test(0, GNUTLS_DIG_SHA3_512); + if (ret < 0) { + gnutls_assert(); + goto error; + } + /* MAC (includes message digest test) */ ret = gnutls_mac_self_test(0, GNUTLS_MAC_SHA1); if (ret < 0) { |