summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/testmgr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 2c2ddebb48d3..0f6bfb6ce6a4 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -45,6 +45,9 @@ static bool notests;
45module_param(notests, bool, 0644); 45module_param(notests, bool, 0644);
46MODULE_PARM_DESC(notests, "disable crypto self-tests"); 46MODULE_PARM_DESC(notests, "disable crypto self-tests");
47 47
48static bool panic_on_fail;
49module_param(panic_on_fail, bool, 0444);
50
48#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS 51#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS
49static bool noextratests; 52static bool noextratests;
50module_param(noextratests, bool, 0644); 53module_param(noextratests, bool, 0644);
@@ -4109,8 +4112,9 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
4109 type, mask); 4112 type, mask);
4110 4113
4111test_done: 4114test_done:
4112 if (fips_enabled && rc) 4115 if (rc && (fips_enabled || panic_on_fail))
4113 panic("%s: %s alg self test failed in fips mode!\n", driver, alg); 4116 panic("alg: self-tests for %s (%s) failed in %s mode!\n",
4117 driver, alg, fips_enabled ? "fips" : "panic_on_fail");
4114 4118
4115 if (fips_enabled && !rc) 4119 if (fips_enabled && !rc)
4116 pr_info("alg: self-tests for %s (%s) passed\n", driver, alg); 4120 pr_info("alg: self-tests for %s (%s) passed\n", driver, alg);