summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/connection.cpp
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2016-04-07 18:53:06 +0000
committerAlexander Gluzsky <sss123next@list.ru>2016-04-07 18:53:06 +0000
commit45795f0e01be0f51ac647cac4e7c35463f39636a (patch)
treea2e8dbd515f4006b09ff913e70a05214cf90b6a2 /protocols/AimOscar/src/connection.cpp
parent6d823d15030bc2ccb7237a15492d20a204244ce0 (diff)
aim:
"clientlogin": implemented hmac_sha256 "clientlogin" is fully implemented now //TODO: make some testing //TODO: turn it on git-svn-id: http://svn.miranda-ng.org/main/trunk@16607 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/connection.cpp')
-rwxr-xr-xprotocols/AimOscar/src/connection.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/protocols/AimOscar/src/connection.cpp b/protocols/AimOscar/src/connection.cpp
index 0be3ef6dfc..600f4cbcc9 100755
--- a/protocols/AimOscar/src/connection.cpp
+++ b/protocols/AimOscar/src/connection.cpp
@@ -258,7 +258,8 @@ void generate_signature(char *signature, const char *method, const char *url, co
mir_snprintf(signature_base, 1023, "%s%s%s", method, encoded_url, encoded_parameters);
mir_free(encoded_url);
mir_free(encoded_parameters);
- //signature = hmac_sha256(session_key, signature_base);//TODO: need this to be implemented
+ hmac_sha256(session_key, signature_base, signature);
+
}
void fill_session_url(char *buf, char *token, char *secret, time_t &hosttime, const char *password, bool encryption = true)
@@ -269,12 +270,12 @@ void fill_session_url(char *buf, char *token, char *secret, time_t &hosttime, co
*/
char query_string[1024];
query_string[0] = 0;
- construct_query_string(query_string, token, hosttime);
+ construct_query_string(query_string, token, hosttime, encryption);
char signature[512];
char session_key[1024];
- //session_key = hmac_sha256(password, secret); //TODO: need this to be implemented
+ hmac_sha256(password, secret, session_key);
generate_signature(signature, "GET", AIM_SESSION_URL, query_string, session_key);
@@ -353,17 +354,20 @@ bool parse_start_socar_session_response(char *response, char *bos_host, unsigned
bos_port = atoi(tmp_port);
mir_strcpy(cookie, tmp_cookie);
mir_free(tmp_host); mir_free(tmp_port); mir_free(tmp_cookie);
- HXML tls_node = xmlGetNthChild(data, _T("tlsCertName"), 0); //tls is optional, so this is not fatal error
- if(tls_node)
+ if (encryption)
{
- LPCTSTR certname_w = xmlGetText(tls_node);
- if(certname_w)
+ HXML tls_node = xmlGetNthChild(data, _T("tlsCertName"), 0); //tls is optional, so this is not fatal error
+ if (tls_node)
{
- char *tmp_certname = mir_t2a(certname_w);
- if(tmp_certname)
+ LPCTSTR certname_w = xmlGetText(tls_node);
+ if (certname_w)
{
- mir_strcpy(tls_cert_name, tmp_certname);
- mir_free(tmp_certname);
+ char *tmp_certname = mir_t2a(certname_w);
+ if (tmp_certname)
+ {
+ mir_strcpy(tls_cert_name, tmp_certname);
+ mir_free(tmp_certname);
+ }
}
}
}