diff options
author | beck <> | 2023-04-26 19:05:11 +0000 |
---|---|---|
committer | beck <> | 2023-04-26 19:05:11 +0000 |
commit | 45c077e1c3c8cdc8e0d04596b98c60252d707c31 (patch) | |
tree | e46754f38165b25a134e9a43d575afb0e2a4911e /src | |
parent | 5637650af830b347a45d76d375248797e2c373b7 (diff) | |
download | openbsd-45c077e1c3c8cdc8e0d04596b98c60252d707c31.tar.gz openbsd-45c077e1c3c8cdc8e0d04596b98c60252d707c31.tar.bz2 openbsd-45c077e1c3c8cdc8e0d04596b98c60252d707c31.zip |
Adapt the sk_find calls from BoringSSL's api to ours.
ok tb@ jsing@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x509/x509_policy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/x509_policy.c b/src/lib/libcrypto/x509/x509_policy.c index 225ac93f11..c25ffe9646 100644 --- a/src/lib/libcrypto/x509/x509_policy.c +++ b/src/lib/libcrypto/x509/x509_policy.c | |||
@@ -212,8 +212,8 @@ static X509_POLICY_NODE *x509_policy_level_find(X509_POLICY_LEVEL *level, | |||
212 | assert(sk_X509_POLICY_NODE_is_sorted(level->nodes)); | 212 | assert(sk_X509_POLICY_NODE_is_sorted(level->nodes)); |
213 | X509_POLICY_NODE node; | 213 | X509_POLICY_NODE node; |
214 | node.policy = (ASN1_OBJECT *)policy; | 214 | node.policy = (ASN1_OBJECT *)policy; |
215 | size_t idx; | 215 | int idx; |
216 | if (!sk_X509_POLICY_NODE_find(level->nodes, &idx, &node)) { | 216 | if ((idx = sk_X509_POLICY_NODE_find(level->nodes, &node)) < 0) { |
217 | return NULL; | 217 | return NULL; |
218 | } | 218 | } |
219 | return sk_X509_POLICY_NODE_value(level->nodes, idx); | 219 | 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) { | |||
257 | assert(sk_POLICYINFO_is_sorted(policies)); | 257 | assert(sk_POLICYINFO_is_sorted(policies)); |
258 | POLICYINFO info; | 258 | POLICYINFO info; |
259 | info.policyid = node->policy; | 259 | info.policyid = node->policy; |
260 | if (sk_POLICYINFO_find(policies, NULL, &info)) { | 260 | if (sk_POLICYINFO_find(policies, &info) >= 0) { |
261 | return 0; | 261 | return 0; |
262 | } | 262 | } |
263 | x509_policy_node_free(node); | 263 | x509_policy_node_free(node); |
@@ -375,7 +375,7 @@ static int delete_if_mapped(X509_POLICY_NODE *node, void *data) { | |||
375 | assert(sk_POLICY_MAPPING_is_sorted(mappings)); | 375 | assert(sk_POLICY_MAPPING_is_sorted(mappings)); |
376 | POLICY_MAPPING mapping; | 376 | POLICY_MAPPING mapping; |
377 | mapping.issuerDomainPolicy = node->policy; | 377 | mapping.issuerDomainPolicy = node->policy; |
378 | if (!sk_POLICY_MAPPING_find(mappings, /*out_index=*/NULL, &mapping)) { | 378 | if (sk_POLICY_MAPPING_find(mappings, &mapping) < 0) { |
379 | return 0; | 379 | return 0; |
380 | } | 380 | } |
381 | x509_policy_node_free(node); | 381 | x509_policy_node_free(node); |
@@ -676,8 +676,7 @@ static int has_explicit_policy(STACK_OF(X509_POLICY_LEVEL) *levels, | |||
676 | // |node|'s parent is anyPolicy and is part of "valid_policy_node_set". | 676 | // |node|'s parent is anyPolicy and is part of "valid_policy_node_set". |
677 | // If it exists in |user_policies|, the intersection is non-empty and we | 677 | // If it exists in |user_policies|, the intersection is non-empty and we |
678 | // can return immediately. | 678 | // can return immediately. |
679 | if (sk_ASN1_OBJECT_find(user_policies, /*out_index=*/NULL, | 679 | if (sk_ASN1_OBJECT_find(user_policies, node->policy) >= 0) { |
680 | node->policy)) { | ||
681 | return 1; | 680 | return 1; |
682 | } | 681 | } |
683 | } else if (i > 0) { | 682 | } else if (i > 0) { |