X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=crypto%2Fxts.c;h=26ba5833b9944039ad1b172534e5afb09a7902eb;hb=56025caa821d8e398b7cff2c45fb1e3e769549d7;hp=f6fd43f100c8c68c7150cad5224fafc5dc61db2c;hpb=8328509c4bdf28b83fd7104ca9da01bf3b58c7b0;p=karo-tx-linux.git diff --git a/crypto/xts.c b/crypto/xts.c index f6fd43f100c8..26ba5833b994 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