From 93534057710cef4a88f18f441fea20e733ebc253 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Wed, 11 Oct 2017 12:35:38 +0200 Subject: public_key: Fix bug in pkix_verify_hostname with IP addresses An IP address could in some circomstances be converted to a list and then to_lower was applied to it. So {$A,1,1,1} was changed to {$a,1,1,1} which of course didn't match.... --- lib/public_key/src/public_key.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/public_key/src/public_key.erl') diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index c3f2d791a3..453f34de64 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -1529,6 +1529,8 @@ verify_hostname_match_loop(Refs, Pres, MatchFun, FailCB, Cert) -> Refs). +to_lower_ascii({ip,_}=X) -> X; +to_lower_ascii({iPAddress,_}=X) -> X; to_lower_ascii(S) when is_list(S) -> lists:map(fun to_lower_ascii/1, S); to_lower_ascii({T,S}) -> {T, to_lower_ascii(S)}; to_lower_ascii(C) when $A =< C,C =< $Z -> C + ($a-$A); -- cgit v1.2.3