unit-tests: Verify that E and emailAddress result in the same ID

This commit is contained in:
Tobias Brunner 2019-01-18 11:15:16 +01:00
parent 6639288b1a
commit 220b0cb29c
1 changed files with 4 additions and 0 deletions

View File

@ -467,6 +467,8 @@ START_TEST(test_equals)
"C=CH, E=moon@strongswan.org, CN=moon");
ck_assert(id_equals(a, "C=CH, E=moon@strongswan.org, CN=moon"));
ck_assert(id_equals(a, "C=CH, email=moon@strongswan.org, CN=moon"));
ck_assert(id_equals(a, "C=CH, emailAddress=moon@strongswan.org, CN=moon"));
ck_assert(id_equals(a, "C==CH , E==moon@strongswan.org , CN==moon"));
ck_assert(id_equals(a, " C=CH, E=moon@strongswan.org, CN=moon "));
ck_assert(id_equals(a, "C=ch, E=moon@STRONGSWAN.ORG, CN=Moon"));
@ -631,6 +633,8 @@ START_TEST(test_matches)
a = identification_create_from_string("C=CH, E=moon@strongswan.org, CN=moon");
ck_assert(id_matches(a, "C=CH, E=moon@strongswan.org, CN=moon", ID_MATCH_PERFECT));
ck_assert(id_matches(a, "C=CH, email=moon@strongswan.org, CN=moon", ID_MATCH_PERFECT));
ck_assert(id_matches(a, "C=CH, emailAddress=moon@strongswan.org, CN=moon", ID_MATCH_PERFECT));
ck_assert(id_matches(a, "C=CH, E=*@strongswan.org, CN=moon", ID_MATCH_NONE));
ck_assert(id_matches(a, "C=CH, E=*, CN=moon", ID_MATCH_ONE_WILDCARD));
ck_assert(id_matches(a, "C=CH, E=*, CN=*", ID_MATCH_ONE_WILDCARD - 1));