71 #ifdef OPENSSL_POLICY_DEBUG
108 BIO_printf(err,
"Level print after %s\n", str);
110 for (plev = tree->
levels; plev != curr; plev++)
118 expected_print(err, plev, node, 2);
130 #define tree_print(a,b,c)
167 explicit_policy = n + 1;
186 for (i = n - 2; i >= 0; i--)
200 else if ((ret == 1) && !cache->data)
202 if (explicit_policy > 0)
214 if (ret == 2 && !explicit_policy)
230 tree->extra_data = NULL;
231 tree->auth_policies = NULL;
232 tree->user_policies = NULL;
253 for (i = n - 2; i >= 0; i--)
363 if (!tree_link_matching_nodes(curr, data))
391 data->qualifier_set = cache->
anyPolicy->qualifier_set;
416 if (!tree_add_unmatched(curr, cache, NULL, node, tree))
432 if (!tree_add_unmatched(curr, cache, oid, node, tree))
455 if (!tree_link_unmatched(curr, cache, node, tree))
478 data->qualifier_set = cache->
anyPolicy->qualifier_set;
563 *pnodes = policy_node_cmp_new();
598 if (!tree_add_auth_node(&tree->auth_policies, curr->
anyPolicy))
604 addnodes = &tree->auth_policies;
607 for (i = 1; i < tree->
nlevel; i++)
618 if ((node->
parent == anyptr)
619 && !tree_add_auth_node(addnodes, node))
624 if (addnodes == pnodes)
627 *pnodes = tree->auth_policies;
677 extra->qualifier_set = anyPolicy->
data->qualifier_set;
683 if (!tree->user_policies)
686 if (!tree->user_policies)
702 for(i = 1; i < tree->
nlevel; i++, curr++)
705 if (!tree_link_nodes(curr, cache))
709 && !tree_link_any(curr, cache, tree))
711 tree_print(
"before tree_prune()", tree, curr);
712 ret = tree_prune(tree, curr);
739 for(i = 0, curr = tree->
levels; i < tree->nlevel; i++, curr++)
742 X509_free(curr->
cert);
750 if (tree->extra_data)
777 *pexplicit_policy = 0;
778 ret = tree_init(&tree, certs, flags);
798 *pexplicit_policy = 1;
803 *pexplicit_policy = 1;
822 if (!tree)
goto error;
823 ret = tree_evaluate(tree);
834 if (*pexplicit_policy)
842 ret = tree_calculate_authority_set(tree, &auth_nodes);
847 if (!tree_calculate_user_set(tree, policy_oids, auth_nodes))
856 if (*pexplicit_policy)
858 nodes = X509_policy_tree_get0_user_policies(tree);