Skip to contentSkip to conversation

crypto: allow tests to be disabled when manager is disabled

PATCH In review Jason A. Donenfeld 2 participants 5 messages Jan 17, 2020 – Feb 4, 2020 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: allow tests to be disabled when manager is disabled

The library code uses CRYPTO_MANAGER_DISABLE_TESTS to conditionalize its tests, but the library code can also exist without CRYPTO_MANAGER. That means on minimal configs, the test code winds up being built with no way to disable it.

---
 crypto/Kconfig | 4 ----
 1 file changed, 4 deletions(-)
crypto/Kconfig +0 -4
index 5575d48473bd..a335126fa301 100644
@@ -136,8 +136,6 @@ config CRYPTO_USER
 	  Userspace configuration for cryptographic instantiations such as
 	  cbc(aes).
 
-if CRYPTO_MANAGER2
-
 config CRYPTO_MANAGER_DISABLE_TESTS
 	bool "Disable run-time self tests"
 	default y
@@ -155,8 +153,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS
 	  This is intended for developer use only, as these tests take much
 	  longer to run than the normal self tests.
 
-endif	# if CRYPTO_MANAGER2
-
 config CRYPTO_GF128MUL
 	tristate
 
Signature · 1 line
2.24.1
maintainer
#1 lore raw
Quoted 6 lines · Jason A. Donenfeld

The library code uses CRYPTO_MANAGER_DISABLE_TESTS to conditionalize its tests, but the library code can also exist without CRYPTO_MANAGER. That means on minimal configs, the test code winds up being built with no way to disable it.

I think we still want to keep the extra tests option within the if block unless you have plans on using that option in the lib code as well?

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
#2 lore raw
Quoted 7 lines · Herbert Xu
Quoted 5 lines · Jason A. Donenfeld

The library code uses CRYPTO_MANAGER_DISABLE_TESTS to conditionalize its tests, but the library code can also exist without CRYPTO_MANAGER. That means on minimal configs, the test code winds up being built with no way to disable it.

Quoted 5 lines
Quoted 1 line

I think we still want to keep the extra tests option within the if block unless you have plans on using that option in the lib code as well?

I think this would be useful for the library code as well.

#3 lore raw

Hi Herbert,

Can we get this in as a fix for 5.6 please? This is definitely a small and trivial bug that's easily fixed here.

Jason

Quoted 16 lines · Jason A. Donenfeld
Quoted 7 lines · Herbert Xu
Quoted 5 lines · Jason A. Donenfeld

The library code uses CRYPTO_MANAGER_DISABLE_TESTS to conditionalize its tests, but the library code can also exist without CRYPTO_MANAGER. That means on minimal configs, the test code winds up being built with no way to disable it.

Quoted 5 lines
Quoted 1 line

I think we still want to keep the extra tests option within the if block unless you have plans on using that option in the lib code as well?

I think this would be useful for the library code as well.

maintainer
#4 lore raw
Quoted 4 lines · Jason A. Donenfeld

Hi Herbert,

Can we get this in as a fix for 5.6 please? This is definitely a small and trivial bug that's easily fixed here.

Yes I will take this patch for 5.6.

Cheers,

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