lib/net: Put secure utils into barrier namespace

This commit is contained in:
Povilas Kanapickas 2021-11-01 02:52:35 +02:00
parent a9b30951ce
commit b793675ef8
3 changed files with 9 additions and 1 deletions

View File

@ -675,7 +675,7 @@ SecureSocket::verifyCertFingerprint()
// format fingerprint into hexdecimal format with colon separator // format fingerprint into hexdecimal format with colon separator
std::string fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen); std::string fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen);
fingerprint = format_ssl_fingerprint(fingerprint); fingerprint = barrier::format_ssl_fingerprint(fingerprint);
LOG((CLOG_NOTE "server fingerprint: %s", fingerprint.c_str())); LOG((CLOG_NOTE "server fingerprint: %s", fingerprint.c_str()));
std::string trustedServersFilename; std::string trustedServersFilename;

View File

@ -18,6 +18,8 @@
#include "SecureUtils.h" #include "SecureUtils.h"
#include "base/String.h" #include "base/String.h"
namespace barrier {
std::string format_ssl_fingerprint(const std::string& fingerprint, bool hex, bool separator) std::string format_ssl_fingerprint(const std::string& fingerprint, bool hex, bool separator)
{ {
std::string result = fingerprint; std::string result = fingerprint;
@ -38,3 +40,5 @@ std::string format_ssl_fingerprint(const std::string& fingerprint, bool hex, boo
} }
return result; return result;
} }
} // namespace barrier

View File

@ -20,7 +20,11 @@
#include <string> #include <string>
namespace barrier {
std::string format_ssl_fingerprint(const std::string& fingerprint, std::string format_ssl_fingerprint(const std::string& fingerprint,
bool hex = true, bool separator = true); bool hex = true, bool separator = true);
} // namespace barrier
#endif // BARRIER_LIB_NET_SECUREUTILS_H #endif // BARRIER_LIB_NET_SECUREUTILS_H