aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-06-11 10:51:07 +0200
committerHans Nilsson <[email protected]>2018-06-11 10:51:07 +0200
commit1e9b73b9baa569354145d8f1a6fd897080aa78d5 (patch)
tree8dc3146a2b79f13b260f2d9dd1a600ed60a20ab7
parent66eea8e2c6c89da2d85df855223333f8f2b0946d (diff)
parentea356c5d58ed102d3c8258553ea41c20a4ba21a8 (diff)
downloadotp-1e9b73b9baa569354145d8f1a6fd897080aa78d5.tar.gz
otp-1e9b73b9baa569354145d8f1a6fd897080aa78d5.tar.bz2
otp-1e9b73b9baa569354145d8f1a6fd897080aa78d5.zip
Merge branch 'hans/public_key/cuddle_tests'
* hans/public_key/cuddle_tests: public_key: Extend test case pkix_verify_hostname_subjAltName
-rw-r--r--lib/public_key/test/public_key_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index fcc9bdc080..073bd6f4a2 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -989,10 +989,19 @@ pkix_verify_hostname_subjAltName(Config) ->
%% Check that a dns_id does not match a DNS subjAltName wiht wildcard
false = public_key:pkix_verify_hostname(Cert, [{dns_id,"other.example.org"}]),
- %% Check that a dns_id does nmatches a DNS subjAltName wiht wildcard with matchfun
+ %% Check that a dns_id does match a DNS subjAltName wiht wildcard with matchfun
true = public_key:pkix_verify_hostname(Cert, [{dns_id,"other.example.org"}],
[{match_fun, public_key:pkix_verify_hostname_match_fun(https)}
]
+ ),
+
+ %% Check that a uri_id does not match a DNS subjAltName wiht wildcard
+ false = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://other.example.org"}]),
+
+ %% Check that a dns_id does match a DNS subjAltName wiht wildcard with matchfun
+ true = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://other.example.org"}],
+ [{match_fun, public_key:pkix_verify_hostname_match_fun(https)}
+ ]
).
%%--------------------------------------------------------------------
@@ -1040,7 +1049,14 @@ pkix_verify_hostname_options(Config) ->
end}]),
true = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://example.com"}],
[{fqdn_fun, fun(_) -> default end}]),
- false = public_key:pkix_verify_hostname(Cert, [{uri_id,"some://very.wrong.domain"}]).
+ false = public_key:pkix_verify_hostname(Cert, [{uri_id,"some://very.wrong.domain"}]),
+
+ true = public_key:pkix_verify_hostname(Cert, [{dns_id,"example.com"}]),
+ true = public_key:pkix_verify_hostname(Cert, [{dns_id,"abb.bar.example.com"}]),
+ false = public_key:pkix_verify_hostname(Cert, [{dns_id,"example.com"},
+ {dns_id,"abb.bar.example.com"}],
+ [{fqdn_fun,fun(_)->undefined end}]).
+
%%--------------------------------------------------------------------
%% To generate the PEM file contents: