diff mbox series

crypto: allow tests to be disabled when manager is disabled

Message ID 20200117110136.305162-1-Jason@zx2c4.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: allow tests to be disabled when manager is disabled | expand

Commit Message

Jason A. Donenfeld Jan. 17, 2020, 11:01 a.m. UTC
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.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 crypto/Kconfig | 4 ----
 1 file changed, 4 deletions(-)

Comments

Herbert Xu Jan. 22, 2020, 6:48 a.m. UTC | #1
Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> 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.
> 
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

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,
Jason A. Donenfeld Jan. 22, 2020, 10:18 a.m. UTC | #2
On Wed, Jan 22, 2020 at 7:48 AM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> > 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.
> >
> > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
>
> 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.
Jason A. Donenfeld Feb. 4, 2020, 8:18 a.m. UTC | #3
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

On Wed, Jan 22, 2020 at 11:18 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> On Wed, Jan 22, 2020 at 7:48 AM Herbert Xu <herbert@gondor.apana.org.au> wrote:
> >
> > Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> > > 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.
> > >
> > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> >
> > 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.
Herbert Xu Feb. 4, 2020, 8:28 a.m. UTC | #4
On Tue, Feb 04, 2020 at 09:18:43AM +0100, Jason A. Donenfeld wrote:
> 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,
diff mbox series

Patch

diff --git a/crypto/Kconfig b/crypto/Kconfig
index 5575d48473bd..a335126fa301 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -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