[CRYPTO] api: Added asynchronous flag
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 6 Aug 2006 13:12:59 +0000 (23:12 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 21 Sep 2006 01:41:49 +0000 (11:41 +1000)
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>
crypto/api.c
include/linux/crypto.h

index 7e5522cf856e047ca277a9b1547531ef073e6134..1e4692a1347441e6df76e6443c8ac31ea11640a1 100644 (file)
@@ -355,7 +355,7 @@ struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
        do {
                struct crypto_alg *alg;
 
-               alg = crypto_alg_mod_lookup(name, 0, 0);
+               alg = crypto_alg_mod_lookup(name, 0, CRYPTO_ALG_ASYNC);
                err = PTR_ERR(alg);
                if (IS_ERR(alg))
                        continue;
@@ -394,7 +394,8 @@ void crypto_free_tfm(struct crypto_tfm *tfm)
 int crypto_alg_available(const char *name, u32 flags)
 {
        int ret = 0;
-       struct crypto_alg *alg = crypto_alg_mod_lookup(name, 0, 0);
+       struct crypto_alg *alg = crypto_alg_mod_lookup(name, 0,
+                                                      CRYPTO_ALG_ASYNC);
        
        if (!IS_ERR(alg)) {
                crypto_mod_put(alg);
index dbdfc7c79367365ee6ac9a8cd01aaf8bf6281f58..530dc4bf363cc033990c00fb3775465a4fb47bd9 100644 (file)
@@ -37,6 +37,7 @@
 #define CRYPTO_ALG_LARVAL              0x00000010
 #define CRYPTO_ALG_DEAD                        0x00000020
 #define CRYPTO_ALG_DYING               0x00000040
+#define CRYPTO_ALG_ASYNC               0x00000080
 
 /*
  * Transform masks and values (for crt_flags).