14#ifndef OPENVPN_SSL_KUPARSE_H
15#define OPENVPN_SSL_KUPARSE_H
46 eku =
"TLS Web Server Authentication";
53 eku =
"TLS Web Client Authentication";
64 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-tls must be 'client' or 'server'");
68 std::vector<unsigned int> &ku,
75 const std::string &relay_prefix,
76 std::vector<unsigned int> &ku,
80 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-tls");
90 const std::string &relay_prefix,
91 std::vector<unsigned int> &ku)
95 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-ku");
99 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: no hex values specified");
101 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: too many parameters");
105 for (
size_t i = 1; i < o->
size(); ++i)
106 ku.push_back(parse_hex_number<unsigned int>(o->
get(i, 16)));
108 catch (parse_hex_error &)
110 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: error parsing hex value list");
116 const std::string &relay_prefix,
121 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-eku");
123 eku = o->
get(1, 256);
const Option * get_ptr(const std::string &name) const
std::string get_optional(const size_t index, const size_t max_len) const
const std::string & get(const size_t index, const size_t max_len) const
void remote_cert_ku(const OptionList &opt, const std::string &relay_prefix, std::vector< unsigned int > &ku)
TLSWebType remote_cert_type(const std::string &ct)
void remote_cert_tls(const TLSWebType wt, std::vector< unsigned int > &ku, std::string &eku)
void remote_cert_eku(const OptionList &opt, const std::string &relay_prefix, std::string &eku)