]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
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 4b22024316cb83ee0bdf84ddcb13a864dcbdfdc1..feadcc9d93b3e4f2516134000188a6fba7df02f2 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"));
                                                         "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"));
        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));
        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));
        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));