diff options
author | Hans Nilsson <[email protected]> | 2018-06-07 16:30:39 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-06-07 17:13:34 +0200 |
commit | ea356c5d58ed102d3c8258553ea41c20a4ba21a8 (patch) | |
tree | 6e7f1e0c0dfe3969f9baf72582a142b5a3225d0a /lib/public_key/test | |
parent | 9ee83cf9c8d5b322e5361ebc067c00222c0c56ae (diff) | |
download | otp-ea356c5d58ed102d3c8258553ea41c20a4ba21a8.tar.gz otp-ea356c5d58ed102d3c8258553ea41c20a4ba21a8.tar.bz2 otp-ea356c5d58ed102d3c8258553ea41c20a4ba21a8.zip |
public_key: Extend test case pkix_verify_hostname_subjAltName
Diffstat (limited to 'lib/public_key/test')
-rw-r--r-- | lib/public_key/test/public_key_SUITE.erl | 20 |
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: |