|
|
@ -100,6 +100,9 @@ namespace ntcp |
|
|
|
delete m_Establisher; |
|
|
|
delete m_Establisher; |
|
|
|
m_Establisher = nullptr; |
|
|
|
m_Establisher = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete m_DHKeysPair; |
|
|
|
|
|
|
|
m_DHKeysPair = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
SendTimeSyncMessage (); |
|
|
|
SendTimeSyncMessage (); |
|
|
|
SendI2NPMessage (CreateDatabaseStoreMsg ()); // we tell immediately who we are
|
|
|
|
SendI2NPMessage (CreateDatabaseStoreMsg ()); // we tell immediately who we are
|
|
|
|
|
|
|
|
|
|
|
@ -154,6 +157,8 @@ namespace ntcp |
|
|
|
if (ecode) |
|
|
|
if (ecode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint ("Phase 1 read error: ", ecode.message ()); |
|
|
|
LogPrint ("Phase 1 read error: ", ecode.message ()); |
|
|
|
|
|
|
|
i2p::transports.ReuseDHKeysPair (m_DHKeysPair); |
|
|
|
|
|
|
|
m_DHKeysPair = nullptr; |
|
|
|
Terminate (); |
|
|
|
Terminate (); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -168,6 +173,8 @@ namespace ntcp |
|
|
|
if ((m_Establisher->phase1.HXxorHI[i] ^ ident[i]) != digest[i]) |
|
|
|
if ((m_Establisher->phase1.HXxorHI[i] ^ ident[i]) != digest[i]) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint ("Wrong ident"); |
|
|
|
LogPrint ("Wrong ident"); |
|
|
|
|
|
|
|
i2p::transports.ReuseDHKeysPair (m_DHKeysPair); |
|
|
|
|
|
|
|
m_DHKeysPair = nullptr; |
|
|
|
Terminate (); |
|
|
|
Terminate (); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -224,6 +231,8 @@ namespace ntcp |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint ("Phase 2 read error: ", ecode.message (), ". Wrong ident assumed"); |
|
|
|
LogPrint ("Phase 2 read error: ", ecode.message (), ". Wrong ident assumed"); |
|
|
|
GetRemoteRouterInfo ().SetUnreachable (true); // this RouterInfo is not valid
|
|
|
|
GetRemoteRouterInfo ().SetUnreachable (true); // this RouterInfo is not valid
|
|
|
|
|
|
|
|
i2p::transports.ReuseDHKeysPair (m_DHKeysPair); |
|
|
|
|
|
|
|
m_DHKeysPair = nullptr; |
|
|
|
Terminate (); |
|
|
|
Terminate (); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|