2022-01-12 23:15:53

by Justin M. Forbes

[permalink] [raw]
Subject: [PATCH v2] lib/crypto: add prompts back to crypto libraries

Commit 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in") took
away a number of prompt texts from other crypto libraries. This makes
values flip from built-in to module when oldconfig runs, and causes
problems when these crypto libs need to be built in for thingslike
BIG_KEYS.

Fixes: 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in")
Signed-off-by: Justin M. Forbes <[email protected]>
---
lib/crypto/Kconfig | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 8620f38e117c..179041b60294 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0

+menu "Crypto library routines"
+
config CRYPTO_LIB_AES
tristate

@@ -40,7 +42,7 @@ config CRYPTO_LIB_CHACHA_GENERIC
of CRYPTO_LIB_CHACHA.

config CRYPTO_LIB_CHACHA
- tristate
+ tristate "ChaCha library interface"
depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=n
help
@@ -65,7 +67,7 @@ config CRYPTO_LIB_CURVE25519_GENERIC
of CRYPTO_LIB_CURVE25519.

config CRYPTO_LIB_CURVE25519
- tristate
+ tristate "Curve25519 scalar multiplication library"
depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519
select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
help
@@ -100,7 +102,7 @@ config CRYPTO_LIB_POLY1305_GENERIC
of CRYPTO_LIB_POLY1305.

config CRYPTO_LIB_POLY1305
- tristate
+ tristate "Poly1305 library interface"
depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
select CRYPTO_LIB_POLY1305_GENERIC if CRYPTO_ARCH_HAVE_LIB_POLY1305=n
help
@@ -109,7 +111,7 @@ config CRYPTO_LIB_POLY1305
is available and enabled.

config CRYPTO_LIB_CHACHA20POLY1305
- tristate
+ tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
select CRYPTO_LIB_CHACHA
@@ -120,3 +122,5 @@ config CRYPTO_LIB_SHA256

config CRYPTO_LIB_SM4
tristate
+
+endmenu
--
2.34.1


2022-01-12 23:17:05

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

This commit also needs this snippet:

diff --git a/crypto/Kconfig b/crypto/Kconfig
index 94bfa32cc6a1..442765219c37 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1928,5 +1928,3 @@ source "crypto/asymmetric_keys/Kconfig"
source "certs/Kconfig"

endif # if CRYPTO
-
-source "lib/crypto/Kconfig"
diff --git a/lib/Kconfig b/lib/Kconfig
index 655b0e43f260..c20b68ad2bc3 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -122,6 +122,8 @@ config INDIRECT_IOMEM_FALLBACK
mmio accesses when the IO memory address is not a registered
emulated region.

+source "lib/crypto/Kconfig"
+
config CRC_CCITT
tristate "CRC-CCITT functions"
help

2022-01-12 23:17:11

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
>
> This commit also needs this snippet:
>

Why?

> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index 94bfa32cc6a1..442765219c37 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -1928,5 +1928,3 @@ source "crypto/asymmetric_keys/Kconfig"
> source "certs/Kconfig"
>
> endif # if CRYPTO
> -
> -source "lib/crypto/Kconfig"
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 655b0e43f260..c20b68ad2bc3 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -122,6 +122,8 @@ config INDIRECT_IOMEM_FALLBACK
> mmio accesses when the IO memory address is not a registered
> emulated region.
>
> +source "lib/crypto/Kconfig"
> +
> config CRC_CCITT
> tristate "CRC-CCITT functions"
> help

2022-01-12 23:17:29

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
>
> On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> >
> > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > >
> > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > >
> > > > This commit also needs this snippet:
> > > >
> > >
> > > Why?
> >
> > So that the menu of crypto library options is inside of the library
> > menu. Otherwise this will appear inside of the _root_ menu, which
> > isn't what we want.
>
> Why not? I think that's fine.

It's really not appropriate there. Look:

- Justin vanilla: https://i.imgur.com/14UBpML.png
- Justin + Jason: https://i.imgur.com/lDfZnma.png

