[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ea809a9-6f36-aa02-cb68-f0a435f32398@suse.de>
Date: Mon, 21 Feb 2022 15:19:26 +0100
From: Hannes Reinecke <hare@...e.de>
To: Nicolai Stange <nstange@...e.de>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: Stephan Müller <smueller@...onox.de>,
Torsten Duwe <duwe@...e.de>,
David Howells <dhowells@...hat.com>,
Jarkko Sakkinen <jarkko@...nel.org>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
keyrings@...r.kernel.org
Subject: Re: [PATCH v4 12/15] crypto: api - allow algs only in specific
constructions in FIPS mode
On 2/21/22 13:10, Nicolai Stange wrote:
> Currently we do not distinguish between algorithms that fail on
> the self-test vs. those which are disabled in FIPS mode (not allowed).
> Both are marked as having failed the self-test.
>
> Recently the need arose to allow the usage of certain algorithms only
> as arguments to specific template instantiations in FIPS mode. For
> example, standalone "dh" must be blocked, but e.g. "ffdhe2048(dh)" is
> allowed. Other potential use cases include "cbcmac(aes)", which must
> only be used with ccm(), or "ghash", which must be used only for
> gcm().
>
> This patch allows this scenario by adding a new flag FIPS_INTERNAL to
> indicate those algorithms that are not FIPS-allowed. They can then be
> used as template arguments only, i.e. when looked up via
> crypto_grab_spawn() to be more specific. The FIPS_INTERNAL bit gets
> propagated upwards recursively into the surrounding template
> instances, until the construction eventually matches an explicit
> testmgr entry with ->fips_allowed being set, if any.
>
> The behaviour to skip !->fips_allowed self-test executions in FIPS
> mode will be retained. Note that this effectively means that
> FIPS_INTERNAL algorithms are handled very similarly to the INTERNAL
> ones in this regard. It is expected that the FIPS_INTERNAL algorithms
> will receive sufficient testing when the larger constructions they're
> a part of, if any, get exercised by testmgr.
>
> Note that as a side-effect of this patch algorithms which are not
> FIPS-allowed will now return ENOENT instead of ELIBBAD. Hopefully
> this is not an issue as some people were relying on this already.
>
> Link: https://lore.kernel.org/r/YeEVSaMEVJb3cQkq@gondor.apana.org.au
> Originally-by: Herbert Xu <herbert@...dor.apana.org.au>
> Signed-off-by: Nicolai Stange <nstange@...e.de>
> ---
> crypto/algapi.c | 18 ++++++++++++++++--
> crypto/api.c | 19 +++++++++++++++++--
> crypto/tcrypt.c | 4 ++--
> crypto/testmgr.c | 23 +++++++++++++++++++----
> include/linux/crypto.h | 9 +++++++++
> 5 files changed, 63 insertions(+), 10 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@...e.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Powered by blists - more mailing lists