aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 51bae62c332a..f93b26d0fcfb 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2308,6 +2308,9 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
2308 if (i < 0) 2308 if (i < 0)
2309 goto notest; 2309 goto notest;
2310 2310
2311 if (fips_enabled && !alg_test_descs[i].fips_allowed)
2312 goto non_fips_alg;
2313
2311 rc = alg_test_cipher(alg_test_descs + i, driver, type, mask); 2314 rc = alg_test_cipher(alg_test_descs + i, driver, type, mask);
2312 goto test_done; 2315 goto test_done;
2313 } 2316 }
@@ -2316,6 +2319,9 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
2316 if (i < 0) 2319 if (i < 0)
2317 goto notest; 2320 goto notest;
2318 2321
2322 if (fips_enabled && !alg_test_descs[i].fips_allowed)
2323 goto non_fips_alg;
2324
2319 rc = alg_test_descs[i].test(alg_test_descs + i, driver, 2325 rc = alg_test_descs[i].test(alg_test_descs + i, driver,
2320 type, mask); 2326 type, mask);
2321test_done: 2327test_done:
@@ -2331,5 +2337,7 @@ test_done:
2331notest: 2337notest:
2332 printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver); 2338 printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver);
2333 return 0; 2339 return 0;
2340non_fips_alg:
2341 return -EINVAL;
2334} 2342}
2335EXPORT_SYMBOL_GPL(alg_test); 2343EXPORT_SYMBOL_GPL(alg_test);