unit-tests: Verify that E and emailAddress result in the same ID
authorTobias Brunner <tobias@strongswan.org>
Fri, 18 Jan 2019 10:15:16 +0000 (11:15 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 18 Jan 2019 10:15:16 +0000 (11:15 +0100)
src/libstrongswan/tests/suites/test_identification.c

index 4b22024..feadcc9 100644 (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));