mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
crypto: rsa-pkcs1pad - Use akcipher_request_complete
[ Upstream commit564cabc0ca
] Use the akcipher_request_complete helper instead of calling the completion function directly. In fact the previous code was buggy in that EINPROGRESS was never passed back to the original caller. Fixes:3d5b1ecdea
("crypto: rsa - RSA padding algorithm") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b2fde8cb2a
commit
4dc335fa7c
@ -216,16 +216,14 @@ static void pkcs1pad_encrypt_sign_complete_cb(
|
|||||||
struct crypto_async_request *child_async_req, int err)
|
struct crypto_async_request *child_async_req, int err)
|
||||||
{
|
{
|
||||||
struct akcipher_request *req = child_async_req->data;
|
struct akcipher_request *req = child_async_req->data;
|
||||||
struct crypto_async_request async_req;
|
|
||||||
|
|
||||||
if (err == -EINPROGRESS)
|
if (err == -EINPROGRESS)
|
||||||
return;
|
goto out;
|
||||||
|
|
||||||
async_req.data = req->base.data;
|
err = pkcs1pad_encrypt_sign_complete(req, err);
|
||||||
async_req.tfm = crypto_akcipher_tfm(crypto_akcipher_reqtfm(req));
|
|
||||||
async_req.flags = child_async_req->flags;
|
out:
|
||||||
req->base.complete(&async_req,
|
akcipher_request_complete(req, err);
|
||||||
pkcs1pad_encrypt_sign_complete(req, err));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pkcs1pad_encrypt(struct akcipher_request *req)
|
static int pkcs1pad_encrypt(struct akcipher_request *req)
|
||||||
@ -336,15 +334,14 @@ static void pkcs1pad_decrypt_complete_cb(
|
|||||||
struct crypto_async_request *child_async_req, int err)
|
struct crypto_async_request *child_async_req, int err)
|
||||||
{
|
{
|
||||||
struct akcipher_request *req = child_async_req->data;
|
struct akcipher_request *req = child_async_req->data;
|
||||||
struct crypto_async_request async_req;
|
|
||||||
|
|
||||||
if (err == -EINPROGRESS)
|
if (err == -EINPROGRESS)
|
||||||
return;
|
goto out;
|
||||||
|
|
||||||
async_req.data = req->base.data;
|
err = pkcs1pad_decrypt_complete(req, err);
|
||||||
async_req.tfm = crypto_akcipher_tfm(crypto_akcipher_reqtfm(req));
|
|
||||||
async_req.flags = child_async_req->flags;
|
out:
|
||||||
req->base.complete(&async_req, pkcs1pad_decrypt_complete(req, err));
|
akcipher_request_complete(req, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pkcs1pad_decrypt(struct akcipher_request *req)
|
static int pkcs1pad_decrypt(struct akcipher_request *req)
|
||||||
@ -506,15 +503,14 @@ static void pkcs1pad_verify_complete_cb(
|
|||||||
struct crypto_async_request *child_async_req, int err)
|
struct crypto_async_request *child_async_req, int err)
|
||||||
{
|
{
|
||||||
struct akcipher_request *req = child_async_req->data;
|
struct akcipher_request *req = child_async_req->data;
|
||||||
struct crypto_async_request async_req;
|
|
||||||
|
|
||||||
if (err == -EINPROGRESS)
|
if (err == -EINPROGRESS)
|
||||||
return;
|
goto out;
|
||||||
|
|
||||||
async_req.data = req->base.data;
|
err = pkcs1pad_verify_complete(req, err);
|
||||||
async_req.tfm = crypto_akcipher_tfm(crypto_akcipher_reqtfm(req));
|
|
||||||
async_req.flags = child_async_req->flags;
|
out:
|
||||||
req->base.complete(&async_req, pkcs1pad_verify_complete(req, err));
|
akcipher_request_complete(req, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user