Subject: [RFC 2/2] [crypto] make the crypto subsystem fully modular

Signed-off-by: Sebastian Siewior <[email protected]>
---
crypto/Kconfig | 2 +-
crypto/Makefile | 3 ++-
crypto/api.c | 3 +++
include/linux/crypto.h | 7 -------
4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/crypto/Kconfig b/crypto/Kconfig
index c3166a1..8c28a4b 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -13,7 +13,7 @@ source "crypto/async_tx/Kconfig"
# Cryptographic API Configuration
#
menuconfig CRYPTO
- bool "Cryptographic API"
+ tristate "Cryptographic API"
help
This option provides the core Cryptographic API.

diff --git a/crypto/Makefile b/crypto/Makefile
index 48c7583..fd24356 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -2,7 +2,8 @@
# Cryptographic API
#

-obj-$(CONFIG_CRYPTO) += api.o cipher.o digest.o compress.o
+obj-$(CONFIG_CRYPTO) += crypto.o
+crypto-objs := api.o cipher.o digest.o compress.o

crypto_algapi-$(CONFIG_PROC_FS) += proc.o
crypto_algapi-objs := algapi.o scatterwalk.o $(crypto_algapi-y)
diff --git a/crypto/api.c b/crypto/api.c
index a2496d1..0a0f41e 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -445,3 +445,6 @@ int crypto_has_alg(const char *name, u32 type, u32 mask)
return ret;
}
EXPORT_SYMBOL_GPL(crypto_has_alg);
+
+MODULE_DESCRIPTION("Cryptographic core API");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 0aba104..f1fb017 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -319,14 +319,7 @@ int crypto_unregister_alg(struct crypto_alg *alg);
/*
* Algorithm query interface.
*/
-#ifdef CONFIG_CRYPTO
int crypto_has_alg(const char *name, u32 type, u32 mask);
-#else
-static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
-{
- return 0;
-}
-#endif

/*
* Transforms: user-instantiated objects which encapsulate algorithms
--
1.5.3.7


2008-03-24 12:36:03

by Herbert Xu

[permalink] [raw]
Subject: Re: [RFC 2/2] [crypto] make the crypto subsystem fully modular

On Sat, Jan 05, 2008 at 01:36:37PM +0100, Sebastian Siewior wrote:
>
> diff --git a/crypto/api.c b/crypto/api.c
> index a2496d1..0a0f41e 100644
> --- a/crypto/api.c
> +++ b/crypto/api.c
> @@ -445,3 +445,6 @@ int crypto_has_alg(const char *name, u32 type, u32 mask)
> return ret;
> }
> EXPORT_SYMBOL_GPL(crypto_has_alg);
> +
> +MODULE_DESCRIPTION("Cryptographic core API");
> +MODULE_LICENSE("GPL");

Could you please add an exit handler? That way we can unload the
module which is probably the most important application of this.

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Subject: Re: [RFC 2/2] [crypto] make the crypto subsystem fully modular

* Herbert Xu | 2008-03-24 20:35:59 [+0800]:

>On Sat, Jan 05, 2008 at 01:36:37PM +0100, Sebastian Siewior wrote:
>>
>> diff --git a/crypto/api.c b/crypto/api.c
>> index a2496d1..0a0f41e 100644
>> --- a/crypto/api.c
>> +++ b/crypto/api.c
>> @@ -445,3 +445,6 @@ int crypto_has_alg(const char *name, u32 type, u32 mask)
>> return ret;
>> }
>> EXPORT_SYMBOL_GPL(crypto_has_alg);
>> +
>> +MODULE_DESCRIPTION("Cryptographic core API");
>> +MODULE_LICENSE("GPL");
>
>Could you please add an exit handler? That way we can unload the
>module which is probably the most important application of this.
We can do this allready because we don't have an init function.

Sebastian

2008-03-30 08:38:33

by Herbert Xu

[permalink] [raw]
Subject: Re: [RFC 2/2] [crypto] make the crypto subsystem fully modular

On Fri, Mar 28, 2008 at 11:23:54PM +0100, Sebastian Siewior wrote:
>
> We can do this allready because we don't have an init function.

Patch applied. Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt