Browse Source

correct message size

pull/1474/head
orignal 5 years ago
parent
commit
cdd068d99a
  1. 4
      libi2pd/ECIESX25519AEADRatchetSession.cpp

4
libi2pd/ECIESX25519AEADRatchetSession.cpp

@ -379,7 +379,7 @@ namespace garlic
uint8_t paddingSize; uint8_t paddingSize;
RAND_bytes (&paddingSize, 1); RAND_bytes (&paddingSize, 1);
paddingSize &= 0x0F; paddingSize++; // 1 - 16 paddingSize &= 0x0F; paddingSize++; // 1 - 16
payloadLen += paddingSize; payloadLen += paddingSize + 3;
std::vector<uint8_t> v(payloadLen); std::vector<uint8_t> v(payloadLen);
size_t offset = 0; size_t offset = 0;
// DateTime // DateTime
@ -395,7 +395,7 @@ namespace garlic
// padding // padding
v[offset] = eECIESx25519BlkPadding; offset++; v[offset] = eECIESx25519BlkPadding; offset++;
htobe16buf (v.data () + offset, paddingSize); offset += 2; 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; return v;
} }

Loading…
Cancel
Save