public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG
@ 2016-01-25 16:50 Arnd Bergmann
  2016-01-26 10:30 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-01-25 16:50 UTC (permalink / raw)
  To: linux-arm-kernel

When building the jitterentropy driver by itself, we get a link error
when CRYPTO_RNG is not enabled as well:

crypto/built-in.o: In function `jent_mod_init':
jitterentropy-kcapi.c:(.init.text+0x98): undefined reference to `crypto_register_rng'
crypto/built-in.o: In function `jent_mod_exit':
jitterentropy-kcapi.c:(.exit.text+0x60): undefined reference to `crypto_unregister_rng'

This moves the 'select CRYPTO_RNG' from CRYPTO_DRBG to CRYPTO_JITTERENTROPY
to ensure the API is always there when it's used, not just when DRBG is
also enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/Kconfig b/crypto/Kconfig
index 7240821137fd..99109b93604a 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1586,13 +1586,13 @@ config CRYPTO_DRBG_CTR
 config CRYPTO_DRBG
 	tristate
 	default CRYPTO_DRBG_MENU
-	select CRYPTO_RNG
 	select CRYPTO_JITTERENTROPY
 
 endif	# if CRYPTO_DRBG_MENU
 
 config CRYPTO_JITTERENTROPY
 	tristate "Jitterentropy Non-Deterministic Random Number Generator"
+	select CRYPTO_RNG
 	help
 	  The Jitterentropy RNG is a noise that is intended
 	  to provide seed to another RNG. The RNG does not
-- 
2.7.0

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

* [PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG
  2016-01-25 16:50 [PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG Arnd Bergmann
@ 2016-01-26 10:30 ` Herbert Xu
  2016-01-26 11:49   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2016-01-26 10:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 25, 2016 at 05:50:34PM +0100, Arnd Bergmann wrote:
> When building the jitterentropy driver by itself, we get a link error
> when CRYPTO_RNG is not enabled as well:
> 
> crypto/built-in.o: In function `jent_mod_init':
> jitterentropy-kcapi.c:(.init.text+0x98): undefined reference to `crypto_register_rng'
> crypto/built-in.o: In function `jent_mod_exit':
> jitterentropy-kcapi.c:(.exit.text+0x60): undefined reference to `crypto_unregister_rng'
> 
> This moves the 'select CRYPTO_RNG' from CRYPTO_DRBG to CRYPTO_JITTERENTROPY
> to ensure the API is always there when it's used, not just when DRBG is
> also enabled.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  crypto/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index 7240821137fd..99109b93604a 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -1586,13 +1586,13 @@ config CRYPTO_DRBG_CTR
>  config CRYPTO_DRBG
>  	tristate
>  	default CRYPTO_DRBG_MENU
> -	select CRYPTO_RNG

I think we should leave this there as DRBG itself is an RNG and
it just uses JITTERENTROPY which happens to be an RNG.

Otherwise this looks OK to me.

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] 3+ messages in thread

* [PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG
  2016-01-26 10:30 ` Herbert Xu
@ 2016-01-26 11:49   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-01-26 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 26 January 2016 18:30:18 Herbert Xu wrote:
> On Mon, Jan 25, 2016 at 05:50:34PM +0100, Arnd Bergmann wrote:
> > When building the jitterentropy driver by itself, we get a link error
> > when CRYPTO_RNG is not enabled as well:
> > 
> > crypto/built-in.o: In function `jent_mod_init':
> > jitterentropy-kcapi.c:(.init.text+0x98): undefined reference to `crypto_register_rng'
> > crypto/built-in.o: In function `jent_mod_exit':
> > jitterentropy-kcapi.c:(.exit.text+0x60): undefined reference to `crypto_unregister_rng'
> > 
> > This moves the 'select CRYPTO_RNG' from CRYPTO_DRBG to CRYPTO_JITTERENTROPY
> > to ensure the API is always there when it's used, not just when DRBG is
> > also enabled.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  crypto/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/crypto/Kconfig b/crypto/Kconfig
> > index 7240821137fd..99109b93604a 100644
> > --- a/crypto/Kconfig
> > +++ b/crypto/Kconfig
> > @@ -1586,13 +1586,13 @@ config CRYPTO_DRBG_CTR
> >  config CRYPTO_DRBG
> >       tristate
> >       default CRYPTO_DRBG_MENU
> > -     select CRYPTO_RNG
> 
> I think we should leave this there as DRBG itself is an RNG and
> it just uses JITTERENTROPY which happens to be an RNG.

Good idea. Should I resend a modified version or do you want to just
adapt it yourself?

	Arnd

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

end of thread, other threads:[~2016-01-26 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 16:50 [PATCH 1/2] crypto: jitterentropy - always select CRYPTO_RNG Arnd Bergmann
2016-01-26 10:30 ` Herbert Xu
2016-01-26 11:49   ` Arnd Bergmann

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