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

Method CreateSessionConfirmedMessagePart2

libi2pd/NTCP2.cpp:309–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307 }
308
309 bool NTCP2Establisher::CreateSessionConfirmedMessagePart2 ()
310 {
311 // part 2
312 // update AD again
313 MixHash (m_SessionConfirmedBuffer, 48);
314 // encrypt m3p2, it must be filled in SessionRequest
315 if (!KDF3Alice ()) return false; // MixKey, n = 0
316 uint8_t * m3p2 = m_SessionConfirmedBuffer + 48;
317 if (!Encrypt (m3p2, m3p2, m3p2Len - 16))
318 {
319 LogPrint (eLogWarning, "NTCP2: SessionConfirmed failed to encrypt part2");
320 return false;
321 }
322 // update h again
323 MixHash (m3p2, m3p2Len); //h = SHA256(h || ciphertext)
324 return true;
325 }
326
327 bool NTCP2Establisher::ProcessSessionRequestMessage (uint16_t& paddingLen, bool& clockSkew, bool& pq, bool decryptX)
328 {

Callers 1

SendSessionConfirmedMethod · 0.80

Calls 1

LogPrintFunction · 0.85

Tested by

no test coverage detected