mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Paranoia check for identical finished messages.
This commit is contained in:
@@ -727,8 +727,10 @@ void Peer::getSessionCookie(std::string& strDst)
|
|||||||
|
|
||||||
SHA512(s1, l1, sha1);
|
SHA512(s1, l1, sha1);
|
||||||
SHA512(s2, l2, sha2);
|
SHA512(s2, l2, sha2);
|
||||||
|
if (memcmp(s1, s2, sizeof(sha1))
|
||||||
|
throw std::runtime_errror("Identical finished messages");
|
||||||
|
|
||||||
for (int i=0; i<sizeof(sha1); i++)
|
for (int i = 0; i < sizeof(sha1); ++i)
|
||||||
sha1[i] ^= sha2[i];
|
sha1[i] ^= sha2[i];
|
||||||
|
|
||||||
strDst.assign((char *) &sha1[0], sizeof(sha1));
|
strDst.assign((char *) &sha1[0], sizeof(sha1));
|
||||||
|
|||||||
Reference in New Issue
Block a user