summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-02-09 04:16:45 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-02-14 08:39:33 +0300
commitc43cc8823d56b1d34744581e42d6eeaca028f1ab (patch)
treefeb3ca0aadff4af3ade4c9570e54b979ffd5c515 /crypto
parentbcdda4301bdc4955d45f7e1ffefb6207967b067e (diff)
downloadlinux-c43cc8823d56b1d34744581e42d6eeaca028f1ab.tar.xz
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 <herbert@gondor.apana.org.au> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/proc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/proc.c b/crypto/proc.c
index 12fccb9c5205..56c7c78df297 100644
--- a/crypto/proc.c
+++ b/crypto/proc.c
@@ -11,6 +11,7 @@
#include <linux/atomic.h>
#include <linux/init.h>
#include <linux/crypto.h>
+#include <linux/fips.h>
#include <linux/module.h> /* for module_name() */
#include <linux/rwsem.h>
#include <linux/proc_fs.h>
@@ -48,6 +49,11 @@ static int c_show(struct seq_file *m, void *p)
seq_printf(m, "internal : %s\n",
(alg->cra_flags & CRYPTO_ALG_INTERNAL) ?
"yes" : "no");
+ if (fips_enabled) {
+ seq_printf(m, "fips : %s\n",
+ (alg->cra_flags & CRYPTO_ALG_FIPS_INTERNAL) ?
+ "no" : "yes");
+ }
if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
seq_printf(m, "type : larval\n");