mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 01:29:21 +02:00
fix crash bug on decrypt with invalid rsa on the client side
This commit is contained in:
parent
51c4d22aa8
commit
2b877cd03c
@ -31,9 +31,13 @@ static CryptoPP::AutoSeededRandomPool prng;
|
||||
|
||||
void RSA::decrypt(char* msg) const
|
||||
{
|
||||
try {
|
||||
CryptoPP::Integer m{ reinterpret_cast<uint8_t*>(msg), 128 };
|
||||
auto c = pk.CalculateInverse(prng, m);
|
||||
c.Encode(reinterpret_cast<uint8_t*>(msg), 128);
|
||||
}
|
||||
catch (const CryptoPP::Exception& e) {
|
||||
}
|
||||
}
|
||||
|
||||
static const std::string header = "-----BEGIN RSA PRIVATE KEY-----";
|
||||
|
Loading…
x
Reference in New Issue
Block a user