aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-08-06 09:12:59 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-20 21:41:49 -0400
commitf3f632d61ae9af85d436706ee8e33af1a7fb9c28 (patch)
tree38c9aa8a1210d88d60a7d961c47e15210d16ca78
parent7fed0bf271b374be4c98a5880faed4b1128e78e9 (diff)
[CRYPTO] api: Added asynchronous flag
This patch adds the asynchronous flag and changes all existing users to only look up algorithms that are synchronous. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/api.c5
-rw-r--r--include/linux/crypto.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 7e5522cf856e..1e4692a13474 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -355,7 +355,7 @@ struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
355 do { 355 do {
356 struct crypto_alg *alg; 356 struct crypto_alg *alg;
357 357
358 alg = crypto_alg_mod_lookup(name, 0, 0); 358 alg = crypto_alg_mod_lookup(name, 0, CRYPTO_ALG_ASYNC);
359 err = PTR_ERR(alg); 359 err = PTR_ERR(alg);
360 if (IS_ERR(alg)) 360 if (IS_ERR(alg))
361 continue; 361 continue;
@@ -394,7 +394,8 @@ void crypto_free_tfm(struct crypto_tfm *tfm)
394int crypto_alg_available(const char *name, u32 flags) 394int crypto_alg_available(const char *name, u32 flags)
395{ 395{
396 int ret = 0; 396 int ret = 0;
397 struct crypto_alg *alg = crypto_alg_mod_lookup(name, 0, 0); 397 struct crypto_alg *alg = crypto_alg_mod_lookup(name, 0,
398 CRYPTO_ALG_ASYNC);
398 399
399 if (!IS_ERR(alg)) { 400 if (!IS_ERR(alg)) {
400 crypto_mod_put(alg); 401 crypto_mod_put(alg);
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index dbdfc7c79367..530dc4bf363c 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -37,6 +37,7 @@
37#define CRYPTO_ALG_LARVAL 0x00000010 37#define CRYPTO_ALG_LARVAL 0x00000010
38#define CRYPTO_ALG_DEAD 0x00000020 38#define CRYPTO_ALG_DEAD 0x00000020
39#define CRYPTO_ALG_DYING 0x00000040 39#define CRYPTO_ALG_DYING 0x00000040
40#define CRYPTO_ALG_ASYNC 0x00000080
40 41
41/* 42/*
42 * Transform masks and values (for crt_flags). 43 * Transform masks and values (for crt_flags).