vici: Add support for certificate policies
This commit is contained in:
@@ -1141,6 +1141,22 @@ CALLBACK(parse_group, bool,
|
|||||||
return parse_id(cfg, AUTH_RULE_GROUP, v);
|
return parse_id(cfg, AUTH_RULE_GROUP, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse certificate policy
|
||||||
|
*/
|
||||||
|
CALLBACK(parse_cert_policy, bool,
|
||||||
|
auth_cfg_t *cfg, chunk_t v)
|
||||||
|
{
|
||||||
|
char buf[BUF_LEN];
|
||||||
|
|
||||||
|
if (!vici_stringify(v, buf, sizeof(buf)))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
cfg->add(cfg, AUTH_RULE_CERT_POLICY, strdup(buf));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a certificate; add as auth rule to config
|
* Parse a certificate; add as auth rule to config
|
||||||
*/
|
*/
|
||||||
@@ -1402,6 +1418,7 @@ CALLBACK(auth_li, bool,
|
|||||||
{
|
{
|
||||||
parse_rule_t rules[] = {
|
parse_rule_t rules[] = {
|
||||||
{ "groups", parse_group, auth->cfg },
|
{ "groups", parse_group, auth->cfg },
|
||||||
|
{ "cert_policy", parse_cert_policy, auth },
|
||||||
{ "certs", parse_certs, auth },
|
{ "certs", parse_certs, auth },
|
||||||
{ "cacerts", parse_cacerts, auth },
|
{ "cacerts", parse_cacerts, auth },
|
||||||
{ "pubkeys", parse_pubkeys, auth },
|
{ "pubkeys", parse_pubkeys, auth },
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ static bool is_list_key(char *key)
|
|||||||
"vips",
|
"vips",
|
||||||
"pools",
|
"pools",
|
||||||
"groups",
|
"groups",
|
||||||
|
"cert_policy",
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -406,6 +406,12 @@ connections.<conn>.remote<suffix>.groups =
|
|||||||
can be certified by different means, for example by appropriate Attribute
|
can be certified by different means, for example by appropriate Attribute
|
||||||
Certificates or by an AAA backend involved in the authentication.
|
Certificates or by an AAA backend involved in the authentication.
|
||||||
|
|
||||||
|
connections.<conn>.remote<suffix>.cert_policy =
|
||||||
|
Certificate policy OIDs the peer's certificate must have.
|
||||||
|
|
||||||
|
Comma separated list of certificate policy OIDs the peer's certificate must
|
||||||
|
have. OIDs are specified using the numerical dotted representation.
|
||||||
|
|
||||||
connections.<conn>.remote<suffix>.certs =
|
connections.<conn>.remote<suffix>.certs =
|
||||||
Comma separated list of certificate to accept for authentication.
|
Comma separated list of certificate to accept for authentication.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user