Skip to content

Commit

Permalink
public_key: Change imp detail according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed Oct 30, 2023
1 parent ac9ec98 commit 076af79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/public_key/src/pubkey_cert.erl
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ handle_last_cert(OtpCert, #path_validation_state{last_cert = true,
_ ->
ValidationState0
end,
PolicyLevel = CertNum-2, %% Cert num was already bumped and root level is 0
PolicyLevel = CertNum-1, %% Cert num was already bumped
ValidTree = policy_tree_intersection(PolicySet, Tree, PolicyLevel),
validate_policy_tree(OtpCert,
ValidationState#path_validation_state{valid_policy_tree = ValidTree});
Expand Down
2 changes: 1 addition & 1 deletion lib/public_key/src/pubkey_policy_tree.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ any_leaves({_,[{_, _}|_] = ChildNodes}, Level) ->
lists:flatmap(fun(ChildNode)->
any_leaves(ChildNode, Level-1)
end, ChildNodes);
any_leaves({_, Leaves}, 0) ->
any_leaves({_, Leaves}, 1) -> %% Root level is 0 so we reached <Level> at nesting 1
AnyLeaf = fun(#{valid_policy := ?anyPolicy} = Node) ->
{true, Node};
(_) ->
Expand Down

0 comments on commit 076af79

Please sign in to comment.