summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2023-04-26 19:05:12 +0000
committerBob Beck <beck@cvs.openbsd.org>2023-04-26 19:05:12 +0000
commitb033f6018f47b5a35a19df860326128e45c5198a (patch)
tree077652fa6aed158135e929ad1d5ef3b96737946e /lib/libcrypto
parent7c0f6b2b177d667fec1df6941ed51ee23f66eafc (diff)
Adapt the sk_find calls from BoringSSL's api to ours.
ok tb@ jsing@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/x509/x509_policy.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libcrypto/x509/x509_policy.c b/lib/libcrypto/x509/x509_policy.c
index 225ac93f11c..c25ffe96467 100644
--- a/lib/libcrypto/x509/x509_policy.c
+++ b/lib/libcrypto/x509/x509_policy.c
@@ -212,8 +212,8 @@ static X509_POLICY_NODE *x509_policy_level_find(X509_POLICY_LEVEL *level,
assert(sk_X509_POLICY_NODE_is_sorted(level->nodes));
X509_POLICY_NODE node;
node.policy = (ASN1_OBJECT *)policy;
- size_t idx;
- if (!sk_X509_POLICY_NODE_find(level->nodes, &idx, &node)) {
+ int idx;
+ if ((idx = sk_X509_POLICY_NODE_find(level->nodes, &node)) < 0) {
return NULL;
}
return sk_X509_POLICY_NODE_value(level->nodes, idx);
@@ -257,7 +257,7 @@ static int delete_if_not_in_policies(X509_POLICY_NODE *node, void *data) {
assert(sk_POLICYINFO_is_sorted(policies));
POLICYINFO info;
info.policyid = node->policy;
- if (sk_POLICYINFO_find(policies, NULL, &info)) {
+ if (sk_POLICYINFO_find(policies, &info) >= 0) {
return 0;
}
x509_policy_node_free(node);
@@ -375,7 +375,7 @@ static int delete_if_mapped(X509_POLICY_NODE *node, void *data) {
assert(sk_POLICY_MAPPING_is_sorted(mappings));
POLICY_MAPPING mapping;
mapping.issuerDomainPolicy = node->policy;
- if (!sk_POLICY_MAPPING_find(mappings, /*out_index=*/NULL, &mapping)) {
+ if (sk_POLICY_MAPPING_find(mappings, &mapping) < 0) {
return 0;
}
x509_policy_node_free(node);
@@ -676,8 +676,7 @@ static int has_explicit_policy(STACK_OF(X509_POLICY_LEVEL) *levels,
// |node|'s parent is anyPolicy and is part of "valid_policy_node_set".
// If it exists in |user_policies|, the intersection is non-empty and we
// can return immediately.
- if (sk_ASN1_OBJECT_find(user_policies, /*out_index=*/NULL,
- node->policy)) {
+ if (sk_ASN1_OBJECT_find(user_policies, node->policy) >= 0) {
return 1;
}
} else if (i > 0) {