crypto: qat - validate xts key
Validate AES-XTS key using the function xts_verify_key() to prevent malformed keys. Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
528f776df6
commit
b185a68710
|
@ -995,6 +995,12 @@ static int qat_alg_skcipher_ctr_setkey(struct crypto_skcipher *tfm,
|
||||||
static int qat_alg_skcipher_xts_setkey(struct crypto_skcipher *tfm,
|
static int qat_alg_skcipher_xts_setkey(struct crypto_skcipher *tfm,
|
||||||
const u8 *key, unsigned int keylen)
|
const u8 *key, unsigned int keylen)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = xts_verify_key(tfm, key, keylen);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return qat_alg_skcipher_setkey(tfm, key, keylen,
|
return qat_alg_skcipher_setkey(tfm, key, keylen,
|
||||||
ICP_QAT_HW_CIPHER_XTS_MODE);
|
ICP_QAT_HW_CIPHER_XTS_MODE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue