aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-12-10 07:29:44 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2008-12-10 07:29:44 -0500
commit6a0fcbb4dad15f02ca8f8ae6324fcd3fc43b9d35 (patch)
tree30bd7a1a6230e414d484bfee891af2bfcad0da93
parent437f2f91d6597c67662f847d9ed4c99cb3c440cd (diff)
crypto: api - Disallow cryptomgr as a module if algorithms are built-in
If we have at least one algorithm built-in then it no longer makes sense to have the testing framework, and hence cryptomgr to be a module. It should be either on or off, i.e., built-in or disabled. This just happens to stop a potential runaway modprobe loop that seems to trigger on at least one distro. With fixes from Evgeniy Polyakov. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/Kconfig36
-rw-r--r--crypto/Makefile18
2 files changed, 41 insertions, 13 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 39dbd8e4dde1..dc20a34ba5ef 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -31,35 +31,63 @@ config CRYPTO_FIPS
31 31
32config CRYPTO_ALGAPI 32config CRYPTO_ALGAPI
33 tristate 33 tristate
34 select CRYPTO_ALGAPI2
34 help 35 help
35 This option provides the API for cryptographic algorithms. 36 This option provides the API for cryptographic algorithms.
36 37
38config CRYPTO_ALGAPI2
39 tristate
40
37config CRYPTO_AEAD 41config CRYPTO_AEAD
38 tristate 42 tristate
43 select CRYPTO_AEAD2
39 select CRYPTO_ALGAPI 44 select CRYPTO_ALGAPI
40 45
46config CRYPTO_AEAD2
47 tristate
48 select CRYPTO_ALGAPI2
49
41config CRYPTO_BLKCIPHER 50config CRYPTO_BLKCIPHER
42 tristate 51 tristate
52 select CRYPTO_BLKCIPHER2
43 select CRYPTO_ALGAPI 53 select CRYPTO_ALGAPI
44 select CRYPTO_RNG 54
55config CRYPTO_BLKCIPHER2
56 tristate
57 select CRYPTO_ALGAPI2
58 select CRYPTO_RNG2
45 59
46config CRYPTO_HASH 60config CRYPTO_HASH
47 tristate 61 tristate
62 select CRYPTO_HASH2
48 select CRYPTO_ALGAPI 63 select CRYPTO_ALGAPI
49 64
65config CRYPTO_HASH2
66 tristate
67 select CRYPTO_ALGAPI2
68
50config CRYPTO_RNG 69config CRYPTO_RNG
51 tristate 70 tristate
71 select CRYPTO_RNG2
52 select CRYPTO_ALGAPI 72 select CRYPTO_ALGAPI
53 73
74config CRYPTO_RNG2
75 tristate
76 select CRYPTO_ALGAPI2
77
54config CRYPTO_MANAGER 78config CRYPTO_MANAGER
55 tristate "Cryptographic algorithm manager" 79 tristate "Cryptographic algorithm manager"
56 select CRYPTO_AEAD 80 select CRYPTO_MANAGER2
57 select CRYPTO_HASH
58 select CRYPTO_BLKCIPHER
59 help 81 help
60 Create default cryptographic template instantiations such as 82 Create default cryptographic template instantiations such as
61 cbc(aes). 83 cbc(aes).
62 84
85config CRYPTO_MANAGER2
86 def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
87 select CRYPTO_AEAD2
88 select CRYPTO_HASH2
89 select CRYPTO_BLKCIPHER2
90
63config CRYPTO_GF128MUL 91config CRYPTO_GF128MUL
64 tristate "GF(2^128) multiplication functions (EXPERIMENTAL)" 92 tristate "GF(2^128) multiplication functions (EXPERIMENTAL)"
65 depends on EXPERIMENTAL 93 depends on EXPERIMENTAL
diff --git a/crypto/Makefile b/crypto/Makefile
index 5862b807334e..cd4a4ed078ff 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -9,24 +9,24 @@ obj-$(CONFIG_CRYPTO_FIPS) += fips.o
9 9
10crypto_algapi-$(CONFIG_PROC_FS) += proc.o 10crypto_algapi-$(CONFIG_PROC_FS) += proc.o
11crypto_algapi-objs := algapi.o scatterwalk.o $(crypto_algapi-y) 11crypto_algapi-objs := algapi.o scatterwalk.o $(crypto_algapi-y)
12obj-$(CONFIG_CRYPTO_ALGAPI) += crypto_algapi.o 12obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o
13 13
14obj-$(CONFIG_CRYPTO_AEAD) += aead.o 14obj-$(CONFIG_CRYPTO_AEAD2) += aead.o
15 15
16crypto_blkcipher-objs := ablkcipher.o 16crypto_blkcipher-objs := ablkcipher.o
17crypto_blkcipher-objs += blkcipher.o 17crypto_blkcipher-objs += blkcipher.o
18obj-$(CONFIG_CRYPTO_BLKCIPHER) += crypto_blkcipher.o 18obj-$(CONFIG_CRYPTO_BLKCIPHER2) += crypto_blkcipher.o
19obj-$(CONFIG_CRYPTO_BLKCIPHER) += chainiv.o 19obj-$(CONFIG_CRYPTO_BLKCIPHER2) += chainiv.o
20obj-$(CONFIG_CRYPTO_BLKCIPHER) += eseqiv.o 20obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o
21obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o 21obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
22 22
23crypto_hash-objs := hash.o 23crypto_hash-objs := hash.o
24crypto_hash-objs += ahash.o 24crypto_hash-objs += ahash.o
25obj-$(CONFIG_CRYPTO_HASH) += crypto_hash.o 25obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
26 26
27cryptomgr-objs := algboss.o testmgr.o 27cryptomgr-objs := algboss.o testmgr.o
28 28
29obj-$(CONFIG_CRYPTO_MANAGER) += cryptomgr.o 29obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
30obj-$(CONFIG_CRYPTO_HMAC) += hmac.o 30obj-$(CONFIG_CRYPTO_HMAC) += hmac.o
31obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o 31obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
32obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o 32obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
@@ -73,8 +73,8 @@ obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
73obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o 73obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
74obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o 74obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o
75obj-$(CONFIG_CRYPTO_LZO) += lzo.o 75obj-$(CONFIG_CRYPTO_LZO) += lzo.o
76obj-$(CONFIG_CRYPTO_RNG) += rng.o 76obj-$(CONFIG_CRYPTO_RNG2) += rng.o
77obj-$(CONFIG_CRYPTO_RNG) += krng.o 77obj-$(CONFIG_CRYPTO_RNG2) += krng.o
78obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o 78obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
79obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o 79obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
80 80