summaryrefslogtreecommitdiff
path: root/crypto/xts.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2017-03-07 00:22:51 -0700
committerJonathan Corbet <corbet@lwn.net>2017-03-07 00:22:51 -0700
commit07d045372921bfaa843ea00749c150b099ca0a49 (patch)
treef849e8432047d3e0fc04590ddfb6a76ba953f9b6 /crypto/xts.c
parent1bd9a34ffdd5f22ef74ed68b5d8b6fb4b781d58c (diff)
parent4c6427919ee920d5963cf826de76292286342aa0 (diff)
downloadlinux-crypto-07d045372921bfaa843ea00749c150b099ca0a49.tar.gz
linux-crypto-07d045372921bfaa843ea00749c150b099ca0a49.zip
Merge tag 'v4.11-rc1' into docs-next
Linux 4.11-rc1
Diffstat (limited to 'crypto/xts.c')
-rw-r--r--crypto/xts.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/xts.c b/crypto/xts.c
index 410a2e29..baeb34dd 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -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)