SYNERGY-1057 Add trace if the system can't open file with trusted fingerprints
This commit is contained in:
parent
7b2026e376
commit
c5faa8de24
1 changed files with 11 additions and 6 deletions
|
|
@ -709,15 +709,20 @@ SecureSocket::verifyCertFingerprint()
|
|||
file.open(trustedServersFilename.c_str());
|
||||
|
||||
bool isValid = false;
|
||||
while (!file.eof() && file.is_open()) {
|
||||
getline(file,fileLine);
|
||||
if (!fileLine.empty()) {
|
||||
if (fileLine.compare(fingerprint) == 0) {
|
||||
isValid = true;
|
||||
break;
|
||||
if (file.is_open()) {
|
||||
while (!file.eof()) {
|
||||
getline(file,fileLine);
|
||||
if (!fileLine.empty()) {
|
||||
if (fileLine.compare(fingerprint) == 0) {
|
||||
isValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG((CLOG_ERR "Fail to open trusted fingerprints file: %s", trustedServersFilename.c_str()));
|
||||
}
|
||||
|
||||
file.close();
|
||||
return isValid;
|
||||
|
|
|
|||
Loading…
Reference in a new issue