Merge pull request #7080 from symless/SYNERGY-1057-Client-can-not-read-trusted-fingerprints

SYNERGY-1057 Add trace if the system can't open file with trusted fingerprints
This commit is contained in:
Andrey Batyiev 2021-08-30 09:58:25 +03:00 committed by GitHub
commit 8d5406489b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -4,6 +4,7 @@ Bug fixes:
- #7070 Fix radio button shifted focus on macOS - #7070 Fix radio button shifted focus on macOS
- #7078 Fix clipboard re-enables automatically - #7078 Fix clipboard re-enables automatically
- #7077 Fix Ubuntu, CentOS and Debian build after SYNERGY-1161 - #7077 Fix Ubuntu, CentOS and Debian build after SYNERGY-1161
- #7080 Add trace if the system can't open file with trusted fingerprints
Enhancements: Enhancements:
- #7068 Add Synergy restart when settings changed - #7068 Add Synergy restart when settings changed

View file

@ -709,15 +709,18 @@ SecureSocket::verifyCertFingerprint()
file.open(trustedServersFilename.c_str()); file.open(trustedServersFilename.c_str());
bool isValid = false; bool isValid = false;
while (!file.eof() && file.is_open()) { if (file.is_open()) {
getline(file,fileLine); while (!file.eof()) {
if (!fileLine.empty()) { getline(file,fileLine);
if (fileLine.compare(fingerprint) == 0) { if (!fileLine.empty() && !fileLine.compare(fingerprint)) {
isValid = true; isValid = true;
break; break;
} }
} }
} }
else {
LOG((CLOG_ERR "Fail to open trusted fingerprints file: %s", trustedServersFilename.c_str()));
}
file.close(); file.close();
return isValid; return isValid;