2020-02-19 15:52:04

by Corentin LABBE

[permalink] [raw]
Subject: [PATCH 2/2] crypto: drbg: DRBG_CTR should select CTR

if CRYPTO_DRBG_CTR is builtin and CTR is module, allocating such algo
will fail.
DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
alg: drbg: Failed to reset rng
alg: drbg: Test 0 failed for drbg_pr_ctr_aes128
DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
alg: drbg: Failed to reset rng
alg: drbg: Test 0 failed for drbg_nopr_ctr_aes128
DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
alg: drbg: Failed to reset rng
alg: drbg: Test 0 failed for drbg_nopr_ctr_aes192
DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
alg: drbg: Failed to reset rng
ialg: drbg: Test 0 failed for drbg_nopr_ctr_aes256

Since setting DRBG_CTR=CTR lead to a recursive dependency, let's depends
on CTR=y

Signed-off-by: Corentin Labbe <[email protected]>
---
crypto/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/Kconfig b/crypto/Kconfig
index 6d27fc6a7bf5..eddeb43fc01c 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1822,7 +1822,7 @@ config CRYPTO_DRBG_HASH
config CRYPTO_DRBG_CTR
bool "Enable CTR DRBG"
select CRYPTO_AES
- depends on CRYPTO_CTR
+ depends on CRYPTO_CTR=y
help
Enable the CTR DRBG variant as defined in NIST SP800-90A.

--
2.24.1


2020-02-28 00:31:27

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 2/2] crypto: drbg: DRBG_CTR should select CTR

On Wed, Feb 19, 2020 at 03:51:35PM +0000, Corentin Labbe wrote:
> if CRYPTO_DRBG_CTR is builtin and CTR is module, allocating such algo
> will fail.
> DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
> alg: drbg: Failed to reset rng
> alg: drbg: Test 0 failed for drbg_pr_ctr_aes128
> DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
> alg: drbg: Failed to reset rng
> alg: drbg: Test 0 failed for drbg_nopr_ctr_aes128
> DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
> alg: drbg: Failed to reset rng
> alg: drbg: Test 0 failed for drbg_nopr_ctr_aes192
> DRBG: could not allocate CTR cipher TFM handle: ctr(aes)
> alg: drbg: Failed to reset rng
> ialg: drbg: Test 0 failed for drbg_nopr_ctr_aes256
>
> Since setting DRBG_CTR=CTR lead to a recursive dependency, let's depends
> on CTR=y
>
> Signed-off-by: Corentin Labbe <[email protected]>
> ---
> crypto/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index 6d27fc6a7bf5..eddeb43fc01c 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -1822,7 +1822,7 @@ config CRYPTO_DRBG_HASH
> config CRYPTO_DRBG_CTR
> bool "Enable CTR DRBG"
> select CRYPTO_AES
> - depends on CRYPTO_CTR
> + depends on CRYPTO_CTR=y

This should be turned into a select.

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt