crypto: Add a flag to identify crypto instances
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 27 Sep 2011 05:21:26 +0000 (07:21 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Oct 2011 12:24:01 +0000 (14:24 +0200)
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>
crypto/algapi.c
include/linux/crypto.h

index c3cf1a69a47a8dcaa57e62410c9823ee4e2d045b..6fd9bcf876ad448d1dd4717593b57e6ab368ff6c 100644 (file)
@@ -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);
 
index e5e468e9133d645411fe18314bb24d81e8701471..de9adec5693c7fd17a9c738439c6d6dda6facf8c 100644 (file)
 
 #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).
  */