Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed May 27, 2024
2 parents 79bc823 + 12c6b0a commit 9f778f5
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/public_key/src/pubkey_cert.erl
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,21 @@ match_name(emailAddress, Name, [PermittedName | Rest]) ->

match_name(dNSName, Name, [PermittedName | Rest]) ->
Fun = fun(Domain, [$.|Domain]) -> true;
(Name1,Name2) ->
is_suffix(Name2, Name1)
(Name1, [$. | _] = Name2) ->
is_suffix(Name2, Name1);
(Name1, Name2) ->
StrLen1 = string:len(Name1),
StrLen2 = string:len(Name2),
case StrLen1 > StrLen2 of
true ->
is_suffix([$. | Name2], Name1);
false when StrLen1 == StrLen2 ->
string:casefold(Name1) == string:casefold(Name2);
false ->
false
end
end,
match_name(Fun, Name, [$.|PermittedName], Rest);
match_name(Fun, Name, PermittedName, Rest);

match_name(x400Address, OrAddress, [PermittedAddr | Rest]) ->
match_name(fun is_or_address/2, OrAddress, PermittedAddr, Rest);
Expand Down

0 comments on commit 9f778f5

Please sign in to comment.