Skip to content

Commit

Permalink
set max padding size to 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Feb 17, 2025
1 parent 3d19fa1 commit fa2178c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libi2pd/SSU2Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,7 @@ namespace transport
size_t SSU2Session::CreatePaddingBlock (uint8_t * buf, size_t len, size_t minSize)
{
if (len < 3 || len < minSize) return 0;
size_t paddingSize = m_Server.GetRng ()() & 0x0F; // 0 - 15
size_t paddingSize = m_Server.GetRng ()() & 0x1F; // 0 - 31
if (paddingSize + 3 > len) paddingSize = len - 3;
else if (paddingSize + 3 < minSize) paddingSize = minSize - 3;
buf[0] = eSSU2BlkPadding;
Expand Down

0 comments on commit fa2178c

Please sign in to comment.