From 5a57e4a7a673d14ea94d93e47262d619dad8d50f Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Fri, 5 Aug 2016 12:36:21 +0200 Subject: [PATCH] Ensure OpenSSL config file is only read from app dir --- src/cmd/cmd.cpp | 6 ++++++ src/gui/application.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 9fe32aa94..03c04beab 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -272,6 +272,12 @@ void selectiveSyncFixup(OCC::SyncJournalDb *journal, const QStringList &newList) int main(int argc, char **argv) { QCoreApplication app(argc, argv); +#ifdef Q_OS_WIN + // Ensure OpenSSL config file is only loaded from app directory + QString opensslConf = QCoreApplication::applicationDirPath()+QString("/openssl.cnf"); + qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit()); +#endif + qsrand(QTime::currentTime().msec() * QCoreApplication::applicationPid()); CmdOptions options; diff --git a/src/gui/application.cpp b/src/gui/application.cpp index aaa2ca6be..f37296608 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -105,6 +105,12 @@ Application::Application(int &argc, char **argv) : { _startedAt.start(); +#ifdef Q_OS_WIN + // Ensure OpenSSL config file is only loaded from app directory + QString opensslConf = QCoreApplication::applicationDirPath()+QString("/openssl.cnf"); + qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit()); +#endif + // TODO: Can't set this without breaking current config paths // setOrganizationName(QLatin1String(APPLICATION_VENDOR)); setOrganizationDomain(QLatin1String(APPLICATION_REV_DOMAIN)); -- 2.30.2