We really don't want another top level menu. We're not that important.
Rather, crypto libraries are but one ordinary subset of ordinary
libraries, just like how the build system does it too.

2022-01-12 23:17:34

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
>
> On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> >
> > This commit also needs this snippet:
> >
>
> Why?

So that the menu of crypto library options is inside of the library
menu. Otherwise this will appear inside of the _root_ menu, which
isn't what we want.

2022-01-12 23:17:39

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > >
> > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > >
> > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > >
> > > > > This commit also needs this snippet:
> > > > >
> > > >
> > > > Why?
> > >
> > > So that the menu of crypto library options is inside of the library
> > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > isn't what we want.
> >
> > Why not? I think that's fine.
>
> It's really not appropriate there. Look:
>
> - Justin vanilla: https://i.imgur.com/14UBpML.png
> - Justin + Jason: https://i.imgur.com/lDfZnma.png
>
> We really don't want another top level menu. We're not that important.
> Rather, crypto libraries are but one ordinary subset of ordinary
> libraries, just like how the build system does it too.

I disagree. The root menu is a jumble of things already, and having
this one at the root is really not a problem.

2022-01-12 23:17:39

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > >
> > > This commit also needs this snippet:
> > >
> >
> > Why?
>
> So that the menu of crypto library options is inside of the library
> menu. Otherwise this will appear inside of the _root_ menu, which
> isn't what we want.

Why not? I think that's fine.

2022-01-12 23:18:36

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:19 PM Justin Forbes <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 8:15 AM Jason A. Donenfeld <[email protected]> wrote:
> >
> > On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
> > >
> > > On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> > > >
> > > > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > > > >
> > > > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > > > >
> > > > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > > >
> > > > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > > >
> > > > > > > > This commit also needs this snippet:
> > > > > > > >
> > > > > > >
> > > > > > > Why?
> > > > > >
> > > > > > So that the menu of crypto library options is inside of the library
> > > > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > > > isn't what we want.
> > > > >
> > > > > Why not? I think that's fine.
> > > >
> > > > It's really not appropriate there. Look:
> > > >
> > > > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > > > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> > > >
> > > > We really don't want another top level menu. We're not that important.
> > > > Rather, crypto libraries are but one ordinary subset of ordinary
> > > > libraries, just like how the build system does it too.
> > >
> > > I disagree. The root menu is a jumble of things already, and having
> > > this one at the root is really not a problem.
> >
> > Should CRC routines also go into a submenu and be put at the root?
> > What about other library functions? Library functions belong in the
> > library submenu. We don't need our own top level submenu for this. The
> > whole point of lib/crypto/ is that they're just boring library
> > functions. Libraries! So, part of the libraries menu.
>
> Specifically in this menu, users were expecting to see it in the
> Cryptographic API menu. I think having it in the main menu just below
> this entry is much more appropriate than being buried under another
> menu. Particularly if the goal is to get rid of the menu again all
> together once we can audit the full set of deps on crypto libraries.

The thing is, even once we get rid of the labels, part of detangling
everything is going to involve moving the sourcing of those symbols
into lib/Kconfig anyway. No use delaying the inevitable.

2022-01-12 23:18:37

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 8:15 AM Jason A. Donenfeld <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> > >
> > > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > > >
> > > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > > >
> > > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > >
> > > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > >
> > > > > > > This commit also needs this snippet:
> > > > > > >
> > > > > >
> > > > > > Why?
> > > > >
> > > > > So that the menu of crypto library options is inside of the library
> > > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > > isn't what we want.
> > > >
> > > > Why not? I think that's fine.
> > >
> > > It's really not appropriate there. Look:
> > >
> > > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> > >
> > > We really don't want another top level menu. We're not that important.
> > > Rather, crypto libraries are but one ordinary subset of ordinary
> > > libraries, just like how the build system does it too.
> >
> > I disagree. The root menu is a jumble of things already, and having
> > this one at the root is really not a problem.
>
> Should CRC routines also go into a submenu and be put at the root?
> What about other library functions? Library functions belong in the
> library submenu. We don't need our own top level submenu for this. The
> whole point of lib/crypto/ is that they're just boring library
> functions. Libraries! So, part of the libraries menu.

