From: jsing Date: Thu, 22 Feb 2018 17:11:30 +0000 (+0000) Subject: Provide X509_STORE_CTX_get0_chain() and X509_STORE_CTX_get0_store(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3fbdcad130d313f0c25cba8287c7b1cc3706dbe6;p=openbsd Provide X509_STORE_CTX_get0_chain() and X509_STORE_CTX_get0_store(). --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index fe4c0d1c4ed..46cb15fc431 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2833,11 +2833,13 @@ X509_SIG_new X509_STORE_CTX_cleanup X509_STORE_CTX_free X509_STORE_CTX_get0_cert +X509_STORE_CTX_get0_chain X509_STORE_CTX_get0_current_crl X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_param X509_STORE_CTX_get0_parent_ctx X509_STORE_CTX_get0_policy_tree +X509_STORE_CTX_get0_store X509_STORE_CTX_get0_untrusted X509_STORE_CTX_get1_chain X509_STORE_CTX_get1_issuer diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c index 70e03cf436c..c8ccae5029c 100644 --- a/lib/libcrypto/x509/x509_vfy.c +++ b/lib/libcrypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.67 2018/02/14 17:06:34 jsing Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.68 2018/02/22 17:11:30 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2023,12 +2023,20 @@ X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) return ctx->current_cert; } -STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) +STACK_OF(X509) * +X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) { return ctx->chain; } -STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) +STACK_OF(X509) * +X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs) +{ + return xs->chain; +} + +STACK_OF(X509) * +X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) { int i; X509 *x; @@ -2061,6 +2069,12 @@ X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx) return ctx->parent; } +X509_STORE * +X509_STORE_CTX_get0_store(X509_STORE_CTX *xs) +{ + return xs->ctx; +} + void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) { diff --git a/lib/libcrypto/x509/x509_vfy.h b/lib/libcrypto/x509/x509_vfy.h index ed491791337..47a1ec67922 100644 --- a/lib/libcrypto/x509/x509_vfy.h +++ b/lib/libcrypto/x509/x509_vfy.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.h,v 1.20 2018/02/14 17:06:34 jsing Exp $ */ +/* $OpenBSD: x509_vfy.h,v 1.21 2018/02/22 17:11:30 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -447,6 +447,8 @@ void X509_STORE_CTX_free(X509_STORE_CTX *ctx); int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain); X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs); +X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *xs); STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);