Skip to content

Commit

Permalink
fixup: Handle map to initial
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed Nov 1, 2023
1 parent 7673473 commit f8d06b2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/public_key/src/pubkey_cert.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,16 @@ handle_policy_mapping_ext(#'PolicyMappings_SEQOF'{
fun(#{valid_policy := ValidPolicy, expected_policy_set := Set} = Node)
when ValidPolicy == IssuerPolicy ->
case Set of %% Initial policy should be mapped over, but can be mapped to itself
[ValidPolicy] when SubjectPolicy =/= ValidPolicy ->
[ValidPolicy] when ValidPolicy =/= SubjectPolicy ->
Node#{expected_policy_set => [SubjectPolicy]};
_ ->
Node#{expected_policy_set => Set ++ [SubjectPolicy]}
%% Avoid duplicating self mapping
case lists:member(SubjectPolicy, Set) of
true ->
Node;
false ->
Node#{expected_policy_set => Set ++ [SubjectPolicy]}
end
end;
(Node) ->
Node
Expand Down

0 comments on commit f8d06b2

Please sign in to comment.