]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - crypto/xts.c
netfilter: provide nft_ctx in object init function
[mirror_ubuntu-artful-kernel.git] / crypto / xts.c
index 410a2e299085f162b6c1af1b048edd7d3ba53d6c..baeb34dd8582ebd11473ebb8e2ed5eadd7d2f71b 100644 (file)
@@ -463,6 +463,7 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
        struct xts_instance_ctx *ctx;
        struct skcipher_alg *alg;
        const char *cipher_name;
+       u32 mask;
        int err;
 
        algt = crypto_get_attr_type(tb);
@@ -483,18 +484,19 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
        ctx = skcipher_instance_ctx(inst);
 
        crypto_set_skcipher_spawn(&ctx->spawn, skcipher_crypto_instance(inst));
-       err = crypto_grab_skcipher(&ctx->spawn, cipher_name, 0,
-                                  crypto_requires_sync(algt->type,
-                                                       algt->mask));
+
+       mask = crypto_requires_off(algt->type, algt->mask,
+                                  CRYPTO_ALG_NEED_FALLBACK |
+                                  CRYPTO_ALG_ASYNC);
+
+       err = crypto_grab_skcipher(&ctx->spawn, cipher_name, 0, mask);
        if (err == -ENOENT) {
                err = -ENAMETOOLONG;
                if (snprintf(ctx->name, CRYPTO_MAX_ALG_NAME, "ecb(%s)",
                             cipher_name) >= CRYPTO_MAX_ALG_NAME)
                        goto err_free_inst;
 
-               err = crypto_grab_skcipher(&ctx->spawn, ctx->name, 0,
-                                          crypto_requires_sync(algt->type,
-                                                               algt->mask));
+               err = crypto_grab_skcipher(&ctx->spawn, ctx->name, 0, mask);
        }
 
        if (err)