From d5497c31057d567d4ff8972cda83cd48226ec8b9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 24 Jun 2019 14:23:08 +0200 Subject: [PATCH] Version 1.7.10: Don't load OpenSSL config on Win. --- .../SourceFiles/platform/win/specific_win.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index a00a4297b..8af6bf1b9 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -27,6 +27,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include +#include +#include #include #include @@ -278,11 +280,20 @@ int psFixPrevious() { namespace Platform { namespace ThirdParty { +namespace { + +void StartOpenSSL() { + // Don't use dynamic OpenSSL config, it can load unwanted DLLs. + OPENSSL_load_builtin_modules(); + ENGINE_load_builtin_engines(); + ERR_clear_error(); + OPENSSL_no_config(); +} + +} // namespace void start() { - // Force OpenSSL skipping the config by passing an invalid filename. - qputenv("OPENSSL_CONF", ":/:"); - OPENSSL_config(nullptr); + StartOpenSSL(); } } // namespace ThirdParty