X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fx509v3%2Fv3nametest.c;h=ad820fdfd9b379bf0f132bcec410e9f863ed92d5;hp=aa0d29c3da3040e7c4f786dc0bf3ff463b474d25;hb=a09e4d24ada871ed0e6f5e37fadd52a76b29542a;hpb=472af806ce859b6b00249550027c2c9fa149453b diff --git a/crypto/x509v3/v3nametest.c b/crypto/x509v3/v3nametest.c index aa0d29c3da..ad820fdfd9 100644 --- a/crypto/x509v3/v3nametest.c +++ b/crypto/x509v3/v3nametest.c @@ -1,16 +1,17 @@ #include #include +#include "../e_os.h" #include static const char *const names[] = { "a", "b", ".", "*", "@", ".a", "a.", ".b", "b.", ".*", "*.", "*@", "@*", "a@", "@a", "b@", "..", - "@@", "**", - "*.com", "*com", "*.*.com", "*com", "com*", "*example.com", - "*@example.com", "test@*.example.com", - "example.com", "www.example.com", "test.www.example.com", - "*.example.com", "*.www.example.com", "test.*.example.com", "www.*.com", + "@@", "**", "*.com", "*com", "*.*.com", "*com", "com*", "*example.com", + "*@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", @@ -20,28 +21,30 @@ static const char *const names[] = static const char *const exceptions[] = { - "set CN: host: [*.example.com] does not match [*.example.com]", "set CN: host: [*.example.com] matches [a.example.com]", "set CN: host: [*.example.com] matches [b.example.com]", "set CN: host: [*.example.com] matches [www.example.com]", "set CN: host: [*.example.com] matches [xn--rger-koa.example.com]", - "set CN: host: [test.*.example.com] does not match [test.*.example.com]", - "set CN: host: [test.*.example.com] matches [test.www.example.com]", - "set CN: host: [*.www.example.com] does not match [*.www.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]", "set emailAddress: email: [Postmaster@example.com] does not match [postmaster@EXAMPLE.COM]", "set dnsName: host: [*.example.com] matches [www.example.com]", - "set dnsName: host: [*.example.com] does not match [*.example.com]", "set dnsName: host: [*.example.com] matches [a.example.com]", "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: [*.www.example.com] does not match [*.www.example.com]", - "set dnsName: host: [test.*.example.com] matches [test.www.example.com]", - "set dnsName: host: [test.*.example.com] does not match [test.*.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]", @@ -251,7 +254,7 @@ static void check_message(const struct set_name_fn *fn, const char *op, char msg[1024]; if (match < 0) return; - snprintf(msg, sizeof(msg), "%s: %s: [%s] %s [%s]", + BIO_snprintf(msg, sizeof(msg), "%s: %s: [%s] %s [%s]", fn->name, op, nameincert, match ? "matches" : "does not match", name); if (is_exception(msg))