mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-14 11:31:08 +00:00
fallback to non-PQ crypto if MTU is too small
This commit is contained in:
@@ -3407,5 +3407,21 @@ namespace transport
|
||||
{
|
||||
return m_RemoteEndpoint.address ().is_v4 () ? i2p::data::RouterInfo::eSSU2V4 : i2p::data::RouterInfo::eSSU2V6;
|
||||
}
|
||||
|
||||
void SSU2Session::SetVersion (uint8_t version)
|
||||
{
|
||||
switch (version)
|
||||
{
|
||||
case 3:
|
||||
m_Version = 3;
|
||||
break;
|
||||
case 4:
|
||||
m_Version = (m_MaxPayloadSize >= SSU2_MLKEM768_MIN_PAYLOAD_SIZE) ? 4: 2;
|
||||
break;
|
||||
default:
|
||||
m_Version = 2;
|
||||
}
|
||||
m_Version = (version >= 2 && version <= 4) ? version : 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user