fallback to non-PQ crypto if MTU is too small

This commit is contained in:
orignal
2026-03-14 19:56:18 -04:00
parent 6df4138178
commit 1a237d3ff9
2 changed files with 18 additions and 1 deletions
+16
View File
@@ -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;
}
}
}