diff options
-rw-r--r-- | crypto/api.c | 10 | ||||
-rw-r--r-- | crypto/internal.h | 10 |
2 files changed, 9 insertions, 11 deletions
diff --git a/crypto/api.c b/crypto/api.c index f55856b21992..0b583d24f7fa 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/crypto.h> | 17 | #include <linux/crypto.h> |
18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
19 | #include <linux/kmod.h> | ||
19 | #include <linux/rwsem.h> | 20 | #include <linux/rwsem.h> |
20 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
21 | #include "internal.h" | 22 | #include "internal.h" |
@@ -33,7 +34,7 @@ static inline void crypto_alg_put(struct crypto_alg *alg) | |||
33 | module_put(alg->cra_module); | 34 | module_put(alg->cra_module); |
34 | } | 35 | } |
35 | 36 | ||
36 | struct crypto_alg *crypto_alg_lookup(const char *name) | 37 | static struct crypto_alg *crypto_alg_lookup(const char *name) |
37 | { | 38 | { |
38 | struct crypto_alg *q, *alg = NULL; | 39 | struct crypto_alg *q, *alg = NULL; |
39 | 40 | ||
@@ -54,6 +55,13 @@ struct crypto_alg *crypto_alg_lookup(const char *name) | |||
54 | return alg; | 55 | return alg; |
55 | } | 56 | } |
56 | 57 | ||
58 | /* A far more intelligent version of this is planned. For now, just | ||
59 | * try an exact match on the name of the algorithm. */ | ||
60 | static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name) | ||
61 | { | ||
62 | return try_then_request_module(crypto_alg_lookup(name), name); | ||
63 | } | ||
64 | |||
57 | static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags) | 65 | static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags) |
58 | { | 66 | { |
59 | tfm->crt_flags = 0; | 67 | tfm->crt_flags = 0; |
diff --git a/crypto/internal.h b/crypto/internal.h index 5ed383f7dce6..83b1b6d6d92b 100644 --- a/crypto/internal.h +++ b/crypto/internal.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/highmem.h> | 16 | #include <linux/highmem.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/kmod.h> | ||
20 | #include <asm/kmap_types.h> | 19 | #include <asm/kmap_types.h> |
21 | 20 | ||
22 | extern enum km_type crypto_km_types[]; | 21 | extern enum km_type crypto_km_types[]; |
@@ -42,15 +41,6 @@ static inline void crypto_yield(struct crypto_tfm *tfm) | |||
42 | cond_resched(); | 41 | cond_resched(); |
43 | } | 42 | } |
44 | 43 | ||
45 | struct crypto_alg *crypto_alg_lookup(const char *name); | ||
46 | |||
47 | /* A far more intelligent version of this is planned. For now, just | ||
48 | * try an exact match on the name of the algorithm. */ | ||
49 | static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name) | ||
50 | { | ||
51 | return try_then_request_module(crypto_alg_lookup(name), name); | ||
52 | } | ||
53 | |||
54 | #ifdef CONFIG_CRYPTO_HMAC | 44 | #ifdef CONFIG_CRYPTO_HMAC |
55 | int crypto_alloc_hmac_block(struct crypto_tfm *tfm); | 45 | int crypto_alloc_hmac_block(struct crypto_tfm *tfm); |
56 | void crypto_free_hmac_block(struct crypto_tfm *tfm); | 46 | void crypto_free_hmac_block(struct crypto_tfm *tfm); |