Specifically in this menu, users were expecting to see it in the
Cryptographic API menu. I think having it in the main menu just below
this entry is much more appropriate than being buried under another
menu. Particularly if the goal is to get rid of the menu again all
together once we can audit the full set of deps on crypto libraries.

Justin

2022-01-12 23:19:57

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, 12 Jan 2022 at 15:15, Jason A. Donenfeld <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> > >
> > > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > > >
> > > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > > >
> > > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > >
> > > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > >
> > > > > > > This commit also needs this snippet:
> > > > > > >
> > > > > >
> > > > > > Why?
> > > > >
> > > > > So that the menu of crypto library options is inside of the library
> > > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > > isn't what we want.
> > > >
> > > > Why not? I think that's fine.
> > >
> > > It's really not appropriate there. Look:
> > >
> > > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> > >
> > > We really don't want another top level menu. We're not that important.
> > > Rather, crypto libraries are but one ordinary subset of ordinary
> > > libraries, just like how the build system does it too.
> >
> > I disagree. The root menu is a jumble of things already, and having
> > this one at the root is really not a problem.
>
> Should CRC routines also go into a submenu and be put at the root?
> What about other library functions? Library functions belong in the
> library submenu. We don't need our own top level submenu for this. The
> whole point of lib/crypto/ is that they're just boring library
> functions. Libraries! So, part of the libraries menu.

Shouting it doesn't make it true.

Nobody cares about what the root menu looks like, and given that this
patch is presumably going to be sent as an early fix on top of your
rng branch, it is better not to touch anything under crypto/ unless
you are 100% certain it is not going to conflict with Herbert's tree.

2022-01-12 23:20:11

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:42 PM Ard Biesheuvel <[email protected]> wrote:
>
> On Wed, 12 Jan 2022 at 15:15, Jason A. Donenfeld <[email protected]> wrote:
> >
> > On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
> > >
> > > On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> > > >
> > > > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > > > >
> > > > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > > > >
> > > > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > > >
> > > > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > > >
> > > > > > > > This commit also needs this snippet:
> > > > > > > >
> > > > > > >
> > > > > > > Why?
> > > > > >
> > > > > > So that the menu of crypto library options is inside of the library
> > > > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > > > isn't what we want.
> > > > >
> > > > > Why not? I think that's fine.
> > > >
> > > > It's really not appropriate there. Look:
> > > >
> > > > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > > > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> > > >
> > > > We really don't want another top level menu. We're not that important.
> > > > Rather, crypto libraries are but one ordinary subset of ordinary
> > > > libraries, just like how the build system does it too.
> > >
> > > I disagree. The root menu is a jumble of things already, and having
> > > this one at the root is really not a problem.
> >
> > Should CRC routines also go into a submenu and be put at the root?
> > What about other library functions? Library functions belong in the
> > library submenu. We don't need our own top level submenu for this. The
> > whole point of lib/crypto/ is that they're just boring library
> > functions. Libraries! So, part of the libraries menu.
>
> Shouting it doesn't make it true.

I'm not shouting. I respectfully disagree with your perspective. I
think the comparison to CRC routines is an apt one, still unaddressed.

> Nobody cares about what the root menu looks like

I certainly do.

> and given that this
> patch is presumably going to be sent as an early fix on top of your
> rng branch, it is better not to touch anything under crypto/ unless
> you are 100% certain it is not going to conflict with Herbert's tree.

Oh, I was thinking Herbert would take this since he hasn't sent a pull
yet? Otherwise, sure, I can do it.

Jason

2022-01-12 23:20:19

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
>
> On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> >
> > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > >
> > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > >
> > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > >
> > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > >
> > > > > > This commit also needs this snippet:
> > > > > >
> > > > >
> > > > > Why?
> > > >
> > > > So that the menu of crypto library options is inside of the library
> > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > isn't what we want.
> > >
> > > Why not? I think that's fine.
> >
> > It's really not appropriate there. Look:
> >
> > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> >
> > We really don't want another top level menu. We're not that important.
> > Rather, crypto libraries are but one ordinary subset of ordinary
> > libraries, just like how the build system does it too.
>
> I disagree. The root menu is a jumble of things already, and having
> this one at the root is really not a problem.

