summaryrefslogtreecommitdiffstats
path: root/crypto/algif_skcipher.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-10-18 03:00:39 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2017-11-03 10:11:18 -0400
commit2c3f8b162106a7d12097d02eb22459f57fab8247 (patch)
treeb36a46ee96b9f7060317e869060ac0dafd792f7e /crypto/algif_skcipher.c
parentada69a1639eca54ff74d839a6513c43db8d57d70 (diff)
crypto: algif - move to generic async completion
algif starts several async crypto ops and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algif_skcipher.c')
-rw-r--r--crypto/algif_skcipher.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 8ae4170aaeb4..9954b078f0b9 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -129,12 +129,11 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
129 skcipher_request_set_callback(&areq->cra_u.skcipher_req, 129 skcipher_request_set_callback(&areq->cra_u.skcipher_req,
130 CRYPTO_TFM_REQ_MAY_SLEEP | 130 CRYPTO_TFM_REQ_MAY_SLEEP |
131 CRYPTO_TFM_REQ_MAY_BACKLOG, 131 CRYPTO_TFM_REQ_MAY_BACKLOG,
132 af_alg_complete, 132 crypto_req_done, &ctx->wait);
133 &ctx->completion); 133 err = crypto_wait_req(ctx->enc ?
134 err = af_alg_wait_for_completion(ctx->enc ?
135 crypto_skcipher_encrypt(&areq->cra_u.skcipher_req) : 134 crypto_skcipher_encrypt(&areq->cra_u.skcipher_req) :
136 crypto_skcipher_decrypt(&areq->cra_u.skcipher_req), 135 crypto_skcipher_decrypt(&areq->cra_u.skcipher_req),
137 &ctx->completion); 136 &ctx->wait);
138 } 137 }
139 138
140 /* AIO operation in progress */ 139 /* AIO operation in progress */
@@ -388,7 +387,7 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
388 ctx->more = 0; 387 ctx->more = 0;
389 ctx->merge = 0; 388 ctx->merge = 0;
390 ctx->enc = 0; 389 ctx->enc = 0;
391 af_alg_init_completion(&ctx->completion); 390 crypto_init_wait(&ctx->wait);
392 391
393 ask->private = ctx; 392 ask->private = ctx;
394 393