diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/authenc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c index 2bb7348d8d55..05eb32e0d949 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -46,6 +46,12 @@ struct authenc_request_ctx { | |||
46 | char tail[]; | 46 | char tail[]; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static void authenc_request_complete(struct aead_request *req, int err) | ||
50 | { | ||
51 | if (err != -EINPROGRESS) | ||
52 | aead_request_complete(req, err); | ||
53 | } | ||
54 | |||
49 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, | 55 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, |
50 | unsigned int keylen) | 56 | unsigned int keylen) |
51 | { | 57 | { |
@@ -142,7 +148,7 @@ static void authenc_geniv_ahash_update_done(struct crypto_async_request *areq, | |||
142 | crypto_aead_authsize(authenc), 1); | 148 | crypto_aead_authsize(authenc), 1); |
143 | 149 | ||
144 | out: | 150 | out: |
145 | aead_request_complete(req, err); | 151 | authenc_request_complete(req, err); |
146 | } | 152 | } |
147 | 153 | ||
148 | static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) | 154 | static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) |
@@ -208,7 +214,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq, | |||
208 | err = crypto_ablkcipher_decrypt(abreq); | 214 | err = crypto_ablkcipher_decrypt(abreq); |
209 | 215 | ||
210 | out: | 216 | out: |
211 | aead_request_complete(req, err); | 217 | authenc_request_complete(req, err); |
212 | } | 218 | } |
213 | 219 | ||
214 | static void authenc_verify_ahash_done(struct crypto_async_request *areq, | 220 | static void authenc_verify_ahash_done(struct crypto_async_request *areq, |
@@ -245,7 +251,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq, | |||
245 | err = crypto_ablkcipher_decrypt(abreq); | 251 | err = crypto_ablkcipher_decrypt(abreq); |
246 | 252 | ||
247 | out: | 253 | out: |
248 | aead_request_complete(req, err); | 254 | authenc_request_complete(req, err); |
249 | } | 255 | } |
250 | 256 | ||
251 | static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags) | 257 | static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags) |
@@ -379,7 +385,7 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req, | |||
379 | err = crypto_authenc_genicv(areq, iv, 0); | 385 | err = crypto_authenc_genicv(areq, iv, 0); |
380 | } | 386 | } |
381 | 387 | ||
382 | aead_request_complete(areq, err); | 388 | authenc_request_complete(areq, err); |
383 | } | 389 | } |
384 | 390 | ||
385 | static int crypto_authenc_encrypt(struct aead_request *req) | 391 | static int crypto_authenc_encrypt(struct aead_request *req) |
@@ -420,7 +426,7 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req, | |||
420 | err = crypto_authenc_genicv(areq, greq->giv, 0); | 426 | err = crypto_authenc_genicv(areq, greq->giv, 0); |
421 | } | 427 | } |
422 | 428 | ||
423 | aead_request_complete(areq, err); | 429 | authenc_request_complete(areq, err); |
424 | } | 430 | } |
425 | 431 | ||
426 | static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req) | 432 | static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req) |