chore: rename MainWindow::regenerateLocalFingerprints -> MainWindow::generateCertificate
This commit is contained in:
parent
6f10cd269e
commit
94eaa79768
2 changed files with 8 additions and 8 deletions
|
|
@ -150,19 +150,19 @@ MainWindow::MainWindow()
|
||||||
Settings::setValue(Settings::Security::KeySize, 2048);
|
Settings::setValue(Settings::Security::KeySize, 2048);
|
||||||
}
|
}
|
||||||
if (!TlsUtility::isCertValid()) {
|
if (!TlsUtility::isCertValid()) {
|
||||||
regenerateLocalFingerprints();
|
generateCertificate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QFile::exists(Settings::tlsLocalDb())) {
|
if (!QFile::exists(Settings::tlsLocalDb())) {
|
||||||
regenerateLocalFingerprints();
|
generateCertificate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FingerprintDatabase db;
|
FingerprintDatabase db;
|
||||||
db.read(Settings::tlsLocalDb());
|
db.read(Settings::tlsLocalDb());
|
||||||
if (db.fingerprints().isEmpty()) {
|
if (db.fingerprints().isEmpty()) {
|
||||||
regenerateLocalFingerprints();
|
generateCertificate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1181,7 +1181,7 @@ QString MainWindow::trustedFingerprintDatabase() const
|
||||||
return isClient ? Settings::tlsTrustedServersDb() : Settings::tlsTrustedClientsDb();
|
return isClient ? Settings::tlsTrustedServersDb() : Settings::tlsTrustedClientsDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::regenerateLocalFingerprints()
|
bool MainWindow::generateCertificate()
|
||||||
{
|
{
|
||||||
const auto certificate = Settings::value(Settings::Security::Certificate).toString();
|
const auto certificate = Settings::value(Settings::Security::Certificate).toString();
|
||||||
if (!QFile::exists(certificate) && !m_tlsUtility.generateCertificate()) {
|
if (!QFile::exists(certificate) && !m_tlsUtility.generateCertificate()) {
|
||||||
|
|
@ -1199,14 +1199,14 @@ bool MainWindow::regenerateLocalFingerprints()
|
||||||
Fingerprint MainWindow::localFingerprint()
|
Fingerprint MainWindow::localFingerprint()
|
||||||
{
|
{
|
||||||
if (!QFile::exists(Settings::tlsLocalDb())) {
|
if (!QFile::exists(Settings::tlsLocalDb())) {
|
||||||
if (regenerateLocalFingerprints())
|
if (generateCertificate())
|
||||||
return localFingerprint();
|
return localFingerprint();
|
||||||
}
|
}
|
||||||
|
|
||||||
FingerprintDatabase db;
|
FingerprintDatabase db;
|
||||||
db.read(Settings::tlsLocalDb());
|
db.read(Settings::tlsLocalDb());
|
||||||
if (db.fingerprints().isEmpty()) {
|
if (db.fingerprints().isEmpty()) {
|
||||||
if (regenerateLocalFingerprints())
|
if (generateCertificate())
|
||||||
return localFingerprint();
|
return localFingerprint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,10 +160,10 @@ private:
|
||||||
QString trustedFingerprintDatabase() const;
|
QString trustedFingerprintDatabase() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief regenerateLocalFingerprints Generate fingerprints if they are missing
|
* @brief generateCertificate Generate a new certificate
|
||||||
* @return true when successful
|
* @return true when successful
|
||||||
*/
|
*/
|
||||||
bool regenerateLocalFingerprints();
|
bool generateCertificate();
|
||||||
|
|
||||||
Fingerprint localFingerprint();
|
Fingerprint localFingerprint();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue