Linux Modules
 help / color / mirror / Atom feed
* [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512
@ 2023-10-10 21:27 Dimitri John Ledkov
  2023-10-10 22:38 ` Luis Chamberlain
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dimitri John Ledkov @ 2023-10-10 21:27 UTC (permalink / raw)
  To: David Howells, David Woodhouse
  Cc: linux-modules, linux-crypto, herbert, mcgrof, keyrings,
	linux-kernel

NIST FIPS 186-5 states that it is recommended that the security
strength associated with the bit length of n and the security strength
of the hash function be the same, or higher upon agreement. Given NIST
P384 curve is used, force using either SHA384 or SHA512.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 certs/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/certs/Kconfig b/certs/Kconfig
index 1f109b0708..84582de66b 100644
--- a/certs/Kconfig
+++ b/certs/Kconfig
@@ -30,9 +30,11 @@ config MODULE_SIG_KEY_TYPE_RSA
 config MODULE_SIG_KEY_TYPE_ECDSA
 	bool "ECDSA"
 	select CRYPTO_ECDSA
+	depends on MODULE_SIG_SHA384 || MODULE_SIG_SHA512
 	help
-	 Use an elliptic curve key (NIST P384) for module signing. Consider
-	 using a strong hash like sha256 or sha384 for hashing modules.
+	 Use an elliptic curve key (NIST P384) for module signing. Use
+	 a strong hash of same or higher bit length, i.e. sha384 or
+	 sha512 for hashing modules.
 
 	 Note: Remove all ECDSA signing keys, e.g. certs/signing_key.pem,
 	 when falling back to building Linux 5.14 and older kernels.
-- 
2.34.1


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

* Re: [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512
  2023-10-10 21:27 [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 Dimitri John Ledkov
@ 2023-10-10 22:38 ` Luis Chamberlain
  2023-10-20  5:54 ` Herbert Xu
  2023-10-20  5:56 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2023-10-10 22:38 UTC (permalink / raw)
  To: Dimitri John Ledkov
  Cc: David Howells, David Woodhouse, linux-modules, linux-crypto,
	herbert, keyrings, linux-kernel

On Tue, Oct 10, 2023 at 10:27:55PM +0100, Dimitri John Ledkov wrote:
> NIST FIPS 186-5 states that it is recommended that the security
> strength associated with the bit length of n and the security strength
> of the hash function be the same, or higher upon agreement. Given NIST
> P384 curve is used, force using either SHA384 or SHA512.
> 
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---

I'd imagine this could go through crypto tree, as folks more in tune
with these requirements would be more aligned with what we need.

  Luis

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

* Re: [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512
  2023-10-10 21:27 [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 Dimitri John Ledkov
  2023-10-10 22:38 ` Luis Chamberlain
@ 2023-10-20  5:54 ` Herbert Xu
  2023-10-20  5:56 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2023-10-20  5:54 UTC (permalink / raw)
  To: Dimitri John Ledkov
  Cc: David Howells, David Woodhouse, linux-modules, linux-crypto,
	mcgrof, keyrings, linux-kernel

On Tue, Oct 10, 2023 at 10:27:55PM +0100, Dimitri John Ledkov wrote:
> NIST FIPS 186-5 states that it is recommended that the security
> strength associated with the bit length of n and the security strength
> of the hash function be the same, or higher upon agreement. Given NIST
> P384 curve is used, force using either SHA384 or SHA512.
> 
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>  certs/Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
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] 4+ messages in thread

* Re: [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512
  2023-10-10 21:27 [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 Dimitri John Ledkov
  2023-10-10 22:38 ` Luis Chamberlain
  2023-10-20  5:54 ` Herbert Xu
@ 2023-10-20  5:56 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2023-10-20  5:56 UTC (permalink / raw)
  To: Dimitri John Ledkov
  Cc: David Howells, David Woodhouse, linux-modules, linux-crypto,
	mcgrof, keyrings, linux-kernel

On Tue, Oct 10, 2023 at 10:27:55PM +0100, Dimitri John Ledkov wrote:
> NIST FIPS 186-5 states that it is recommended that the security
> strength associated with the bit length of n and the security strength
> of the hash function be the same, or higher upon agreement. Given NIST
> P384 curve is used, force using either SHA384 or SHA512.
> 
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> ---
>  certs/Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
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] 4+ messages in thread

end of thread, other threads:[~2023-10-20  5:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-10 21:27 [PATCH] crypto: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 Dimitri John Ledkov
2023-10-10 22:38 ` Luis Chamberlain
2023-10-20  5:54 ` Herbert Xu
2023-10-20  5:56 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox