1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-08-26 08:41:50 +00:00

don't verify signature for SYN-ACK if comes from ECIESx25519 session

This commit is contained in:
orignal 2025-06-19 18:32:43 -04:00
parent 78357c23d2
commit a6bf6baf1b

View File

@ -412,26 +412,21 @@ namespace stream
if (!m_RemoteLeaseSet) if (!m_RemoteLeaseSet)
{ {
LogPrint (eLogDebug, "Streaming: Incoming stream from ", m_RemoteIdentity->GetIdentHash ().ToBase32 (), ", sSID=", m_SendStreamID, ", rSID=", m_RecvStreamID); LogPrint (eLogDebug, "Streaming: Incoming stream from ", m_RemoteIdentity->GetIdentHash ().ToBase32 (), ", sSID=", m_SendStreamID, ", rSID=", m_RecvStreamID);
if (packet->from) if (packet->from) // try to obtain LeaseSet if came from ratchets session
{
// stream came from ratchets session and static key must match one from LeaseSet
m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ()); m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
if (!m_RemoteLeaseSet) }
{ if (packet->from && m_RemoteLeaseSet)
LogPrint (eLogInfo, "Streaming: Incoming stream from ", m_RemoteIdentity->GetIdentHash ().ToBase32 (), {
" without LeaseSet. sSID=", m_SendStreamID, ", rSID=", m_RecvStreamID); // stream came from ratchets session and static key must match one from LeaseSet
return false; uint8_t staticKey[32];
} m_RemoteLeaseSet->Encrypt (nullptr, staticKey);
uint8_t staticKey[32]; if (memcmp (packet->from->GetRemoteStaticKey (), staticKey, 32))
m_RemoteLeaseSet->Encrypt (nullptr, staticKey); {
if (memcmp (packet->from->GetRemoteStaticKey (), staticKey, 32)) LogPrint (eLogError, "Streaming: Remote LeaseSet static key mismatch for stream from ",
{ m_RemoteIdentity->GetIdentHash ().ToBase32 ());
LogPrint (eLogError, "Streaming: Remote LeaseSet static key mismatch for incoming stream from ", return false;
m_RemoteIdentity->GetIdentHash ().ToBase32 ());
return false;
}
sessionVerified = true;
} }
sessionVerified = true;
} }
} }