diff options
author | Rich Felker <dalias@libc.org> | 2016-03-29 21:53:03 +0000 |
---|---|---|
committer | Rich Felker <dalias@libc.org> | 2016-03-29 21:53:03 +0000 |
commit | ed8b19a674c67e1007990991d4e02c02da07c952 (patch) | |
tree | 230d118992bfd9ac76f80822d34c2f4ea9819a44 /crypto/xts.c | |
parent | 5da64d0814134dc3542fb314a66dcdf74e8553bd (diff) | |
parent | f349a25c7c6b753176540d10e6c243047faefa3a (diff) | |
download | linux-crypto-ed8b19a674c67e1007990991d4e02c02da07c952.tar.gz linux-crypto-ed8b19a674c67e1007990991d4e02c02da07c952.zip |
Merge tag 'v4.6-rc1'
Linux 4.6-rc1
Diffstat (limited to 'crypto/xts.c')
-rw-r--r-- | crypto/xts.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/xts.c b/crypto/xts.c index f6fd43f1..26ba5833 100644 --- a/crypto/xts.c +++ b/crypto/xts.c @@ -35,16 +35,11 @@ static int setkey(struct crypto_tfm *parent, const u8 *key, { struct priv *ctx = crypto_tfm_ctx(parent); struct crypto_cipher *child = ctx->tweak; - u32 *flags = &parent->crt_flags; int err; - /* key consists of keys of equal size concatenated, therefore - * the length must be even */ - if (keylen % 2) { - /* tell the user why there was an error */ - *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; - return -EINVAL; - } + err = xts_check_key(parent, key, keylen); + if (err) + return err; /* we need two cipher instances: one to compute the initial 'tweak' * by encrypting the IV (usually the 'plain' iv) and the other |