Skip to content

fix: local-fingerprint generation - #8408

Merged
sithlord48 merged 1 commit into
masterfrom
fix-localGen
Mar 28, 2025
Merged

fix: local-fingerprint generation#8408
sithlord48 merged 1 commit into
masterfrom
fix-localGen

Conversation

@sithlord48

Copy link
Copy Markdown
Member
  • tls/local-fingerprints path was not correct fixed that to generate the file correctly

@sithlord48 sithlord48 added the bug label Mar 28, 2025
@sithlord48 sithlord48 added this to the v1.22.0 milestone Mar 28, 2025
@sithlord48
sithlord48 requested a review from nbolton March 28, 2025 01:49
@nbolton

nbolton commented Mar 28, 2025

Copy link
Copy Markdown
Member

Ah, oops, yeah I see the bug on master:
[2025-03-28T11:07:09] DEBUG: writing tls fingerprint to: "/home/nick/.config/Deskflow/tls/local-fingerprint/%2"

@sithlord48

Copy link
Copy Markdown
Member Author

Ah, oops, yeah I see the bug on master: [2025-03-28T11:07:09] DEBUG: writing tls fingerprint to: "/home/nick/.config/Deskflow/tls/local-fingerprint/%2"

this is what it fixes.

@nbolton

nbolton commented Mar 28, 2025

Copy link
Copy Markdown
Member

Ah, oops, yeah I see the bug on master: [2025-03-28T11:07:09] DEBUG: writing tls fingerprint to: "/home/nick/.config/Deskflow/tls/local-fingerprint/%2"

this is what it fixes.

I know :)

Simply documenting the bug for posterity since you didn't link it to a bug report.

I noticed that the fingerprint is generated twice. That seems unintentional and an indication of flawed logic.

Edit: It's already in master, of course, so we should fix it as a separate PR.

[2025-03-28T11:10:51] DEBUG: generating tls certificate, all clients must trust the new fingerprint
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsUtility.cpp:27
[2025-03-28T11:10:51] DEBUG: generating tls certificate: /home/nick/.config/Deskflow/tls/deskflow.pem
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsCertificate.cpp:31
[2025-03-28T11:10:51] DEBUG: tls certificate generated
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsCertificate.cpp:46
[2025-03-28T11:10:51] DEBUG: generating tls fingerprint
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsCertificate.cpp:52
[2025-03-28T11:10:51] DEBUG: tls fingerprint generated: /home/nick/.config/Deskflow/tls/local-fingerprint
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsCertificate.cpp:61
[2025-03-28T11:10:51] DEBUG: generating tls fingerprint
	/home/nick/Projects/deskflow/src/lib/gui/tls/TlsCertificate.cpp:52
[2025-03-28T11:10:51] DEBUG: tls fingerprint generated: /home/nick/.config/Deskflow/tls/local-fingerprint

FYI I changed the code on my local branch a bit to improve the debug logging, up to you if you want to use it:

diff --git a/src/lib/gui/tls/TlsCertificate.cpp b/src/lib/gui/tls/TlsCertificate.cpp
index 1fa0b4fa5..2113f468a 100644
--- a/src/lib/gui/tls/TlsCertificate.cpp
+++ b/src/lib/gui/tls/TlsCertificate.cpp
@@ -55,9 +55,10 @@ bool TlsCertificate::generateFingerprint(const QString &certificateFilename)
     deskflow::FingerprintDatabase db;
     db.addTrusted(deskflow::pemFileCertFingerprint(certPath, deskflow::FingerprintType::SHA1));
     db.addTrusted(deskflow::pemFileCertFingerprint(certPath, deskflow::FingerprintType::SHA256));
-    db.write(Settings::tlsLocalDb().toStdString());
 
-    qDebug("tls fingerprint generated");
+    const auto path = Settings::tlsLocalDb();
+    db.write(path.toStdString());
+    qDebug().noquote() << "tls fingerprint generated:" << path;
     return true;
   } catch (const std::exception &e) {
     qCritical() << "failed to find tls fingerprint: " << e.what();

nbolton
nbolton approved these changes Mar 28, 2025
@sithlord48
sithlord48 merged commit a6453a6 into master Mar 28, 2025
@sithlord48
sithlord48 deleted the fix-localGen branch March 28, 2025 11:49
@sithlord48 sithlord48 modified the milestones: v1.22.0, v1.21.1 Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants