1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-08-31 01: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,28 +412,23 @@ 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
m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
}
if (packet->from && m_RemoteLeaseSet)
{ {
// stream came from ratchets session and static key must match one from LeaseSet // stream came from ratchets session and static key must match one from LeaseSet
m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
if (!m_RemoteLeaseSet)
{
LogPrint (eLogInfo, "Streaming: Incoming stream from ", m_RemoteIdentity->GetIdentHash ().ToBase32 (),
" without LeaseSet. sSID=", m_SendStreamID, ", rSID=", m_RecvStreamID);
return false;
}
uint8_t staticKey[32]; uint8_t staticKey[32];
m_RemoteLeaseSet->Encrypt (nullptr, staticKey); m_RemoteLeaseSet->Encrypt (nullptr, staticKey);
if (memcmp (packet->from->GetRemoteStaticKey (), staticKey, 32)) if (memcmp (packet->from->GetRemoteStaticKey (), staticKey, 32))
{ {
LogPrint (eLogError, "Streaming: Remote LeaseSet static key mismatch for incoming stream from ", LogPrint (eLogError, "Streaming: Remote LeaseSet static key mismatch for stream from ",
m_RemoteIdentity->GetIdentHash ().ToBase32 ()); m_RemoteIdentity->GetIdentHash ().ToBase32 ());
return false; return false;
} }
sessionVerified = true; sessionVerified = true;
} }
} }
}
if (flags & PACKET_FLAG_MAX_PACKET_SIZE_INCLUDED) if (flags & PACKET_FLAG_MAX_PACKET_SIZE_INCLUDED)
{ {