return query->has_optional ? 1 : 0;
}
+int ossl_property_is_enabled(OPENSSL_CTX *ctx, const char *property_name,
+ const OSSL_PROPERTY_LIST *prop_list)
+{
+ int i;
+ OSSL_PROPERTY_IDX name_id;
+ const PROPERTY_DEFINITION *prop = NULL;
+
+ if (prop_list == NULL)
+ return 0;
+
+ if (!parse_name(ctx, &property_name, 0, &name_id))
+ return 0;
+
+ prop = prop_list->properties;
+ for (i = 0; i < prop_list->n; ++i) {
+ if (prop[i].name_idx == name_id) {
+ /* Do a separate check for override as it does not set type */
+ if (prop[i].optional || prop[i].oper == PROPERTY_OVERRIDE)
+ return 0;
+ return (prop[i].type == PROPERTY_TYPE_STRING
+ && ((prop[i].oper == PROPERTY_OPER_EQ
+ && prop[i].v.str_val == ossl_property_true)
+ || (prop[i].oper == PROPERTY_OPER_NE
+ && prop[i].v.str_val != ossl_property_true)));
+ }
+ }
+ return 0;
+}
+
/*
* Compare a query against a definition.
* Return the number of clauses matched or -1 if a mandatory clause is false.
if (r == NULL)
return NULL;
+ r->has_optional = 0;
for (i = j = n = 0; i < a->n || j < b->n; n++) {
if (i >= a->n) {
copy = &bp[j++];
copy = &bp[j++];
}
memcpy(r->properties + n, copy, sizeof(r->properties[0]));
+ r->has_optional |= copy->optional;
}
r->n = n;
if (n != t)