From ff6b8261d89a2ac071bba0ebe0e16b40dd7122a1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 23 Dec 2018 20:11:05 +0300 Subject: in fact, we don't need mir_hmac_sha1 either --- protocols/Twitter/src/oauth.cpp | 3 ++- protocols/Twitter/src/stdafx.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/Twitter/src') diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp index 1105b6e650..b4b00cb8fa 100644 --- a/protocols/Twitter/src/oauth.cpp +++ b/protocols/Twitter/src/oauth.cpp @@ -337,8 +337,9 @@ wstring mir_twitter::OAuthCreateSignature(const wstring& signatureBase, const ws string keyBytes = WideToUTF8(key); BYTE digest[MIR_SHA1_HASH_SIZE]; + unsigned int len = sizeof(digest); string data = WideToUTF8(signatureBase); - mir_hmac_sha1(digest, (PBYTE)keyBytes.c_str(), keyBytes.size(), (PBYTE)data.c_str(), data.size()); + HMAC(EVP_sha1(), keyBytes.c_str(), keyBytes.size(), (PBYTE)data.c_str(), data.size(), digest, &len); ptrA encoded(mir_base64_encode(digest, sizeof(digest))); return UrlEncode((wchar_t*)_A2T(encoded)); } diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h index 8373154179..456c816a0f 100644 --- a/protocols/Twitter/src/stdafx.h +++ b/protocols/Twitter/src/stdafx.h @@ -64,6 +64,10 @@ typedef std::basic_string wstring; #include #pragma warning(pop) +#include +#include +#pragma comment(lib, "libeay32.lib") + #include "StringUtil.h" #define TWITTER_KEY_NICK "Nick" // we need one called Nick for the chat thingo to work -- cgit v1.2.3