From aa9504f43edbf955b673c6e95f6be16f750052f3 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 20 Apr 2015 16:40:50 +0100 Subject: [PATCH] Changed filenames in app data directory #4525 - Changed `ssl` to `SSL` - Moved pem file to `SSL` --- src/gui/src/Fingerprint.cpp | 8 ++++---- src/gui/src/PluginManager.cpp | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/gui/src/Fingerprint.cpp b/src/gui/src/Fingerprint.cpp index 6412dcea..b2816684 100644 --- a/src/gui/src/Fingerprint.cpp +++ b/src/gui/src/Fingerprint.cpp @@ -22,10 +22,10 @@ #include #include -static const char kDirName[] = "ssl/fingerprints"; -static const char kLocalFilename[] = "local.txt"; -static const char kTrustedServersFilename[] = "trusted-servers.txt"; -static const char kTrustedClientsFilename[] = "trusted-clients.txt"; +static const char kDirName[] = "SSL/Fingerprints"; +static const char kLocalFilename[] = "Local.txt"; +static const char kTrustedServersFilename[] = "TrustedServers.txt"; +static const char kTrustedClientsFilename[] = "TrustedClients.txt"; Fingerprint::Fingerprint(const QString& filename) { diff --git a/src/gui/src/PluginManager.cpp b/src/gui/src/PluginManager.cpp index 8781fe7c..f3883be7 100644 --- a/src/gui/src/PluginManager.cpp +++ b/src/gui/src/PluginManager.cpp @@ -40,6 +40,7 @@ static const char kLinuxProcessorArchRpm64[] = "Linux-x86_64-rpm"; static QString kCertificateLifetime = "365"; static QString kCertificateSubjectInfo = "/CN=Synergy"; static QString kCertificateFilename = "Synergy.pem"; +static QString kSslDir = "SSL"; static QString kUnixOpenSslCommand = "openssl"; #if defined(Q_OS_WIN) @@ -151,10 +152,23 @@ void PluginManager::generateCertificate() arguments.append("-newkey"); arguments.append("rsa:1024"); + QString sslDirPath = QString("%1%2%3") + .arg(m_ProfileDir) + .arg(QDir::separator()) + .arg(kSslDir); + + QDir sslDir(sslDirPath); + if (!sslDir.exists()) { + sslDir.mkdir("."); + } + + QString filename = QString("%1%2%3") + .arg(sslDirPath) + .arg(QDir::separator()) + .arg(kCertificateFilename); + // key output filename arguments.append("-keyout"); - QString filename = m_ProfileDir; - filename.append(QDir::separator()).append(kCertificateFilename); arguments.append(filename); // certificate output filename