summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-03-19 17:30:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-03-19 17:30:10 +0000
commit9da83b6f98ec43aa93ef883e9884cc1a8246b0ce (patch)
treef6771ebf24289be37ae2caa1e37a42394378501e /protocols
parent71a50ce4a1a39766414993da9310675fae5bb6fa (diff)
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
Diffstat (limited to 'protocols')
-rw-r--r--protocols/MSN/msn.vcxproj3
-rw-r--r--protocols/MSN/src/msn.cpp7
-rw-r--r--protocols/MSN/src/msn_auth.cpp7
-rw-r--r--protocols/MSN/src/stdafx.h2
4 files changed, 14 insertions, 5 deletions
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 @@
<ExceptionHandling>Sync</ExceptionHandling>
</ClCompile>
<Link>
- <AdditionalDependencies>libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <DelayLoadDLLs>libeay32.dll</DelayLoadDLLs>
+ <AdditionalDependencies>delayimp.lib;libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
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 <http://www.gnu.org/licenses/>.
#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;
///////////////////////////////////////////////////////////////////////////////