mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
handle SessionConfirmed
This commit is contained in:
parent
5218c8584f
commit
00c71dc26a
2 changed files with 101 additions and 20 deletions
|
@ -33,14 +33,15 @@ namespace transport
|
|||
void MixKey (const uint8_t * inputKeyMaterial, uint8_t * derived);
|
||||
void KeyDerivationFunction1 (const uint8_t * rs, const uint8_t * priv, const uint8_t * pub); // for SessionRequest
|
||||
void KeyDerivationFunction2 (const uint8_t * sessionRequest, size_t sessionRequestLen); // for SessionCreate
|
||||
void KeyDerivationFunction3 (const uint8_t * staticPrivKey); // for SessionConfirmed part 2
|
||||
void KDF3Alice (); // for SessionConfirmed part 2
|
||||
void KDF3Bob ();
|
||||
void CreateEphemeralKey ();
|
||||
|
||||
|
||||
BN_CTX * m_Ctx;
|
||||
uint8_t m_EphemeralPrivateKey[32], m_EphemeralPublicKey[32], m_RemoteEphemeralPublicKey[32]; // x25519
|
||||
uint8_t m_RemoteStaticKey[32], m_IV[16], m_H[32] /*h*/, m_CK[33] /*ck*/, m_K[32] /*k*/;
|
||||
|
||||
uint16_t m3p2Len;
|
||||
};
|
||||
|
||||
class NTCP2Server;
|
||||
|
@ -76,6 +77,7 @@ namespace transport
|
|||
void HandleSessionCreatedReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred);
|
||||
void HandleSessionCreatedPaddingReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred);
|
||||
void HandleSessionConfirmedSent (const boost::system::error_code& ecode, std::size_t bytes_transferred);
|
||||
void HandleSessionConfirmedReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred);
|
||||
|
||||
// data
|
||||
void ReceiveLength ();
|
||||
|
@ -98,6 +100,7 @@ namespace transport
|
|||
size_t m_SessionRequestBufferLen, m_SessionCreatedBufferLen;
|
||||
// data phase
|
||||
uint8_t m_Kab[33], m_Kba[32], m_Sipkeysab[33], m_Sipkeysba[32];
|
||||
const uint8_t * m_SendKey, * m_ReceiveKey, * m_SendSipKey, * m_ReceiveSipKey;
|
||||
uint16_t m_NextReceivedLen;
|
||||
uint8_t * m_NextReceivedBuffer, * m_NextSendBuffer;
|
||||
uint8_t m_ReceiveIV[8], m_SendIV[8];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue