From 9da83b6f98ec43aa93ef883e9884cc1a8246b0ce Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 19 Mar 2016 17:30:10 +0000 Subject: SkyLogin must be used only if OpenSSL is present git-svn-id: http://svn.miranda-ng.org/main/trunk@16513 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/msn.vcxproj | 3 ++- protocols/MSN/src/msn.cpp | 7 ++++++- protocols/MSN/src/msn_auth.cpp | 7 +++++-- protocols/MSN/src/stdafx.h | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/MSN/msn.vcxproj b/protocols/MSN/msn.vcxproj index 603d726bdc..bca665bcf8 100644 --- a/protocols/MSN/msn.vcxproj +++ b/protocols/MSN/msn.vcxproj @@ -30,7 +30,8 @@ Sync - libeay32.lib;%(AdditionalDependencies) + libeay32.dll + delayimp.lib;libeay32.lib;%(AdditionalDependencies) diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index 82054a4464..37b288cbf5 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -25,7 +25,7 @@ along with this program. If not, see . #include "version.h" CLIST_INTERFACE *pcli; -HINSTANCE g_hInst; +HINSTANCE g_hInst, g_hOpenssl; int hLangpack; ///////////////////////////////////////////////////////////////////////////////////////// @@ -105,6 +105,8 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo); mir_getCLI(); + g_hOpenssl = LoadLibraryA("libeay32.dll"); + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); PROTOCOLDESCRIPTOR pd = { 0 }; @@ -123,6 +125,9 @@ extern "C" int __declspec(dllexport) Load(void) // Unload a plugin extern "C" int __declspec(dllexport) Unload(void) { + if (g_hOpenssl) + FreeLibrary(g_hOpenssl); + MSN_RemoveContactMenus(); MsnLinks_Destroy(); return 0; diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 3e05906b30..9bac895468 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -499,8 +499,7 @@ int CMsnProto::MSN_GetPassportAuth(void) } } } - else - setString("MsnPassportHost", szPassportHost); + else setString("MsnPassportHost", szPassportHost); mir_free(szPassportHost); debugLogA("MSN_CheckRedirector exited with errorCode = %d", retVal); @@ -654,6 +653,8 @@ CMStringA CMsnProto::HotmailLogin(const char* url) int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC) { int iRet = -1; + if (g_hOpenssl == NULL) + return iRet; // Perform login SkyLogin hLogin = SkyLogin_Init(); @@ -685,6 +686,8 @@ int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC) int CMsnProto::LoginSkypeOAuth(const char *pRefreshToken) { int iRet = -1; + if (g_hOpenssl == NULL) + return iRet; // Perform login SkyLogin hLogin = SkyLogin_Init(); diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index b127c2cd39..4c01648788 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -934,7 +934,7 @@ const char msnStoreAppId[] = "Skype"; const char msnProductVer[] = "0/6.16.0.105/259/"; const char msnProtID[] = "MSNP24"; -extern HINSTANCE g_hInst; +extern HINSTANCE g_hInst, g_hOpenssl; extern bool g_bTerminated; /////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3