diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_lu.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_lu.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c index cd1c807f50..ee72e67d1a 100644 --- a/src/lib/libcrypto/x509/x509_lu.c +++ b/src/lib/libcrypto/x509/x509_lu.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_lu.c,v 1.34 2021/10/24 09:27:48 tb Exp $ */ | 1 | /* $OpenBSD: x509_lu.c,v 1.35 2021/10/31 16:20:37 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -132,7 +132,7 @@ X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | int | 134 | int |
| 135 | X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, | 135 | X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_NAME *name, |
| 136 | X509_OBJECT *ret) | 136 | X509_OBJECT *ret) |
| 137 | { | 137 | { |
| 138 | if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) | 138 | if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) |
| @@ -143,8 +143,8 @@ X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | int | 145 | int |
| 146 | X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, | 146 | X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, |
| 147 | ASN1_INTEGER *serial, X509_OBJECT *ret) | 147 | X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret) |
| 148 | { | 148 | { |
| 149 | if ((ctx->method == NULL) || | 149 | if ((ctx->method == NULL) || |
| 150 | (ctx->method->get_by_issuer_serial == NULL)) | 150 | (ctx->method->get_by_issuer_serial == NULL)) |
| @@ -153,7 +153,7 @@ X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, | |||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | int | 155 | int |
| 156 | X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, | 156 | X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, |
| 157 | const unsigned char *bytes, int len, X509_OBJECT *ret) | 157 | const unsigned char *bytes, int len, X509_OBJECT *ret) |
| 158 | { | 158 | { |
| 159 | if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) | 159 | if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) |
| @@ -162,8 +162,8 @@ X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, | |||
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | int | 164 | int |
| 165 | X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, const char *str, int len, | 165 | X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, |
| 166 | X509_OBJECT *ret) | 166 | int len, X509_OBJECT *ret) |
| 167 | { | 167 | { |
| 168 | if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) | 168 | if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) |
| 169 | return 0; | 169 | return 0; |
| @@ -242,7 +242,7 @@ X509_OBJECT_new(void) | |||
| 242 | return NULL; | 242 | return NULL; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | ret->type = 0; | 245 | ret->type = X509_LU_NONE; |
| 246 | 246 | ||
| 247 | return ret; | 247 | return ret; |
| 248 | } | 248 | } |
| @@ -322,8 +322,8 @@ X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) | |||
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | int | 324 | int |
| 325 | X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, | 325 | X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, |
| 326 | X509_OBJECT *ret) | 326 | X509_NAME *name, X509_OBJECT *ret) |
| 327 | { | 327 | { |
| 328 | X509_STORE *ctx = vs->ctx; | 328 | X509_STORE *ctx = vs->ctx; |
| 329 | X509_LOOKUP *lu; | 329 | X509_LOOKUP *lu; |
| @@ -471,7 +471,7 @@ X509_OBJECT_up_ref_count(X509_OBJECT *a) | |||
| 471 | return 1; | 471 | return 1; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | int | 474 | X509_LOOKUP_TYPE |
| 475 | X509_OBJECT_get_type(const X509_OBJECT *a) | 475 | X509_OBJECT_get_type(const X509_OBJECT *a) |
| 476 | { | 476 | { |
| 477 | return a->type; | 477 | return a->type; |
| @@ -491,8 +491,8 @@ X509_OBJECT_free_contents(X509_OBJECT *a) | |||
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | static int | 493 | static int |
| 494 | x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, X509_NAME *name, | 494 | x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, |
| 495 | int *pnmatch) | 495 | X509_NAME *name, int *pnmatch) |
| 496 | { | 496 | { |
| 497 | X509_OBJECT stmp; | 497 | X509_OBJECT stmp; |
| 498 | X509 x509_s; | 498 | X509 x509_s; |
| @@ -535,13 +535,14 @@ x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, X509_NAME *name, | |||
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | int | 537 | int |
| 538 | X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, X509_NAME *name) | 538 | X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, |
| 539 | X509_NAME *name) | ||
| 539 | { | 540 | { |
| 540 | return x509_object_idx_cnt(h, type, name, NULL); | 541 | return x509_object_idx_cnt(h, type, name, NULL); |
| 541 | } | 542 | } |
| 542 | 543 | ||
| 543 | X509_OBJECT * | 544 | X509_OBJECT * |
| 544 | X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type, | 545 | X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, |
| 545 | X509_NAME *name) | 546 | X509_NAME *name) |
| 546 | { | 547 | { |
| 547 | int idx; | 548 | int idx; |
