From 076af79b0795317d213f4756b2ee5ecda397b13f Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 30 Oct 2023 13:03:50 +0100 Subject: [PATCH] public_key: Change imp detail according to review --- lib/public_key/src/pubkey_cert.erl | 2 +- lib/public_key/src/pubkey_policy_tree.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl index be7a02e83ad6..0872ca06cc77 100644 --- a/lib/public_key/src/pubkey_cert.erl +++ b/lib/public_key/src/pubkey_cert.erl @@ -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}); diff --git a/lib/public_key/src/pubkey_policy_tree.erl b/lib/public_key/src/pubkey_policy_tree.erl index 6dfd10c41f55..e31654834273 100644 --- a/lib/public_key/src/pubkey_policy_tree.erl +++ b/lib/public_key/src/pubkey_policy_tree.erl @@ -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 at nesting 1 AnyLeaf = fun(#{valid_policy := ?anyPolicy} = Node) -> {true, Node}; (_) ->