[PATCH RFC 012/104] crypto/algapi: don't init algapi in fips mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the kernel build supports a FIPS module loader and FIPS mode is
enabled, we should not start tests or register /proc/crypto as this
will already have been done by the FIPS module.

Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
---
 crypto/algapi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/crypto/algapi.c b/crypto/algapi.c
index e11b8fdb0865..09faecd47ea7 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -1105,6 +1105,14 @@ static void __init crypto_start_tests(void)
 
 static int __init crypto_algapi_init(void)
 {
+#if defined(CONFIG_CRYPTO_FIPS140_EXTMOD) && !defined(FIPS_MODULE)
+	/*
+	 * The FIPS module will have done the initialization already.
+	 */
+	if (fips_enabled)
+		return 0;
+#endif
+
 	crypto_init_proc();
 	crypto_start_tests();
 	return 0;
-- 
2.39.3





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux