All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: proc - Print fips status
@ 2023-02-09  1:16 Herbert Xu
  2023-02-09 14:19 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2023-02-09  1:16 UTC (permalink / raw)
  To: Linux Crypto Mailing List, Ondrej Mosnacek

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>

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");
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: proc - Print fips status
  2023-02-09  1:16 [PATCH] crypto: proc - Print fips status Herbert Xu
@ 2023-02-09 14:19 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2023-02-09 14:19 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Linux Crypto Mailing List, Ondrej Mosnacek

On Thu, 9 Feb 2023 at 02:17, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> 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>

>
> 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");
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-09 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09  1:16 [PATCH] crypto: proc - Print fips status Herbert Xu
2023-02-09 14:19 ` Ard Biesheuvel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.