14#ifndef OPENVPN_SSL_KUPARSE_H
15#define OPENVPN_SSL_KUPARSE_H
46 eku =
"TLS Web Server Authentication";
53 eku =
"TLS Web Client Authentication";
62 else if (ct ==
"client")
65 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-tls must be 'client' or 'server'");
69 std::vector<unsigned int> &ku,
76 const std::string &relay_prefix,
77 std::vector<unsigned int> &ku,
81 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-tls");
91 const std::string &relay_prefix,
92 std::vector<unsigned int> &ku)
96 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-ku");
100 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: no hex values specified");
101 else if (o->
size() >= 64)
102 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: too many parameters");
107 for (
size_t i = 1; i < o->
size(); ++i)
108 ku.push_back(parse_hex_number<unsigned int>(o->
get(i, 16)));
110 catch (parse_hex_error &)
112 throw option_error(ERR_INVALID_OPTION_CRYPTO,
"remote-cert-ku: error parsing hex value list");
119 const std::string &relay_prefix,
124 const Option *o = opt.
get_ptr(relay_prefix +
"remote-cert-eku");
126 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)