2
0

260-crypto_test_dependencies.patch 1.6 KB

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