14#ifndef OPENVPN_SSL_TLS_REMOTE_H
15#define OPENVPN_SSL_TLS_REMOTE_H
23inline bool test(
const std::string &tls_remote,
const std::string &subject,
const std::string &common_name)
28inline void log(
const std::string &tls_remote,
const std::string &subject,
const std::string &common_name)
32 <<
" tls-remote: '" << tls_remote <<
'\'' << std::endl
33 <<
" Subj: '" << subject <<
'\'' << std::endl
34 <<
" CN: '" << common_name <<
'\'');
42 bool leading_dash =
true;
44 for (
size_t i = 0; i <
str.length(); ++i)
46 const char c =
str[i];
47 if (c ==
'-' && leading_dash)
53 if ((c >=
'a' && c <=
'z')
54 || (c >=
'A' && c <=
'Z')
55 || (c >=
'0' && c <=
'9')
56 || c ==
'_' || c ==
'-' || c ==
'.'
57 || c ==
'@' || c ==
':' || c ==
'/'
72 for (
size_t i = 0; i <
str.length(); ++i)
74 const char c =
str[i];
75 if ((c >=
'a' && c <=
'z')
76 || (c >=
'A' && c <=
'Z')
77 || (c >=
'0' && c <=
'9')
78 || c ==
'_' || c ==
'-' || c ==
'.'
79 || c ==
'@' || c ==
'/')
#define OPENVPN_LOG(args)
std::string sanitize_x509_name(const std::string &str)
std::string sanitize_common_name(const std::string &str)
void log(const std::string &tls_remote, const std::string &subject, const std::string &common_name)
bool starts_with(const STRING &str, const std::string &prefix)
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'