Always log out server fingerprint #4522
This commit is contained in:
parent
52d9b1beed
commit
e405ec25e3
|
@ -461,29 +461,27 @@ SecureSocket::verifyCertFingerprint()
|
||||||
// format fingerprint into hexdecimal format with colon separator
|
// format fingerprint into hexdecimal format with colon separator
|
||||||
String fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen);
|
String fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen);
|
||||||
formatFingerprint(fingerprint);
|
formatFingerprint(fingerprint);
|
||||||
|
LOG((CLOG_NOTE "server fingerprint: %s", fingerprint.c_str()));
|
||||||
|
|
||||||
// check if this fingerprint exist
|
// check if this fingerprint exist
|
||||||
String fileLine;
|
String fileLine;
|
||||||
std::ifstream file;
|
std::ifstream file;
|
||||||
file.open(m_certFingerprintFilename.c_str());
|
file.open(m_certFingerprintFilename.c_str());
|
||||||
|
|
||||||
|
bool isValid = false;
|
||||||
while (!file.eof()) {
|
while (!file.eof()) {
|
||||||
getline(file,fileLine);
|
getline(file,fileLine);
|
||||||
// example of a fingerprint:A1:B2:C3
|
// example of a fingerprint:A1:B2:C3
|
||||||
if (!fileLine.empty()) {
|
if (!fileLine.empty()) {
|
||||||
if (fileLine.compare(fingerprint) == 0) {
|
if (fileLine.compare(fingerprint) == 0) {
|
||||||
file.close();
|
isValid = true;
|
||||||
return true;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
return isValid;
|
||||||
LOG((CLOG_NOTE "new fingerprint from a server"));
|
|
||||||
LOG((CLOG_NOTE "server fingerprint: %s", fingerprint.c_str()));
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ISocketMultiplexerJob*
|
ISocketMultiplexerJob*
|
||||||
|
|
Loading…
Reference in New Issue