Skip to content

Commit

Permalink
[core] fix listener's cookie check (#2176).
Browse files Browse the repository at this point in the history
If a cookie from the caller HS conclusion response does not match the current listener's cookie, check the one that would have been generated a minute ago by the listener.
  • Loading branch information
cg82616424 committed Oct 26, 2021
1 parent 427cece commit f11b026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10610,7 +10610,7 @@ int32_t srt::CUDT::bake(const sockaddr_any& addr, int32_t current_cookie, int co
clientport,
sizeof(clientport),
NI_NUMERICHOST | NI_NUMERICSERV);
int64_t timestamp = (count_microseconds(steady_clock::now() - m_stats.tsStartTime) / 60000000) + distractor -
int64_t timestamp = (count_microseconds(steady_clock::now() - m_stats.tsStartTime) / 60000000) + distractor +
correction; // secret changes every one minute
stringstream cookiestr;
cookiestr << clienthost << ":" << clientport << ":" << timestamp;
Expand Down

0 comments on commit f11b026

Please sign in to comment.