diff options
| author | tb <> | 2023-04-16 08:30:21 +0000 |
|---|---|---|
| committer | tb <> | 2023-04-16 08:30:21 +0000 |
| commit | 494393287f5d942b352501d150e6504ab59c710e (patch) | |
| tree | 1a6f82b024ec538bd602323e462b30de63a97335 /src/lib/libcrypto/x509/x509_lu.c | |
| parent | 8cd0b5a40d5cd929c8fc069acbc286b19a97b812 (diff) | |
| download | openbsd-494393287f5d942b352501d150e6504ab59c710e.tar.gz openbsd-494393287f5d942b352501d150e6504ab59c710e.tar.bz2 openbsd-494393287f5d942b352501d150e6504ab59c710e.zip | |
Prepare addition of X509_STORE_CTX_get1_{certs,crls}(3)
X509_STORE_get1_{certs,crls}(3) was added to the OpenSSL 1.1 API with the
usual care. At some point later it was noticed that they didn't deal with
an X509_STORE at all, but rather with an X509_STORE_CTX, so were misnamed.
The fact that X509_STORE_CTX and X509_STORE have their roles reversed when
compared to other FOO vs FOO_CTX in this API may or may not be related.
Anyway, the X509_STORE versions will be demoted to compat defines and the
X509_STORE_CTX will be added to match OpenSSL 1.1 API more closely. This
was pointed out by schwarze a long time ago and missed in a few bumps.
Hopefully we'll manage to do it this time around.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_lu.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_lu.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c index 65d11d9107..584251d18f 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.58 2023/02/16 08:38:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_lu.c,v 1.59 2023/04/16 08:30:21 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 | * |
| @@ -593,8 +593,13 @@ X509_get1_certs_from_cache(X509_STORE *store, X509_NAME *name) | |||
| 593 | return NULL; | 593 | return NULL; |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | #if defined(LIBRESSL_NEXT_API) | ||
| 597 | STACK_OF(X509) * | ||
| 598 | X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name) | ||
| 599 | #else | ||
| 596 | STACK_OF(X509) * | 600 | STACK_OF(X509) * |
| 597 | X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name) | 601 | X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name) |
| 602 | #endif | ||
| 598 | { | 603 | { |
| 599 | X509_STORE *store = ctx->store; | 604 | X509_STORE *store = ctx->store; |
| 600 | STACK_OF(X509) *sk; | 605 | STACK_OF(X509) *sk; |
| @@ -614,10 +619,19 @@ X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name) | |||
| 614 | 619 | ||
| 615 | return X509_get1_certs_from_cache(store, name); | 620 | return X509_get1_certs_from_cache(store, name); |
| 616 | } | 621 | } |
| 622 | #if defined(LIBRESSL_NEXT_API) | ||
| 623 | LCRYPTO_ALIAS(X509_STORE_CTX_get1_certs); | ||
| 624 | #else | ||
| 617 | LCRYPTO_ALIAS(X509_STORE_get1_certs); | 625 | LCRYPTO_ALIAS(X509_STORE_get1_certs); |
| 626 | #endif | ||
| 618 | 627 | ||
| 628 | #if defined(LIBRESSL_NEXT_API) | ||
| 629 | STACK_OF(X509_CRL) * | ||
| 630 | X509_STORE_CTX_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name) | ||
| 631 | #else | ||
| 619 | STACK_OF(X509_CRL) * | 632 | STACK_OF(X509_CRL) * |
| 620 | X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name) | 633 | X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name) |
| 634 | #endif | ||
| 621 | { | 635 | { |
| 622 | X509_STORE *store = ctx->store; | 636 | X509_STORE *store = ctx->store; |
| 623 | STACK_OF(X509_CRL) *sk = NULL; | 637 | STACK_OF(X509_CRL) *sk = NULL; |
| @@ -665,7 +679,11 @@ X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name) | |||
| 665 | sk_X509_CRL_pop_free(sk, X509_CRL_free); | 679 | sk_X509_CRL_pop_free(sk, X509_CRL_free); |
| 666 | return NULL; | 680 | return NULL; |
| 667 | } | 681 | } |
| 682 | #if defined(LIBRESSL_NEXT_API) | ||
| 683 | LCRYPTO_ALIAS(X509_STORE_CTX_get1_crls); | ||
| 684 | #else | ||
| 668 | LCRYPTO_ALIAS(X509_STORE_get1_crls); | 685 | LCRYPTO_ALIAS(X509_STORE_get1_crls); |
| 686 | #endif | ||
| 669 | 687 | ||
| 670 | X509_OBJECT * | 688 | X509_OBJECT * |
| 671 | X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x) | 689 | X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x) |
