diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-08 22:56:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-08 22:56:11 +0300 |
commit | 3ec716dc906a43d155ab6222856c5a606f491bc8 (patch) | |
tree | a8b304c095d1a6379d1ca704f23a8cdef5af52e8 /src | |
parent | fed9983880d41c33892e645d40fe48de69b1e9d4 (diff) |
OpenSSL upgraded to 1.1.1
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/mir_app.vcxproj | 3 | ||||
-rw-r--r-- | src/mir_app/mir_app.vcxproj.filters | 3 | ||||
-rw-r--r-- | src/mir_app/src/miranda.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/openssl.cpp | 67 | ||||
-rw-r--r-- | src/mir_app/src/openssl.h | 30 |
5 files changed, 1 insertions, 106 deletions
diff --git a/src/mir_app/mir_app.vcxproj b/src/mir_app/mir_app.vcxproj index 224fc3f656..8658ff5b87 100644 --- a/src/mir_app/mir_app.vcxproj +++ b/src/mir_app/mir_app.vcxproj @@ -125,7 +125,6 @@ <ClCompile Include="src\netlib_upnp.cpp" />
<ClCompile Include="src\netlib_websocket.cpp" />
<ClCompile Include="src\newplugins.cpp" />
- <ClCompile Include="src\openssl.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\path.cpp" />
<ClCompile Include="src\pluginopts.cpp" />
@@ -188,7 +187,7 @@ <ModuleDefinitionFile Condition="'$(Platform)'=='x64'">src/mir_app64.def</ModuleDefinitionFile>
<AdditionalOptions>/ignore:4197 %(AdditionalOptions)</AdditionalOptions>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27amd64%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
- <AdditionalDependencies>libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>libcrypto.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<AdditionalManifestFiles>res/miranda32.exe.manifest</AdditionalManifestFiles>
diff --git a/src/mir_app/mir_app.vcxproj.filters b/src/mir_app/mir_app.vcxproj.filters index e47a9bfbae..1db664ca70 100644 --- a/src/mir_app/mir_app.vcxproj.filters +++ b/src/mir_app/mir_app.vcxproj.filters @@ -296,9 +296,6 @@ <ClCompile Include="src\newplugins.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\openssl.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 17d415d8e5..5ebd3a1d92 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
-#include "openssl.h"
#if defined(VLD_ENABLED)
#include "msapi\vld.h"
@@ -339,8 +338,6 @@ int WINAPI mir_main(LPTSTR cmdLine) if (IsWinVer7Plus())
CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
- OpenSSL_Init();
-
g_pSystemWindow = new MSystemWindow();
g_pSystemWindow->Create();
@@ -425,7 +422,6 @@ int WINAPI mir_main(LPTSTR cmdLine) delete g_pSystemWindow;
- OpenSSL_Cleanup();
OleUninitialize();
if (bufferedPaintUninit)
diff --git a/src/mir_app/src/openssl.cpp b/src/mir_app/src/openssl.cpp deleted file mode 100644 index 144e3df169..0000000000 --- a/src/mir_app/src/openssl.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (C) 2012-20 Miranda NG team (https://miranda-ng.org), -Copyright (c) 2000-12 Miranda IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "stdafx.h" -#include "openssl.h" - - -static HANDLE *mutexes; - -unsigned long OpenSSL_thread_id() -{ - return static_cast<unsigned long>(GetCurrentThreadId()); -} - -void OpenSSL_lock(int mode, int n, const char *, int) -{ - if (mode & CRYPTO_LOCK) { - WaitForSingleObject(mutexes[n], INFINITE); - } else { - ReleaseMutex(mutexes[n]); - } -} - -void OpenSSL_Init() { - int num_locks = CRYPTO_num_locks(); - - mutexes = new HANDLE[num_locks]; - - for (int i = 0; i < num_locks; ++i) { - mutexes[i] = CreateMutex(nullptr, FALSE, nullptr); - } - - CRYPTO_set_id_callback(OpenSSL_thread_id); - CRYPTO_set_locking_callback(OpenSSL_lock); -} - -void OpenSSL_Cleanup(){ - CRYPTO_set_id_callback(nullptr); - CRYPTO_set_locking_callback(nullptr); - - for (int i = 0; i < CRYPTO_num_locks(); ++i) { - CloseHandle(mutexes[i]); - } - - delete[] mutexes; -}
\ No newline at end of file diff --git a/src/mir_app/src/openssl.h b/src/mir_app/src/openssl.h deleted file mode 100644 index 8a2a493ab1..0000000000 --- a/src/mir_app/src/openssl.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (C) 2012-20 Miranda NG team (https://miranda-ng.org), -Copyright (c) 2000-12 Miranda IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#pragma once - -#include <openssl/err.h> - -void OpenSSL_Init(); -void OpenSSL_Cleanup(); |