diff options
author | jsing <> | 2018-02-22 17:17:09 +0000 |
---|---|---|
committer | jsing <> | 2018-02-22 17:17:09 +0000 |
commit | 9bb8b88ba75274cdfc424822a5a98bff2c8788bd (patch) | |
tree | 5955fc3176564b42fce86c77f77227f7987038fd /src/lib/libcrypto/x509/x509_lu.c | |
parent | 025b01ee745f943fc9de80a0e0f9499ce3a5c982 (diff) | |
download | openbsd-9bb8b88ba75274cdfc424822a5a98bff2c8788bd.tar.gz openbsd-9bb8b88ba75274cdfc424822a5a98bff2c8788bd.tar.bz2 openbsd-9bb8b88ba75274cdfc424822a5a98bff2c8788bd.zip |
Provide X509_OBJECT_get0_X509() and X509_OBJECT_get0_X509_CRL().
Diffstat (limited to 'src/lib/libcrypto/x509/x509_lu.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_lu.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c index 175b8b6c05..3a28c06d20 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.24 2018/02/22 17:15:09 jsing Exp $ */ | 1 | /* $OpenBSD: x509_lu.c,v 1.25 2018/02/22 17:17:09 jsing 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 | * |
@@ -533,6 +533,22 @@ X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type, | |||
533 | return sk_X509_OBJECT_value(h, idx); | 533 | return sk_X509_OBJECT_value(h, idx); |
534 | } | 534 | } |
535 | 535 | ||
536 | X509 * | ||
537 | X509_OBJECT_get0_X509(const X509_OBJECT *xo) | ||
538 | { | ||
539 | if (xo != NULL && xo->type == X509_LU_X509) | ||
540 | return xo->data.x509; | ||
541 | return NULL; | ||
542 | } | ||
543 | |||
544 | X509_CRL * | ||
545 | X509_OBJECT_get0_X509_CRL(X509_OBJECT *xo) | ||
546 | { | ||
547 | if (xo != NULL && xo->type == X509_LU_CRL) | ||
548 | return xo->data.crl; | ||
549 | return NULL; | ||
550 | } | ||
551 | |||
536 | STACK_OF(X509) * | 552 | STACK_OF(X509) * |
537 | X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) | 553 | X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) |
538 | { | 554 | { |
@@ -656,7 +672,6 @@ X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x) | |||
656 | return NULL; | 672 | return NULL; |
657 | } | 673 | } |
658 | 674 | ||
659 | |||
660 | /* Try to get issuer certificate from store. Due to limitations | 675 | /* Try to get issuer certificate from store. Due to limitations |
661 | * of the API this can only retrieve a single certificate matching | 676 | * of the API this can only retrieve a single certificate matching |
662 | * a given subject name. However it will fill the cache with all | 677 | * a given subject name. However it will fill the cache with all |