refactor: add ssl consts into common/constansts
This commit is contained in:
parent
e257501072
commit
298b1047c4
3 changed files with 7 additions and 9 deletions
|
|
@ -25,3 +25,8 @@ const auto kDebugBuild = true;
|
||||||
#else
|
#else
|
||||||
const auto kDebugBuild = false;
|
const auto kDebugBuild = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
const auto kSslDir = "tls";
|
||||||
|
const auto kCertificateFilename = "@CMAKE_PROJECT_NAME@.pem";
|
||||||
|
const auto kFingerprintTrustedServersFilename = "trusted-servers";
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,6 @@
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
// TODO: Reduce duplication of these strings between here and SecureSocket.cpp
|
|
||||||
const auto kCertificateFilename = QStringLiteral("%1.pem").arg(kAppId);
|
|
||||||
const auto kSslDir = "tls";
|
|
||||||
|
|
||||||
namespace deskflow::gui::paths {
|
namespace deskflow::gui::paths {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "base/Path.h"
|
#include "base/Path.h"
|
||||||
#include "base/String.h"
|
#include "base/String.h"
|
||||||
#include "base/TMethodEventJob.h"
|
#include "base/TMethodEventJob.h"
|
||||||
|
#include "common/constants.h"
|
||||||
#include "mt/Lock.h"
|
#include "mt/Lock.h"
|
||||||
#include "net/TCPSocket.h"
|
#include "net/TCPSocket.h"
|
||||||
#include "net/TSocketMultiplexerMethodJob.h"
|
#include "net/TSocketMultiplexerMethodJob.h"
|
||||||
|
|
@ -42,10 +43,6 @@ enum
|
||||||
kMsgSize = 128
|
kMsgSize = 128
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Reduce duplication of these strings between here and TlsFingerprint.cpp
|
|
||||||
static const char kFingerprintDirName[] = "tls";
|
|
||||||
static const char kFingerprintTrustedServersFilename[] = "trusted-servers";
|
|
||||||
|
|
||||||
struct Ssl
|
struct Ssl
|
||||||
{
|
{
|
||||||
SSL_CTX *m_context;
|
SSL_CTX *m_context;
|
||||||
|
|
@ -629,7 +626,7 @@ bool SecureSocket::verifyCertFingerprint()
|
||||||
|
|
||||||
std::string trustedServersFilename;
|
std::string trustedServersFilename;
|
||||||
trustedServersFilename = deskflow::string::sprintf(
|
trustedServersFilename = deskflow::string::sprintf(
|
||||||
"%s/%s/%s", ARCH->getProfileDirectory().c_str(), kFingerprintDirName, kFingerprintTrustedServersFilename
|
"%s/%s/%s", ARCH->getProfileDirectory().c_str(), kSslDir, kFingerprintTrustedServersFilename
|
||||||
);
|
);
|
||||||
|
|
||||||
// check if this fingerprint exist
|
// check if this fingerprint exist
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue