certs: Move RSA self-test data to separate file
authorJoachim Vandersmissen <git@jvdsn.com>
Mon, 13 May 2024 04:55:06 +0000 (23:55 -0500)
committerJarkko Sakkinen <jarkko@kernel.org>
Tue, 14 May 2024 02:01:03 +0000 (05:01 +0300)
commit8cd9f234f7066a783bb8beab8f25f9e31d878e17
tree9fb5e1157525fcc4dbef2bd36160068213305347
parent9d2fd8bdc12f403a5c35c971936a0e1d5cb5108e
certs: Move RSA self-test data to separate file

In preparation of adding new ECDSA self-tests, the existing data for
the RSA self-tests is moved to a separate file. This file is only
compiled if the new CONFIG_FIPS_SIGNATURE_SELFTEST_RSA configuration
option is set, which ensures that the required dependencies (RSA,
SHA-256) are present. Otherwise, the kernel would panic when trying to
execute the self-test.
The introduction of this new option, rather than adding the
dependencies to the existing CONFIG_FIPS_SIGNATURE_SELFTEST option,
allows for additional self-tests to be added for different algorithms.
The kernel can then be configured to only execute the self-tests for
those algorithms that are included.

Signed-off-by: Joachim Vandersmissen <git@jvdsn.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
crypto/asymmetric_keys/Kconfig
crypto/asymmetric_keys/Makefile
crypto/asymmetric_keys/selftest.c
crypto/asymmetric_keys/selftest.h [new file with mode: 0644]
crypto/asymmetric_keys/selftest_rsa.c [new file with mode: 0644]