Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
don't send ssu packets if they are too big (also covers underflow of …
Browse files Browse the repository at this point in the history
…size_t which in this case made kovri segfault last night)
  • Loading branch information
majestrate committed Jan 28, 2016
1 parent 24e9b71 commit e330dcd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/transport/SSUSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,16 +589,18 @@ void SSUSession::SendSessionCreated(
payload);
payload += signatureLen;
size_t msgLen = payload - buf;
// encrypt message with intro key
FillHeaderAndEncrypt(
if (msgLen <= SSU_MTU_V4 ) {
// encrypt message with intro key
FillHeaderAndEncrypt(
PAYLOAD_TYPE_SESSION_CREATED,
buf,
msgLen,
introKey,
iv,
introKey);
// send it
Send(buf, msgLen);
// send it
Send(buf, msgLen);
}
}

void SSUSession::SendSessionConfirmed(
Expand Down

0 comments on commit e330dcd

Please sign in to comment.