X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=crypto%2Fauthencesn.c;h=0cf5fefdb859b1158460faa278017a524f54a93a;hb=834057bf846691552a8906f7ed3f67546e5f897c;hp=6f8f6b86bfe29e0cf0c8fbf2cbe6ab26b705bc9a;hpb=c7bb6d8060eec4f3806b88796fbf46db1e73d900;p=sfrench%2Fcifs-2.6.git diff --git a/crypto/authencesn.c b/crypto/authencesn.c index 6f8f6b86bfe2..0cf5fefdb859 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);