aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/authenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 5ef7ba6b6a76..d0583a4489e6 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -336,7 +336,7 @@ static int crypto_authenc_genicv(struct aead_request *req, u8 *iv,
336 cryptlen += ivsize; 336 cryptlen += ivsize;
337 } 337 }
338 338
339 if (sg_is_last(assoc)) { 339 if (req->assoclen && sg_is_last(assoc)) {
340 authenc_ahash_fn = crypto_authenc_ahash; 340 authenc_ahash_fn = crypto_authenc_ahash;
341 sg_init_table(asg, 2); 341 sg_init_table(asg, 2);
342 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset); 342 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset);
@@ -490,7 +490,7 @@ static int crypto_authenc_iverify(struct aead_request *req, u8 *iv,
490 cryptlen += ivsize; 490 cryptlen += ivsize;
491 } 491 }
492 492
493 if (sg_is_last(assoc)) { 493 if (req->assoclen && sg_is_last(assoc)) {
494 authenc_ahash_fn = crypto_authenc_ahash; 494 authenc_ahash_fn = crypto_authenc_ahash;
495 sg_init_table(asg, 2); 495 sg_init_table(asg, 2);
496 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset); 496 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset);