diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-03-16 19:57:26 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-03-16 19:57:26 +0000 |
commit | f5ac10997e9b8574a1ae6c50d53a736da6b38a9b (patch) | |
tree | 741d163edbb8bc3683064746d58e35a8bff4081b /protocols | |
parent | bd0005cee76dccdceca1d9ecbb1bdf6e20c31b29 (diff) |
Steam: fixed authorization
git-svn-id: http://svn.miranda-ng.org/main/trunk@12418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Steam/src/steam_account.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index 94b26e384d..01adca1cf6 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -63,17 +63,15 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *arg) base64RsaEncryptedPassword = mir_base64_encode(encryptedPassword, encryptedSize);
mir_free(encryptedPassword);
- //setString("EncryptedPassword", base64RsaEncryptedPassword);
- PasswordParam *param = (PasswordParam*)mir_alloc(sizeof(PasswordParam));
- strcpy(param->password, base64RsaEncryptedPassword);
- strcpy(param->timestamp, timestamp);
+ setString("EncryptedPassword", base64RsaEncryptedPassword);
+ setString("RsaTimestamp", timestamp);
// run authorization request
ptrA username(mir_utf8encodeW(getWStringA("Username")));
PushRequest(
new SteamWebApi::AuthorizationRequest(username, base64RsaEncryptedPassword, timestamp),
- &CSteamProto::OnAuthorization, param, ARG_NO_FREE);
+ &CSteamProto::OnAuthorization);
}
void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg)
@@ -94,7 +92,6 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg) {
ShowNotification(TranslateTS(message));
SetStatus(ID_STATUS_OFFLINE);
- mir_free(arg);
return;
}
@@ -114,10 +111,11 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg) return;
ptrA username(mir_utf8encodeW(getWStringA("Username")));
- PasswordParam *param = (PasswordParam*)arg;
+ ptrA password(getStringA("EncryptedPassword"));
+ ptrA timestamp(getStringA("RsaTimestamp"));
PushRequest(
- new SteamWebApi::AuthorizationRequest(username, param->password, param->timestamp, guard.code),
+ new SteamWebApi::AuthorizationRequest(username, password, timestamp, guard.code),
&CSteamProto::OnAuthorization);
return;
}
@@ -155,20 +153,23 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg) }
ptrA username(mir_utf8encodeW(getWStringA("Username")));
- PasswordParam *param = (PasswordParam*)arg;
+ ptrA password(getStringA("EncryptedPassword"));
+ ptrA timestamp(getStringA("RsaTimestamp"));
PushRequest(
- new SteamWebApi::AuthorizationRequest(username, param->password, param->timestamp, captchaId, captcha.text),
+ new SteamWebApi::AuthorizationRequest(username, password, timestamp, captchaId, captcha.text),
&CSteamProto::OnAuthorization);
return;
}
+ delSetting("EncryptedPassword");
+ delSetting("RsaTimestamp");
SetStatus(ID_STATUS_OFFLINE);
- mir_free(arg);
return;
}
- mir_free(arg);
+ delSetting("EncryptedPassword");
+ delSetting("RsaTimestamp");
node = json_get(root, "login_complete");
if (!json_as_bool(node))
|