summaryrefslogtreecommitdiff
path: root/crypto/authencesn.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2017-09-25 11:15:38 -0400
committerDoug Ledford <dledford@redhat.com>2017-09-25 11:16:58 -0400
commite83c465ae14844b2dfff55178b82eeaccbef0b24 (patch)
tree9ba289bdd8831b061743a8d48b13e6128306b8f1 /crypto/authencesn.c
parentf960b5ebd9ed09bc12e10c712bce82ab58ef0435 (diff)
parent508f8d23a372beae647185ce896a0c1109406b83 (diff)
downloadlinux-crypto-e83c465ae14844b2dfff55178b82eeaccbef0b24.tar.gz
linux-crypto-e83c465ae14844b2dfff55178b82eeaccbef0b24.zip
Merge tag 'v4.14-rc2' into k.o/for-next
Merge my for-next branch to Linux 4.14-rc2 and open up the for-next area for 4.15 kernel development. Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r--crypto/authencesn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/authencesn.c b/crypto/authencesn.c
index 6f8f6b86..0cf5fefd 100644
--- a/crypto/authencesn.c
+++ b/crypto/authencesn.c
@@ -248,6 +248,9 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
u8 *ihash = ohash + crypto_ahash_digestsize(auth);
u32 tmp[2];
+ if (!authsize)
+ goto decrypt;
+
/* Move high-order bits of sequence number back. */
scatterwalk_map_and_copy(tmp, dst, 4, 4, 0);
scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 0);
@@ -256,6 +259,8 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
if (crypto_memneq(ihash, ohash, authsize))
return -EBADMSG;
+decrypt:
+
sg_init_table(areq_ctx->dst, 2);
dst = scatterwalk_ffwd(areq_ctx->dst, dst, assoclen);