Commit b828f905 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: artpec6 - return correct error code for failed setkey()

->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1.

Fixes: a21eb94f ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver")
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Acked-by: default avatarLars Persson <lars.persson@axis.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent bd56cea0
...@@ -1251,7 +1251,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key, ...@@ -1251,7 +1251,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key,
if (len != 16 && len != 24 && len != 32) { if (len != 16 && len != 24 && len != 32) {
crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -1; return -EINVAL;
} }
ctx->key_length = len; ctx->key_length = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment