MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / ProcessSessionConfirmedMessagePart2

Method ProcessSessionConfirmedMessagePart2

libi2pd/NTCP2.cpp:501–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499 }
500
501 bool NTCP2Establisher::ProcessSessionConfirmedMessagePart2 (uint8_t * m3p2Buf)
502 {
503 if (!KDF3Bob ()) // MixKey, n = 0
504 {
505 LogPrint (eLogWarning, "NTCP2: SessionConfirmed Part2 KDF failed");
506 return false;
507 }
508 if (Decrypt (m_SessionConfirmedBuffer + 48, m3p2Buf, m3p2Len - 16))
509 // calculate new h again for KDF data
510 MixHash (m_SessionConfirmedBuffer + 48, m3p2Len); // h = SHA256(h || ciphertext)
511 else
512 {
513 LogPrint (eLogWarning, "NTCP2: SessionConfirmed Part2 AEAD verification failed ");
514 return false;
515 }
516 return true;
517 }
518
519 NTCP2Session::NTCP2Session (NTCP2Server& server, std::shared_ptr<const i2p::data::RouterInfo> in_RemoteRouter,
520 std::shared_ptr<const i2p::data::RouterInfo::Address> addr):

Callers 1

Calls 1

LogPrintFunction · 0.85

Tested by

no test coverage detected