kernel: clean up 260-crypto_test_dependencies.patch to get rid of some more kernel...
[openwrt/openwrt.git] / target / linux / generic / patches-4.4 / 260-crypto_test_dependencies.patch
1 --- a/crypto/Kconfig
2 +++ b/crypto/Kconfig
3 @@ -118,12 +118,12 @@ config CRYPTO_MANAGER
4 cbc(aes).
5
6 config CRYPTO_MANAGER2
7 - def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
8 - select CRYPTO_AEAD2
9 - select CRYPTO_HASH2
10 - select CRYPTO_BLKCIPHER2
11 - select CRYPTO_PCOMP2
12 - select CRYPTO_AKCIPHER2
13 + def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y && !CRYPTO_MANAGER_DISABLE_TESTS)
14 + select CRYPTO_AEAD2 if !CRYPTO_MANAGER_DISABLE_TESTS
15 + select CRYPTO_HASH2 if !CRYPTO_MANAGER_DISABLE_TESTS
16 + select CRYPTO_BLKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS
17 + select CRYPTO_PCOMP2 if !CRYPTO_MANAGER_DISABLE_TESTS
18 + select CRYPTO_AKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS
19
20 config CRYPTO_USER
21 tristate "Userspace cryptographic algorithm configuration"
22 @@ -136,7 +136,6 @@ config CRYPTO_USER
23 config CRYPTO_MANAGER_DISABLE_TESTS
24 bool "Disable run-time self tests"
25 default y
26 - depends on CRYPTO_MANAGER2
27 help
28 Disable run-time self tests that normally take place at
29 algorithm registration.
30 --- a/crypto/algboss.c
31 +++ b/crypto/algboss.c
32 @@ -248,12 +248,16 @@ static int cryptomgr_schedule_test(struc
33 type = alg->cra_flags;
34
35 /* This piece of crap needs to disappear into per-type test hooks. */
36 +#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
37 + type |= CRYPTO_ALG_TESTED;
38 +#else
39 if (!((type ^ CRYPTO_ALG_TYPE_BLKCIPHER) &
40 CRYPTO_ALG_TYPE_BLKCIPHER_MASK) && !(type & CRYPTO_ALG_GENIV) &&
41 ((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
42 CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
43 alg->cra_ablkcipher.ivsize))
44 type |= CRYPTO_ALG_TESTED;
45 +#endif
46
47 param->type = type;
48