浏览代码

crypto: Add a flag to identify crypto instances

The upcomming crypto user configuration api needs to identify
crypto instances. This patch adds a flag that is set if the
algorithm is an instance that is build from templates.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Steffen Klassert 13 年之前
父节点
当前提交
64a947b133
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 1 0
      crypto/algapi.c
  2. 5 0
      include/linux/crypto.h

+ 1 - 0
crypto/algapi.c

@@ -493,6 +493,7 @@ int crypto_register_instance(struct crypto_template *tmpl,
 		goto err;
 
 	inst->alg.cra_module = tmpl->module;
+	inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE;
 
 	down_write(&crypto_alg_sem);
 

+ 5 - 0
include/linux/crypto.h

@@ -71,6 +71,11 @@
 
 #define CRYPTO_ALG_TESTED		0x00000400
 
+/*
+ * Set if the algorithm is an instance that is build from templates.
+ */
+#define CRYPTO_ALG_INSTANCE		0x00000800
+
 /*
  * Transform masks and values (for crt_flags).
  */