Commit 388a9f1d authored by Wei Yongjun's avatar Wei Yongjun Committed by Kleber Sacilotto de Souza

crypto: gcm - Fix error return code in crypto_gcm_create_common()

BugLink: https://bugs.launchpad.net/bugs/1832661

commit 9b40f79c upstream.

Fix to return error code -EINVAL from the invalid alg ivsize error
handling case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 37c34797
...@@ -670,11 +670,11 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl, ...@@ -670,11 +670,11 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl,
ctr = crypto_skcipher_spawn_alg(&ctx->ctr); ctr = crypto_skcipher_spawn_alg(&ctx->ctr);
/* We only support 16-byte blocks. */ /* We only support 16-byte blocks. */
err = -EINVAL;
if (ctr->cra_ablkcipher.ivsize != 16) if (ctr->cra_ablkcipher.ivsize != 16)
goto out_put_ctr; goto out_put_ctr;
/* Not a stream cipher? */ /* Not a stream cipher? */
err = -EINVAL;
if (ctr->cra_blocksize != 1) if (ctr->cra_blocksize != 1)
goto out_put_ctr; goto out_put_ctr;
......
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