mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #16327: Crash supplying a bad signature size in the auth packet
This commit is contained in:
parent
4155bf9ce0
commit
b89eddc867
|
@ -2559,6 +2559,15 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke
|
|||
{
|
||||
try
|
||||
{
|
||||
// RSA technically supports keys up to 65536 bits, so this is the
|
||||
// maximum signature size for now.
|
||||
constexpr auto MaxRSASignatureSizeInBytes = 8192;
|
||||
|
||||
if (sigsize == 0 || sigsize > MaxRSASignatureSizeInBytes)
|
||||
{
|
||||
throw std::runtime_error("Invalid signature size");
|
||||
}
|
||||
|
||||
std::vector<uint8_t> signature;
|
||||
signature.resize(sigsize);
|
||||
|
||||
|
|
Loading…
Reference in New Issue