diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-23 20:11:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-23 20:11:05 +0300 |
commit | ff6b8261d89a2ac071bba0ebe0e16b40dd7122a1 (patch) | |
tree | 4259ca6e16d4bf453be0bc2aaa31f5a5ba413051 /protocols/Twitter | |
parent | 6c05257b0cee0cfd1599e1f771dfadfe6035141f (diff) |
in fact, we don't need mir_hmac_sha1 either
Diffstat (limited to 'protocols/Twitter')
-rw-r--r-- | protocols/Twitter/src/oauth.cpp | 3 | ||||
-rw-r--r-- | protocols/Twitter/src/stdafx.h | 4 |
2 files changed, 6 insertions, 1 deletions
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<wchar_t> wstring; #include <win2k.h>
#pragma warning(pop)
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+#pragma comment(lib, "libeay32.lib")
+
#include "StringUtil.h"
#define TWITTER_KEY_NICK "Nick" // we need one called Nick for the chat thingo to work
|