From 5f71b47b5a0acc5108b70bf2679a202ff15ff5f0 Mon Sep 17 00:00:00 2001 From: Dayne Broderson Date: Wed, 19 Dec 2018 20:36:57 -0900 Subject: [PATCH] add debug notes to help identify where trusted fingerprints file is --- src/lib/net/SecureSocket.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp index 6670f5f2..8efe0751 100644 --- a/src/lib/net/SecureSocket.cpp +++ b/src/lib/net/SecureSocket.cpp @@ -704,18 +704,30 @@ SecureSocket::verifyCertFingerprint() kFingerprintDirName, kFingerprintTrustedServersFilename); + // Provide debug hint as to what file is being used to verify fingerprint trust + LOG((CLOG_NOTE "trustedServersFilename: %s", trustedServersFilename.c_str() )); + // check if this fingerprint exist String fileLine; std::ifstream file; file.open(trustedServersFilename.c_str()); + if ( ! file.is_open() ) { + LOG((CLOG_NOTE "Unable to open trustedServersFile: %s", trustedServersFilename.c_str() )); + } else { + LOG((CLOG_NOTE "Opened trustedServersFilename: %s", trustedServersFilename.c_str() )); + } + bool isValid = false; while (!file.eof() && file.is_open()) { getline(file,fileLine); if (!fileLine.empty()) { if (fileLine.compare(fingerprint) == 0) { + LOG((CLOG_NOTE "Fingerprint matchs trusted fingerprint")); isValid = true; break; + } else { + LOG((CLOG_NOTE "Fingerprint does not match trusted fingerprint")); } } }