contains_wildcard() for DNs uses RDN enumerator
This commit is contained in:
@@ -795,30 +795,22 @@ static id_type_t get_type(private_identification_t *this)
|
|||||||
*/
|
*/
|
||||||
static bool contains_wildcards_dn(private_identification_t *this)
|
static bool contains_wildcards_dn(private_identification_t *this)
|
||||||
{
|
{
|
||||||
chunk_t rdn, attribute;
|
enumerator_t *enumerator;
|
||||||
chunk_t oid, value;
|
bool contains = FALSE;
|
||||||
asn1_t type;
|
id_part_t type;
|
||||||
bool next;
|
chunk_t data;
|
||||||
|
|
||||||
if (!init_rdn(this->encoded, &rdn, &attribute, &next))
|
enumerator = create_part_enumerator(this);
|
||||||
|
while (enumerator->enumerate(enumerator, &type, &data))
|
||||||
{
|
{
|
||||||
return FALSE;
|
if (data.len == 1 && data.ptr[0] == '*')
|
||||||
}
|
|
||||||
/* fetch next RDN */
|
|
||||||
while (next)
|
|
||||||
{
|
|
||||||
/* parse next RDN and check for errors */
|
|
||||||
if (!get_next_rdn(&rdn, &attribute, &oid, &value, &type, &next))
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
contains = TRUE;
|
||||||
}
|
break;
|
||||||
/* check if RDN is a wildcard */
|
|
||||||
if (value.len == 1 && *value.ptr == '*')
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
enumerator->destroy(enumerator);
|
||||||
|
return contains;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user