Client-side namecheck wildcards.
[openssl.git] / crypto / x509v3 / v3nametest.c
index 4cd6f3688809997b0fd4d33dc8ecc27f5b415196..ad820fdfd9b379bf0f132bcec410e9f863ed92d5 100644 (file)
@@ -11,6 +11,7 @@ static const char *const names[] =
        "*@example.com", "test@*.example.com", "example.com", "www.example.com",
        "test.www.example.com", "*.example.com", "*.www.example.com",
        "test.*.example.com", "www.*.com",
+       ".www.example.com", "*www.example.com",
        "example.net", "xn--rger-koa.example.com",
        "a.example.com", "b.example.com",
        "postmaster@example.com", "Postmaster@example.com",
@@ -25,6 +26,11 @@ static const char *const exceptions[] =
        "set CN: host: [*.example.com] matches [www.example.com]",
        "set CN: host: [*.example.com] matches [xn--rger-koa.example.com]",
        "set CN: host: [*.www.example.com] matches [test.www.example.com]",
+       "set CN: host: [*.www.example.com] matches [.www.example.com]",
+       "set CN: host: [*www.example.com] matches [www.example.com]",
+       "set CN: host: [test.www.example.com] matches [.www.example.com]",
+       "set CN: host-no-wildcards: [*.www.example.com] matches [.www.example.com]",
+       "set CN: host-no-wildcards: [test.www.example.com] matches [.www.example.com]",
        "set emailAddress: email: [postmaster@example.com] does not match [Postmaster@example.com]",
        "set emailAddress: email: [postmaster@EXAMPLE.COM] does not match [Postmaster@example.com]",
        "set emailAddress: email: [Postmaster@example.com] does not match [postmaster@example.com]",
@@ -34,6 +40,11 @@ static const char *const exceptions[] =
        "set dnsName: host: [*.example.com] matches [b.example.com]",
        "set dnsName: host: [*.example.com] matches [xn--rger-koa.example.com]",
        "set dnsName: host: [*.www.example.com] matches [test.www.example.com]",
+       "set dnsName: host-no-wildcards: [*.www.example.com] matches [.www.example.com]",
+       "set dnsName: host-no-wildcards: [test.www.example.com] matches [.www.example.com]",
+       "set dnsName: host: [*.www.example.com] matches [.www.example.com]",
+       "set dnsName: host: [*www.example.com] matches [www.example.com]",
+       "set dnsName: host: [test.www.example.com] matches [.www.example.com]",
        "set rfc822Name: email: [postmaster@example.com] does not match [Postmaster@example.com]",
        "set rfc822Name: email: [Postmaster@example.com] does not match [postmaster@example.com]",
        "set rfc822Name: email: [Postmaster@example.com] does not match [postmaster@EXAMPLE.COM]",