mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-16 00:12:43 +00:00
MixHash for SessionConfirmed processing
This commit is contained in:
parent
c3aa6b9cda
commit
9636d82b37
@ -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 ");
|
||||||
|
Loading…
Reference in New Issue
Block a user