Skip to content

Commit c43cc88

Browse files
committed
crypto: proc - Print fips status
As FIPS may disable algorithms it is useful to show their status in /proc/crypto. Signed-off-by: Herbert Xu <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent bcdda43 commit c43cc88

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crypto/proc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/atomic.h>
1212
#include <linux/init.h>
1313
#include <linux/crypto.h>
14+
#include <linux/fips.h>
1415
#include <linux/module.h> /* for module_name() */
1516
#include <linux/rwsem.h>
1617
#include <linux/proc_fs.h>
@@ -48,6 +49,11 @@ static int c_show(struct seq_file *m, void *p)
4849
seq_printf(m, "internal : %s\n",
4950
(alg->cra_flags & CRYPTO_ALG_INTERNAL) ?
5051
"yes" : "no");
52+
if (fips_enabled) {
53+
seq_printf(m, "fips : %s\n",
54+
(alg->cra_flags & CRYPTO_ALG_FIPS_INTERNAL) ?
55+
"no" : "yes");
56+
}
5157

5258
if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
5359
seq_printf(m, "type : larval\n");

0 commit comments

Comments
 (0)