| 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 | { |
no test coverage detected