Skip to content

Commit eb19547

Browse files
sithlord48nbolton
authored andcommitted
refactor: mainwindow force regen of local prints if tls is enabled with a sha256 key
1 parent 65eed64 commit eb19547

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/apps/deskflow-gui/MainWindow.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,21 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
154154
qDebug().noquote() << "active settings path:" << m_configScopes.activeFilePath();
155155

156156
updateSize();
157+
158+
// Force generation of SHA256 for the localhost
159+
if (m_appConfig.tlsEnabled()) {
160+
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename).toStdString();
161+
if (!QFile::exists(QString::fromStdString(localPath))) {
162+
regenerateLocalFingerprints();
163+
return;
164+
}
165+
166+
deskflow::FingerprintDatabase db;
167+
db.read(localPath);
168+
if (db.fingerprints().size() != 2) {
169+
regenerateLocalFingerprints();
170+
}
171+
}
157172
}
158173

159174
MainWindow::~MainWindow()

0 commit comments

Comments
 (0)