diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_policy.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/libcrypto/x509/x509_policy.c b/src/lib/libcrypto/x509/x509_policy.c index c25ffe9646..c9618dbf23 100644 --- a/src/lib/libcrypto/x509/x509_policy.c +++ b/src/lib/libcrypto/x509/x509_policy.c | |||
| @@ -139,6 +139,29 @@ DECLARE_STACK_OF(X509_POLICY_LEVEL) | |||
| 139 | #define sk_X509_POLICY_LEVEL_sort(st) SKM_sk_sort(X509_POLICY_LEVEL, (st)) | 139 | #define sk_X509_POLICY_LEVEL_sort(st) SKM_sk_sort(X509_POLICY_LEVEL, (st)) |
| 140 | #define sk_X509_POLICY_LEVEL_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_LEVEL, (st)) | 140 | #define sk_X509_POLICY_LEVEL_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_LEVEL, (st)) |
| 141 | 141 | ||
| 142 | /* | ||
| 143 | * Don't look Ethel, but you would really not want to look if we did | ||
| 144 | * this the OpenSSL way either, and we are not using this boringsslism | ||
| 145 | * anywhere else. | ||
| 146 | */ | ||
| 147 | void | ||
| 148 | sk_X509_POLICY_NODE_delete_if(STACK_OF(X509_POLICY_NODE) *nodes, | ||
| 149 | int (*delete_if)(X509_POLICY_NODE *, void *), | ||
| 150 | void *data) | ||
| 151 | { | ||
| 152 | _STACK *sk = (_STACK *)nodes; | ||
| 153 | X509_POLICY_NODE *node; | ||
| 154 | int new_num = 0; | ||
| 155 | int i; | ||
| 156 | |||
| 157 | for (i = 0; i < sk_X509_POLICY_NODE_num(nodes); i++) { | ||
| 158 | node = sk_X509_POLICY_NODE_value(nodes, i); | ||
| 159 | if (!delete_if(node, data)) | ||
| 160 | sk->data[new_num++] = (char *)node; | ||
| 161 | } | ||
| 162 | sk->num = new_num; | ||
| 163 | } | ||
| 164 | |||
| 142 | static int is_any_policy(const ASN1_OBJECT *obj) { | 165 | static int is_any_policy(const ASN1_OBJECT *obj) { |
| 143 | return OBJ_obj2nid(obj) == NID_any_policy; | 166 | return OBJ_obj2nid(obj) == NID_any_policy; |
| 144 | } | 167 | } |
