refactor: mainwindow force regen of local prints if tls is enabled with a sha256 key

This commit is contained in:
sithlord48 2025-02-11 10:17:55 -05:00 committed by Nick Bolton
parent 65eed64f04
commit eb19547b45

View file

@ -154,6 +154,21 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
qDebug().noquote() << "active settings path:" << m_configScopes.activeFilePath();
updateSize();
// Force generation of SHA256 for the localhost
if (m_appConfig.tlsEnabled()) {
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename).toStdString();
if (!QFile::exists(QString::fromStdString(localPath))) {
regenerateLocalFingerprints();
return;
}
deskflow::FingerprintDatabase db;
db.read(localPath);
if (db.fingerprints().size() != 2) {
regenerateLocalFingerprints();
}
}
}
MainWindow::~MainWindow()