summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-02 17:34:53 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-02 17:34:53 +0000
commit904cc94d119a5b7952cffe35e9023035a7a0c21c (patch)
treed37fcdbe0652fb9cb8fb3e95a60547c3ec043fb6 /protocols
parent1945b7e33c81e127e93e33c60b0dd62c11a0df1c (diff)
SkypeWeb: zero memory with password
git-svn-id: http://svn.miranda-ng.org/main/trunk@14820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp11
-rw-r--r--protocols/SkypeWeb/src/skype_options.cpp16
2 files changed, 17 insertions, 10 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index da844ae286..ab650a5e0e 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -25,9 +25,9 @@ void CSkypeProto::Login()
m_iStatus = ID_STATUS_CONNECTING;
requestQueue->Start();
int tokenExpires(getDword("TokenExpiresIn", 0));
- ptrA login(getStringA(SKYPE_SETTINGS_ID));
- ptrA password(getStringA(SKYPE_SETTINGS_PASSWORD));
- if (login == NULL || password == NULL)
+ ptrA szLogin(getStringA(SKYPE_SETTINGS_ID));
+ ptrA szPassword(getStringA(SKYPE_SETTINGS_PASSWORD));
+ if (szLogin == NULL || szPassword == NULL)
{
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
return;
@@ -37,11 +37,12 @@ void CSkypeProto::Login()
OnLoginSuccess();
else
{
- if (strstr(login, "@"))
+ if (strchr(szLogin, '@'))
SendRequest(new LoginMSRequest(), &CSkypeProto::OnMSLoginFirst);
else
- SendRequest(new LoginOAuthRequest(login, password), &CSkypeProto::OnLoginOAuth);
+ SendRequest(new LoginOAuthRequest(szLogin, szPassword), &CSkypeProto::OnLoginOAuth);
}
+ SecureZeroMemory(szPassword, mir_strlen(szPassword));
}
void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response)
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp
index 7342a077ac..4253930fba 100644
--- a/protocols/SkypeWeb/src/skype_options.cpp
+++ b/protocols/SkypeWeb/src/skype_options.cpp
@@ -52,15 +52,21 @@ void CSkypeOptionsMain::OnInitDialog()
void CSkypeOptionsMain::OnApply()
{
- ptrA tszNewSkypename(m_skypename.GetTextA()), tszNewPassword(m_password.GetTextA()),
- tszOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID)), tszOldPassword(m_proto->getStringA("Password"));
- if (mir_strcmpi(tszNewSkypename, tszOldSkypename) || mir_strcmp(tszNewPassword, tszOldPassword))
+ ptrA szNewSkypename(m_skypename.GetTextA()),
+ szNewPassword(m_password.GetTextA()),
+ szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID)),
+ szOldPassword(m_proto->getStringA("Password"));
+
+ if (mir_strcmpi(szNewSkypename, szOldSkypename) || mir_strcmp(szNewPassword, szOldPassword))
m_proto->delSetting("TokenExpiresIn");
- m_proto->setString(SKYPE_SETTINGS_ID, tszNewSkypename);
- m_proto->setString("Password", tszNewPassword);
+ m_proto->setString(SKYPE_SETTINGS_ID, szNewSkypename);
+ m_proto->setString("Password", szNewPassword);
ptrT group(m_group.GetText());
if (mir_tstrlen(group) > 0 && !Clist_GroupExists(group))
Clist_CreateGroup(0, group);
+
+ SecureZeroMemory(szNewPassword, mir_strlen(szNewPassword));
+ SecureZeroMemory(szOldPassword, mir_strlen(szOldPassword));
}
/////////////////////////////////////////////////////////////////////////////////