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/Gadu-Gadu | |
parent | 6c05257b0cee0cfd1599e1f771dfadfe6035141f (diff) |
in fact, we don't need mir_hmac_sha1 either
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.h | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/oauth.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index 67cc001e43..5ffd8c2d0a 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -70,6 +70,10 @@ #include <m_folders.h>
#include <m_gui.h>
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+#pragma comment(lib, "libeay32.lib")
+
// libgadu headers
#include "libgadu.h"
#include "dynstuff.h"
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 400e7a5ed8..c43b111dba 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -186,7 +186,8 @@ int oauth_sign_request(LIST<OAUTHPARAMETER> ¶ms, const char *httpmethod, con mir_strcat(key, tsenc);
BYTE digest[MIR_SHA1_HASH_SIZE];
- mir_hmac_sha1(digest, (BYTE*)(char*)key, mir_strlen(key), (BYTE*)(char*)text, mir_strlen(text));
+ unsigned len = sizeof(digest);
+ HMAC(EVP_sha1(), key, (int)mir_strlen(key), (BYTE*)(char*)text, (int)mir_strlen(text), digest, &len);
sign = mir_base64_encode(digest, MIR_SHA1_HASH_SIZE);
}
else { // PLAINTEXT
|