Should CRC routines also go into a submenu and be put at the root?
What about other library functions? Library functions belong in the
library submenu. We don't need our own top level submenu for this. The
whole point of lib/crypto/ is that they're just boring library
functions. Libraries! So, part of the libraries menu.

2022-01-12 23:20:55

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, 12 Jan 2022 at 15:44, Jason A. Donenfeld <[email protected]> wrote:
>
> On Wed, Jan 12, 2022 at 3:42 PM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Wed, 12 Jan 2022 at 15:15, Jason A. Donenfeld <[email protected]> wrote:
> > >
> > > On Wed, Jan 12, 2022 at 3:13 PM Ard Biesheuvel <[email protected]> wrote:
> > > >
> > > > On Wed, 12 Jan 2022 at 15:12, Jason A. Donenfeld <[email protected]> wrote:
> > > > >
> > > > > On Wed, Jan 12, 2022 at 3:08 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > >
> > > > > > On Wed, 12 Jan 2022 at 15:08, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > >
> > > > > > > On Wed, Jan 12, 2022 at 3:06 PM Ard Biesheuvel <[email protected]> wrote:
> > > > > > > >
> > > > > > > > On Wed, 12 Jan 2022 at 15:05, Jason A. Donenfeld <[email protected]> wrote:
> > > > > > > > >
> > > > > > > > > This commit also needs this snippet:
> > > > > > > > >
> > > > > > > >
> > > > > > > > Why?
> > > > > > >
> > > > > > > So that the menu of crypto library options is inside of the library
> > > > > > > menu. Otherwise this will appear inside of the _root_ menu, which
> > > > > > > isn't what we want.
> > > > > >
> > > > > > Why not? I think that's fine.
> > > > >
> > > > > It's really not appropriate there. Look:
> > > > >
> > > > > - Justin vanilla: https://i.imgur.com/14UBpML.png
> > > > > - Justin + Jason: https://i.imgur.com/lDfZnma.png
> > > > >
> > > > > We really don't want another top level menu. We're not that important.
> > > > > Rather, crypto libraries are but one ordinary subset of ordinary
> > > > > libraries, just like how the build system does it too.
> > > >
> > > > I disagree. The root menu is a jumble of things already, and having
> > > > this one at the root is really not a problem.
> > >
> > > Should CRC routines also go into a submenu and be put at the root?
> > > What about other library functions? Library functions belong in the
> > > library submenu. We don't need our own top level submenu for this. The
> > > whole point of lib/crypto/ is that they're just boring library
> > > functions. Libraries! So, part of the libraries menu.
> >
> > Shouting it doesn't make it true.
>
> I'm not shouting. I respectfully disagree with your perspective. I
> think the comparison to CRC routines is an apt one, still unaddressed.
>

Sure, but none of this is relevant for the short term fix that we need
to get in asap. There are lots of future changes we can philosophize
about, but those discussions should take place on the linux-crypto
list after the merge window closes.

> > Nobody cares about what the root menu looks like
>
> I certainly do.
>

Fair enough. But on many architectures, it looks absolutely horrid,
and I rarely see fixes sent for it.

> > and given that this
> > patch is presumably going to be sent as an early fix on top of your
> > rng branch, it is better not to touch anything under crypto/ unless
> > you are 100% certain it is not going to conflict with Herbert's tree.
>
> Oh, I was thinking Herbert would take this since he hasn't sent a pull
> yet? Otherwise, sure, I can do it.
>

How could he? This patch does not apply to his cryptodev tree, which
won't receive backmerges from mainline until the next cycle.

2022-01-12 23:21:12

by Jason A. Donenfeld

[permalink] [raw]
Subject: Re: [PATCH v2] lib/crypto: add prompts back to crypto libraries

