MixHash for SessionConfirmed processing

This commit is contained in:
orignal 2020-08-03 18:31:03 -04:00
parent c3aa6b9cda
commit 9636d82b37

View File

@ -338,11 +338,8 @@ namespace transport
KDF3Bob (); KDF3Bob ();
if (i2p::crypto::AEADChaCha20Poly1305 (m_SessionConfirmedBuffer + 48, m3p2Len - 16, GetH (), 32, GetK (), nonce, m3p2Buf, m3p2Len - 16, false)) // decrypt if (i2p::crypto::AEADChaCha20Poly1305 (m_SessionConfirmedBuffer + 48, m3p2Len - 16, GetH (), 32, GetK (), nonce, m3p2Buf, m3p2Len - 16, false)) // decrypt
{
// caclulate new h again for KDF data // caclulate new h again for KDF data
memcpy (m_SessionConfirmedBuffer + 16, m_H, 32); // h || ciphertext MixHash (m_SessionConfirmedBuffer + 48, m3p2Len); // h = SHA256(h || ciphertext)
SHA256 (m_SessionConfirmedBuffer + 16, m3p2Len + 32, m_H); //h = SHA256(h || ciphertext);
}
else else
{ {
LogPrint (eLogWarning, "NTCP2: SessionConfirmed Part2 AEAD verification failed "); LogPrint (eLogWarning, "NTCP2: SessionConfirmed Part2 AEAD verification failed ");