Subject: [PATCH] [crypto] Make crypto core API modular

This patch makes the whole crypto API is modular.

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

--- linux-2.6.orig/crypto/Kconfig 2007-12-01 13:02:48.000000000 +0100
+++ linux-2.6/crypto/Kconfig 2007-12-01 13:02:55.000000000 +0100
@@ -13,7 +13,7 @@
# Cryptographic API Configuration
#
menuconfig CRYPTO
- bool "Cryptographic API"
+ tristate "Cryptographic API"
help
This option provides the core Cryptographic API.

--- linux-2.6.orig/crypto/Makefile 2007-12-01 13:02:48.000000000 +0100
+++ linux-2.6/crypto/Makefile 2007-12-01 13:02:55.000000000 +0100
@@ -2,7 +2,8 @@
# Cryptographic API
#

-obj-$(CONFIG_CRYPTO) += api.o cipher.o digest.o compress.o
+obj-$(CONFIG_CRYPTO) += crypto_core.o
+crypto_core-y := 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)
--- linux-2.6.orig/include/linux/crypto.h 2007-12-01 13:02:48.000000000 +0100
+++ linux-2.6/include/linux/crypto.h 2007-12-01 13:02:55.000000000 +0100
@@ -299,7 +299,7 @@
/*
* Algorithm query interface.
*/
-#ifdef CONFIG_CRYPTO
+#if defined(CONFIG_CRYPTO) || defined(CONFIG_CRYPTO_MODULE)
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)


Subject: Re: [PATCH] [crypto] Make crypto core API modular

* Sebastian Siewior | 2007-12-01 13:19:10 [+0100]:

>This patch makes the whole crypto API is modular.
Ups, I forgot to put a MODULE_VERSION("GPL") inside of the module.
Herbert, do you nack that patch due to non-sense or do you think that
this might be usefull and I should send an updated one?

Sebastian

2007-12-04 01:10:38

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] [crypto] Make crypto core API modular

On Sun, Dec 02, 2007 at 04:09:50PM +0100, Sebastian Siewior wrote:
> * Sebastian Siewior | 2007-12-01 13:19:10 [+0100]:
>
> >This patch makes the whole crypto API is modular.
> Ups, I forgot to put a MODULE_VERSION("GPL") inside of the module.
> Herbert, do you nack that patch due to non-sense or do you think that
> this might be usefull and I should send an updated one?

Yes I like the idea.

However, could you please fix all the crypto users to select CRYPTO
first? We can then do the modularisation for the next release.

I think we should also get rid of the ifdef CONFIG_CRYPTO because it
has no legitimate uses.

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: [PATCH] [crypto] Make crypto core API modular

* Herbert Xu | 2007-12-04 12:10:35 [+1100]:

>However, could you please fix all the crypto users to select CRYPTO
>first? We can then do the modularisation for the next release.
I mailed two patches to netdev where modules where using crypto code and
were not selecting crypto in Kconfig. This is _now_ broken even before
this patch. Others seemed to be fine on the first look.

>I think we should also get rid of the ifdef CONFIG_CRYPTO because it
>has no legitimate uses.
Okey, I try to get rid of this and I will check the crypto users.

>Thanks,
Sebastian