On Wed, Jan 12, 2022 at 3:50 PM Ard Biesheuvel <[email protected]> wrote:
>
> Sure, but none of this is relevant for the short term fix that we need
> to get in asap. There are lots of future changes we can philosophize
> about, but those discussions should take place on the linux-crypto
> list after the merge window closes.

I think of adding things to the root menu as a regression. I'd like to
avoid an additional regression in fixing this.

> > > and given that this
> > > patch is presumably going to be sent as an early fix on top of your
> > > rng branch, it is better not to touch anything under crypto/ unless
> > > you are 100% certain it is not going to conflict with Herbert's tree.
> >
> > Oh, I was thinking Herbert would take this since he hasn't sent a pull
> > yet? Otherwise, sure, I can do it.
> >
>
> How could he? This patch does not apply to his cryptodev tree, which
> won't receive backmerges from mainline until the next cycle.

Oh, okay then. I'll take it. In which case, I really don't want to be
the one responsible for mucking up the root menu with something nobody
cares about (crypto library submenu). I'll fix up the menu location
thing locally then and send a v3 here.

Jason

2022-01-12 23:21:41

by Jason A. Donenfeld

[permalink] [raw]
Subject: [PATCH v3] lib/crypto: add prompts back to crypto libraries

From: "Justin M. Forbes" <[email protected]>

Commit 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in") took
away a number of prompt texts from other crypto libraries. This makes
values flip from built-in to module when oldconfig runs, and causes
problems when these crypto libs need to be built in for thingslike
BIG_KEYS.

Fixes: 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in")
Cc: Herbert Xu <[email protected]>
Cc: [email protected]
Signed-off-by: Justin M. Forbes <[email protected]>
[Jason: moved menu into submenu of lib/ instead of root menu]
Signed-off-by: Jason A. Donenfeld <[email protected]>
---
crypto/Kconfig | 2 --
lib/Kconfig | 2 ++
lib/crypto/Kconfig | 12 ++++++++----
3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/crypto/Kconfig b/crypto/Kconfig
index 55718de56137..a346b6f74bb3 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1924,5 +1924,3 @@ source "crypto/asymmetric_keys/Kconfig"
source "certs/Kconfig"

endif # if CRYPTO
-
-source "lib/crypto/Kconfig"
diff --git a/lib/Kconfig b/lib/Kconfig
index 5e7165e6a346..9534698ce890 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -122,6 +122,8 @@ config INDIRECT_IOMEM_FALLBACK
mmio accesses when the IO memory address is not a registered
emulated region.

+source "lib/crypto/Kconfig"
+
config CRC_CCITT
tristate "CRC-CCITT functions"
help
diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 8620f38e117c..179041b60294 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0

+menu "Crypto library routines"
+
config CRYPTO_LIB_AES
tristate

@@ -40,7 +42,7 @@ config CRYPTO_LIB_CHACHA_GENERIC
of CRYPTO_LIB_CHACHA.

config CRYPTO_LIB_CHACHA
- tristate
+ tristate "ChaCha library interface"
depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=n
help
@@ -65,7 +67,7 @@ config CRYPTO_LIB_CURVE25519_GENERIC
of CRYPTO_LIB_CURVE25519.

config CRYPTO_LIB_CURVE25519
- tristate
+ tristate "Curve25519 scalar multiplication library"
depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519
select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
help
@@ -100,7 +102,7 @@ config CRYPTO_LIB_POLY1305_GENERIC
of CRYPTO_LIB_POLY1305.

config CRYPTO_LIB_POLY1305
- tristate
+ tristate "Poly1305 library interface"
depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
select CRYPTO_LIB_POLY1305_GENERIC if CRYPTO_ARCH_HAVE_LIB_POLY1305=n
help
@@ -109,7 +111,7 @@ config CRYPTO_LIB_POLY1305
is available and enabled.

config CRYPTO_LIB_CHACHA20POLY1305
- tristate
+ tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
select CRYPTO_LIB_CHACHA
@@ -120,3 +122,5 @@ config CRYPTO_LIB_SHA256

config CRYPTO_LIB_SM4
tristate
+
+endmenu
--
2.34.1