summaryrefslogtreecommitdiff
path: root/crypto/cryptomgr.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-09-21 11:35:17 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-21 11:35:17 +1000
commit94f5ac23199d14d3b2cf56c1a0bd2891f1ac5f2d (patch)
tree8028f552e45a3f519f5e022a86c43d7d27a02a8d /crypto/cryptomgr.c
parent0d0f3a296d9eb5ed0c5276573880aab3cb4c3f64 (diff)
downloadlinux-crypto-94f5ac23199d14d3b2cf56c1a0bd2891f1ac5f2d.tar.gz
linux-crypto-94f5ac23199d14d3b2cf56c1a0bd2891f1ac5f2d.zip
[CRYPTO] api: Allow algorithm lookup by type
This patch also adds the infrastructure to pick an algorithm based on their type. For example, this allows you to select the encryption algorithm "aes", instead of any algorithm registered under the name "aes". For now this is only accessible internally. Eventually it will be made available through crypto_alloc_tfm. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/cryptomgr.c')
-rw-r--r--crypto/cryptomgr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/cryptomgr.c b/crypto/cryptomgr.c
index e0ebe1b4..ae54942e 100644
--- a/crypto/cryptomgr.c
+++ b/crypto/cryptomgr.c
@@ -31,6 +31,8 @@ struct cryptomgr_param {
} alg;
struct {
+ u32 type;
+ u32 mask;
char name[CRYPTO_MAX_ALG_NAME];
} larval;
@@ -62,7 +64,8 @@ out:
return;
err:
- crypto_larval_error(param->larval.name);
+ crypto_larval_error(param->larval.name, param->larval.type,
+ param->larval.mask);
goto out;
}
@@ -101,6 +104,8 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
param->alg.data.name[len] = 0;
memcpy(param->larval.name, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME);
+ param->larval.type = larval->alg.cra_flags;
+ param->larval.mask = larval->mask;
INIT_WORK(&param->work, cryptomgr_probe, param);
schedule_work(&param->work);