SYNERGY-1057 Add trace if the system can't open file with trusted fingerprints

This commit is contained in:
Serhii Hadzhilov 2021-08-27 15:18:09 +03:00
parent 7b2026e376
commit c5faa8de24

View file

@ -709,15 +709,20 @@ 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()) {
isValid = true; if (fileLine.compare(fingerprint) == 0) {
break; isValid = true;
break;
}
} }
} }
} }
else {
LOG((CLOG_ERR "Fail to open trusted fingerprints file: %s", trustedServersFilename.c_str()));
}
file.close(); file.close();
return isValid; return isValid;