diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 87f31eb2..7d4a9a5e 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -444,6 +444,11 @@ void MainWindow::checkFingerprint(const QString& line) auto db_path = barrier::DataDirectories::trusted_servers_ssl_fingerprints_path(); + auto db_dir = db_path.parent_path(); + if (!barrier::fs::exists(db_dir)) { + barrier::fs::create_directories(db_dir); + } + // We compare only SHA256 fingerprints, but show both SHA1 and SHA256 so that the users can // still verify fingerprints on old Barrier servers. This way the only time when we are exposed // to SHA1 vulnerabilities is when the user is reconnecting again. diff --git a/src/gui/src/SslCertificate.cpp b/src/gui/src/SslCertificate.cpp index 26f3b3ee..65ac08a6 100644 --- a/src/gui/src/SslCertificate.cpp +++ b/src/gui/src/SslCertificate.cpp @@ -65,6 +65,11 @@ void SslCertificate::generate_fingerprint(const barrier::fs::path& cert_path) { try { auto local_path = barrier::DataDirectories::local_ssl_fingerprints_path(); + auto local_dir = local_path.parent_path(); + if (!barrier::fs::exists(local_dir)) { + barrier::fs::create_directories(local_dir); + } + barrier::FingerprintDatabase db; db.add_trusted(barrier::get_pem_file_cert_fingerprint(cert_path.u8string(), barrier::FingerprintType::SHA1));