Skip to contentSkip to conversation

crypto: ecc: fix CRYPTO_DEFAULT_RNG dependency

PATCH In review Arnd Bergmann 3 participants 3 messages Sep 20, 2021 – Oct 1, 2021 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: ecc: fix CRYPTO_DEFAULT_RNG dependency

From: Arnd Bergmann <[email protected]>

The ecc.c file started out as part of the ECDH algorithm but got moved out into a standalone module later. It does not build without CRYPTO_DEFAULT_RNG, so now that other modules are using it as well we can run into this link error:

aarch64-linux-ld: ecc.c:(.text+0xfc8): undefined reference to `crypto_default_rng'
aarch64-linux-ld: ecc.c:(.text+0xff4): undefined reference to `crypto_put_default_rng'

Move the 'select CRYPTO_DEFAULT_RNG' statement into the correct symbol.

Fixes 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm")
Fixes 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature verification")
---
 crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +1 -1
index 536df4b6b825..285f82647d2b 100644
@@ -233,12 +233,12 @@ config CRYPTO_DH
 
 config CRYPTO_ECC
 	tristate
+	select CRYPTO_RNG_DEFAULT
 
 config CRYPTO_ECDH
 	tristate "ECDH algorithm"
 	select CRYPTO_ECC
 	select CRYPTO_KPP
-	select CRYPTO_RNG_DEFAULT
 	help
 	  Generic implementation of the ECDH algorithm
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ecc.c file started out as part of the ECDH algorithm but got moved out into a standalone module later. It does not build without CRYPTO_DEFAULT_RNG, so now that other modules are using it as well we can run into this link error:

Quoted 8 lines

aarch64-linux-ld: ecc.c:(.text+0xfc8): undefined reference to `crypto_default_rng'
aarch64-linux-ld: ecc.c:(.text+0xff4): undefined reference to `crypto_put_default_rng'

Move the 'select CRYPTO_DEFAULT_RNG' statement into the correct symbol.

Fixes 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm")
Fixes 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature verification")
Quoted 22 lines
---
  crypto/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +1 -1
index 536df4b6b825..285f82647d2b 100644
@@ -233,12 +233,12 @@ config CRYPTO_DH
 
  config CRYPTO_ECC
  	tristate
+	select CRYPTO_RNG_DEFAULT
 
  config CRYPTO_ECDH
  	tristate "ECDH algorithm"
  	select CRYPTO_ECC
  	select CRYPTO_KPP
-	select CRYPTO_RNG_DEFAULT
  	help
  	  Generic implementation of the ECDH algorithm
 
maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The ecc.c file started out as part of the ECDH algorithm but got moved out into a standalone module later. It does not build without CRYPTO_DEFAULT_RNG, so now that other modules are using it as well we can run into this link error:

aarch64-linux-ld: ecc.c:(.text+0xfc8): undefined reference to `crypto_default_rng'
aarch64-linux-ld: ecc.c:(.text+0xff4): undefined reference to `crypto_put_default_rng'

Quoted 8 lines

Move the 'select CRYPTO_DEFAULT_RNG' statement into the correct symbol.

Fixes 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm")
Fixes 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature verification")
---
 crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt