Merge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc
[deliverable/linux.git] / crypto / crypto_user.c
index 52459ae711a9b988f8b87e0ab240876166711bae..2abca780312d74246c60d7fcc9f6e9bf71f421c0 100644 (file)
@@ -40,7 +40,6 @@ struct crypto_dump_info {
 
 static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
 {
-       int match;
        struct crypto_alg *q, *alg = NULL;
 
        down_read(&crypto_alg_sem);
@@ -49,6 +48,7 @@ static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
                return NULL;
 
        list_for_each_entry(q, &crypto_alg_list, cra_list) {
+               int match = 0;
 
                if ((q->cra_flags ^ p->cru_type) & p->cru_mask)
                        continue;
@@ -89,6 +89,21 @@ nla_put_failure:
        return -EMSGSIZE;
 }
 
+static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg)
+{
+       struct crypto_report_comp rcomp;
+
+       snprintf(rcomp.type, CRYPTO_MAX_ALG_NAME, "%s", "compression");
+
+       NLA_PUT(skb, CRYPTOCFGA_REPORT_COMPRESS,
+               sizeof(struct crypto_report_comp), &rcomp);
+
+       return 0;
+
+nla_put_failure:
+       return -EMSGSIZE;
+}
+
 static int crypto_report_one(struct crypto_alg *alg,
                             struct crypto_user_alg *ualg, struct sk_buff *skb)
 {
@@ -126,6 +141,11 @@ static int crypto_report_one(struct crypto_alg *alg,
                if (crypto_report_cipher(skb, alg))
                        goto nla_put_failure;
 
+               break;
+       case CRYPTO_ALG_TYPE_COMPRESS:
+               if (crypto_report_comp(skb, alg))
+                       goto nla_put_failure;
+
                break;
        }
 
This page took 0.024004 seconds and 5 git commands to generate.