From cdd068d99aef58a32c155597218d54ba77e84cdf Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 29 Jan 2020 19:27:38 -0500 Subject: [PATCH] correct message size --- libi2pd/ECIESX25519AEADRatchetSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/ECIESX25519AEADRatchetSession.cpp b/libi2pd/ECIESX25519AEADRatchetSession.cpp index ffda9191..b6820482 100644 --- a/libi2pd/ECIESX25519AEADRatchetSession.cpp +++ b/libi2pd/ECIESX25519AEADRatchetSession.cpp @@ -379,7 +379,7 @@ namespace garlic uint8_t paddingSize; RAND_bytes (&paddingSize, 1); paddingSize &= 0x0F; paddingSize++; // 1 - 16 - payloadLen += paddingSize; + payloadLen += paddingSize + 3; std::vector v(payloadLen); size_t offset = 0; // DateTime @@ -395,7 +395,7 @@ namespace garlic // padding v[offset] = eECIESx25519BlkPadding; offset++; htobe16buf (v.data () + offset, paddingSize); offset += 2; - memset (v.data () + offset, 0, paddingSize); offset += paddingSize; + memset (v.data () + offset, 0, paddingSize); offset += paddingSize; return v; }