diff options
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) |