/* This corresponds to RFC3280 6.1.3(d)(2): Create new data for any unmatched policies in the parent and link to anyPolicy.  */
static int tree_add_unmatched(X509_POLICY_LEVEL *curr, const X509_POLICY_CACHE *cache, const ASN1_OBJECT *id, X509_POLICY_NODE *node, X509_POLICY_TREE *tree)
/* This corresponds to RFC3280 6.1.3(d)(2): Create new data for any unmatched policies in the parent and link to anyPolicy.  */
static int tree_add_unmatched(X509_POLICY_LEVEL *curr, const X509_POLICY_CACHE *cache, const ASN1_OBJECT *id, X509_POLICY_NODE *node, X509_POLICY_TREE *tree)
{
    X509_POLICY_DATA *data;
    if (id == NULL)
        id = node->data->valid_policy;
    data = policy_data_new(NULL, id, node_critical(node));
    if (data == NULL)
        return 0;
    data->qualifier_set = cache->anyPolicy->qualifier_set;
    data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
    if (!level_add_node(curr, data, node, tree)) {
        policy_data_free(data);
        return 0;
    }
    return 1;
}