summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_login.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-12-05 22:48:07 +0100
committerRobert Pösel <robyer@seznam.cz>2017-12-05 22:48:31 +0100
commit0a8dbb91b0f505da3ce617fa5284719b8356cdac (patch)
tree428fec080c21abd172b27ffdde15c52a86c9c7dd /protocols/Steam/src/steam_login.cpp
parentdd604b30c3153903bef1d40d4ebaa62f14671177 (diff)
Steam: For RsaEncryption use exponent received from server
Diffstat (limited to 'protocols/Steam/src/steam_login.cpp')
-rw-r--r--protocols/Steam/src/steam_login.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index c1ef9b09f0..d91acaba6d 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -64,8 +64,8 @@ void CSteamProto::OnGotRsaKey(const HttpResponse *response)
return;
std::string modulus = root["publickey_mod"].as_string();
- // exponent "010001" is used as constant in CSteamProto::RsaEncrypt
- //std::string exponent = root["publickey_exp"].as_string();
+ std::string exp = root["publickey_exp"].as_string();
+ DWORD exponent = strtoul(exp.c_str(), nullptr, 16); // default "010001" = 0x10001
std::string timestamp = root["timestamp"].as_string();
@@ -75,14 +75,14 @@ void CSteamProto::OnGotRsaKey(const HttpResponse *response)
DWORD error = 0;
DWORD encryptedSize = 0;
- if ((error = RsaEncrypt(modulus.c_str(), szPassword, nullptr, encryptedSize)) != 0)
+ if ((error = RsaEncrypt(modulus.c_str(), exponent, szPassword, nullptr, encryptedSize)) != 0)
{
debugLogA("CSteamProto::OnGotRsaKey: encryption error (%lu)", error);
return;
}
BYTE *encryptedPassword = (BYTE*)mir_calloc(encryptedSize);
- if ((error = RsaEncrypt(modulus.c_str(), szPassword, encryptedPassword, encryptedSize)) != 0)
+ if ((error = RsaEncrypt(modulus.c_str(), exponent, szPassword, encryptedPassword, encryptedSize)) != 0)
{
debugLogA("CSteamProto::OnGotRsaKey: encryption error (%lu)", error);
return;