aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstrongswan/utils/identification.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c
index a257747d5..462a7e8ed 100644
--- a/src/libstrongswan/utils/identification.c
+++ b/src/libstrongswan/utils/identification.c
@@ -795,30 +795,22 @@ static id_type_t get_type(private_identification_t *this)
*/
static bool contains_wildcards_dn(private_identification_t *this)
{
- chunk_t rdn, attribute;
- chunk_t oid, value;
- asn1_t type;
- bool next;
+ enumerator_t *enumerator;
+ bool contains = FALSE;
+ id_part_t type;
+ chunk_t data;
- if (!init_rdn(this->encoded, &rdn, &attribute, &next))
- {
- return FALSE;
- }
- /* fetch next RDN */
- while (next)
+ enumerator = create_part_enumerator(this);
+ while (enumerator->enumerate(enumerator, &type, &data))
{
- /* parse next RDN and check for errors */
- if (!get_next_rdn(&rdn, &attribute, &oid, &value, &type, &next))
+ if (data.len == 1 && data.ptr[0] == '*')
{
- return FALSE;
- }
- /* check if RDN is a wildcard */
- if (value.len == 1 && *value.ptr == '*')
- {
- return TRUE;
+ contains = TRUE;
+ break;
}
}
- return FALSE;
+ enumerator->destroy(enumerator);
+ return contains;
}
/**