1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-08-30 13:11:49 +00:00

skip transient signature verification if verified through ECIESx25519 session

This commit is contained in:
orignal 2025-06-23 21:53:44 -04:00
parent 9efdc230a9
commit 75dd0d72c6

View File

@ -444,6 +444,22 @@ namespace stream
LogPrint (eLogInfo, "Streaming: offline signature without identity"); LogPrint (eLogInfo, "Streaming: offline signature without identity");
return false; return false;
} }
if (sessionVerified)
{
// skip offline signature
optionData += 4; // timestamp
uint16_t keyType = bufbe16toh (optionData); optionData += 2; // key type
std::unique_ptr<i2p::crypto::Verifier> transientVerifier (i2p::data::IdentityEx::CreateVerifier (keyType));
if (!transientVerifier)
{
LogPrint (eLogInfo, "Streaming: Unknown offline signature key type ", (int)keyType);
return false;
}
optionData += transientVerifier->GetPublicKeyLen (); // public key
optionData += m_RemoteIdentity->GetSignatureLen (); // signature
}
else
{
// if we have it in LeaseSet already we don't need to parse it again // if we have it in LeaseSet already we don't need to parse it again
if (m_RemoteLeaseSet) m_TransientVerifier = m_RemoteLeaseSet->GetTransientVerifier (); if (m_RemoteLeaseSet) m_TransientVerifier = m_RemoteLeaseSet->GetTransientVerifier ();
if (m_TransientVerifier) if (m_TransientVerifier)
@ -466,6 +482,7 @@ namespace stream
} }
} }
} }
}
if (flags & PACKET_FLAG_SIGNATURE_INCLUDED) if (flags & PACKET_FLAG_SIGNATURE_INCLUDED)
{ {