diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-27 20:53:58 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-27 20:54:07 +0300 |
commit | 38af197ebf6ff9f947d02338262ad8ebe48f26d3 (patch) | |
tree | d6729c86ee940118a8218028bf095c84113b2efa /protocols/Icq10/src/utils.cpp | |
parent | 7b4ac22ea5d0d655d302b0edcb753889d5f39fd6 (diff) |
fixes #1668 (ICQ: contact search)
Diffstat (limited to 'protocols/Icq10/src/utils.cpp')
-rw-r--r-- | protocols/Icq10/src/utils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Icq10/src/utils.cpp b/protocols/Icq10/src/utils.cpp index 12ba8eaacf..412484ebda 100644 --- a/protocols/Icq10/src/utils.cpp +++ b/protocols/Icq10/src/utils.cpp @@ -34,6 +34,17 @@ IcqCacheItem* CIcqProto::FindContactByUIN(DWORD dwUin) } ///////////////////////////////////////////////////////////////////////////////////////// + +void CIcqProto::CalcHash(AsyncHttpRequest *pReq) +{ + CMStringA hashData(FORMAT, "POST&%s&%s", ptrA(mir_urlEncode(pReq->m_szUrl)), ptrA(mir_urlEncode(pReq->m_szParam))); + unsigned int len; + BYTE hashOut[MIR_SHA256_HASH_SIZE]; + HMAC(EVP_sha256(), m_szSessionKey, m_szSessionKey.GetLength(), (BYTE*)hashData.c_str(), hashData.GetLength(), hashOut, &len); + pReq << CHAR_PARAM("sig_sha256", ptrA(mir_base64_encode(hashOut, sizeof(hashOut)))); +} + +///////////////////////////////////////////////////////////////////////////////////////// // Avatars void CIcqProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen) |