diff options
-rw-r--r-- | crypto/authenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c index 4d6f49a5daeb..18870906ea06 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -194,7 +194,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq, | |||
194 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 194 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
195 | authsize, 0); | 195 | authsize, 0); |
196 | 196 | ||
197 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG: 0; | 197 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
198 | if (err) | 198 | if (err) |
199 | goto out; | 199 | goto out; |
200 | 200 | ||
@@ -231,7 +231,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq, | |||
231 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 231 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
232 | authsize, 0); | 232 | authsize, 0); |
233 | 233 | ||
234 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG: 0; | 234 | err = memcmp(ihash, ahreq->result, authsize) ? -EBADMSG : 0; |
235 | if (err) | 235 | if (err) |
236 | goto out; | 236 | goto out; |
237 | 237 | ||
@@ -464,7 +464,7 @@ static int crypto_authenc_verify(struct aead_request *req, | |||
464 | ihash = ohash + authsize; | 464 | ihash = ohash + authsize; |
465 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, | 465 | scatterwalk_map_and_copy(ihash, areq_ctx->sg, areq_ctx->cryptlen, |
466 | authsize, 0); | 466 | authsize, 0); |
467 | return memcmp(ihash, ohash, authsize) ? -EBADMSG: 0; | 467 | return memcmp(ihash, ohash, authsize) ? -EBADMSG : 0; |
468 | } | 468 | } |
469 | 469 | ||
470 | static int crypto_authenc_iverify(struct aead_request *req, u8 *iv, | 470 | static int crypto_authenc_iverify(struct aead_request *req, u8 *iv, |
@@ -557,11 +557,11 @@ static int crypto_authenc_init_tfm(struct crypto_tfm *tfm) | |||
557 | 557 | ||
558 | ctx->auth = auth; | 558 | ctx->auth = auth; |
559 | ctx->enc = enc; | 559 | ctx->enc = enc; |
560 | 560 | ||
561 | tfm->crt_aead.reqsize = max_t(unsigned int, | 561 | tfm->crt_aead.reqsize = max_t(unsigned int, |
562 | crypto_ahash_reqsize(auth) + ctx->reqoff + | 562 | crypto_ahash_reqsize(auth) + ctx->reqoff + |
563 | sizeof(struct authenc_request_ctx) + | 563 | sizeof(struct authenc_request_ctx) + |
564 | sizeof(struct ahash_request), | 564 | sizeof(struct ahash_request), |
565 | sizeof(struct skcipher_givcrypt_request) + | 565 | sizeof(struct skcipher_givcrypt_request) + |
566 | crypto_ablkcipher_reqsize(enc) + | 566 | crypto_ablkcipher_reqsize(enc) + |
567 | crypto_ablkcipher_ivsize(enc)); | 567 | crypto_ablkcipher_ivsize(enc)); |