]> git.baikalelectronics.ru Git - kernel.git/commit
certs: Add FIPS selftests
authorDavid Howells <dhowells@redhat.com>
Wed, 18 May 2022 16:15:34 +0000 (17:15 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 21 Jun 2022 15:05:12 +0000 (16:05 +0100)
commita3b33e61c26835118d846e99787bf327de50767a
tree41ec5b5f807d1f7f04c5d95d2e8caf82e734238b
parenta95162a30e992fccf6535bf3a8bdf4de78ba9fb5
certs: Add FIPS selftests

Add some selftests for signature checking when FIPS mode is enabled.  These
need to be done before we start actually using the signature checking for
things and must panic the kernel upon failure.

Note that the tests must not check the blacklist lest this provide a way to
prevent a kernel from booting by installing a hash of a test key in the
appropriate UEFI table.

Reported-by: Simo Sorce <simo@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Herbert Xu <herbert@gondor.apana.org.au>
cc: keyrings@vger.kernel.org
cc: linux-crypto@vger.kernel.org
Link: https://lore.kernel.org/r/165515742832.1554877.2073456606206090838.stgit@warthog.procyon.org.uk/
crypto/asymmetric_keys/Kconfig
crypto/asymmetric_keys/Makefile
crypto/asymmetric_keys/selftest.c [new file with mode: 0644]
crypto/asymmetric_keys/x509_parser.h
crypto/asymmetric_keys/x509_public_key.c