summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-02-22 17:11:30 +0000
committerjsing <>2018-02-22 17:11:30 +0000
commitdc18b99a087245f0dff9151ef1568c40cdbc5f5b (patch)
tree66c4637bce20d46b0ef21598cda39b58ae0dda8e
parent638272e9dee92abeb527a8cf07528a81219edc22 (diff)
downloadopenbsd-dc18b99a087245f0dff9151ef1568c40cdbc5f5b.tar.gz
openbsd-dc18b99a087245f0dff9151ef1568c40cdbc5f5b.tar.bz2
openbsd-dc18b99a087245f0dff9151ef1568c40cdbc5f5b.zip
Provide X509_STORE_CTX_get0_chain() and X509_STORE_CTX_get0_store().
-rw-r--r--src/lib/libcrypto/Symbols.list2
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c20
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h4
3 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index fe4c0d1c4e..46cb15fc43 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -2833,11 +2833,13 @@ X509_SIG_new
2833X509_STORE_CTX_cleanup 2833X509_STORE_CTX_cleanup
2834X509_STORE_CTX_free 2834X509_STORE_CTX_free
2835X509_STORE_CTX_get0_cert 2835X509_STORE_CTX_get0_cert
2836X509_STORE_CTX_get0_chain
2836X509_STORE_CTX_get0_current_crl 2837X509_STORE_CTX_get0_current_crl
2837X509_STORE_CTX_get0_current_issuer 2838X509_STORE_CTX_get0_current_issuer
2838X509_STORE_CTX_get0_param 2839X509_STORE_CTX_get0_param
2839X509_STORE_CTX_get0_parent_ctx 2840X509_STORE_CTX_get0_parent_ctx
2840X509_STORE_CTX_get0_policy_tree 2841X509_STORE_CTX_get0_policy_tree
2842X509_STORE_CTX_get0_store
2841X509_STORE_CTX_get0_untrusted 2843X509_STORE_CTX_get0_untrusted
2842X509_STORE_CTX_get1_chain 2844X509_STORE_CTX_get1_chain
2843X509_STORE_CTX_get1_issuer 2845X509_STORE_CTX_get1_issuer
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 70e03cf436..c8ccae5029 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.67 2018/02/14 17:06:34 jsing Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.68 2018/02/22 17:11:30 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 *
@@ -2023,12 +2023,20 @@ X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx)
2023 return ctx->current_cert; 2023 return ctx->current_cert;
2024} 2024}
2025 2025
2026STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) 2026STACK_OF(X509) *
2027X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx)
2027{ 2028{
2028 return ctx->chain; 2029 return ctx->chain;
2029} 2030}
2030 2031
2031STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) 2032STACK_OF(X509) *
2033X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs)
2034{
2035 return xs->chain;
2036}
2037
2038STACK_OF(X509) *
2039X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx)
2032{ 2040{
2033 int i; 2041 int i;
2034 X509 *x; 2042 X509 *x;
@@ -2061,6 +2069,12 @@ X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx)
2061 return ctx->parent; 2069 return ctx->parent;
2062} 2070}
2063 2071
2072X509_STORE *
2073X509_STORE_CTX_get0_store(X509_STORE_CTX *xs)
2074{
2075 return xs->ctx;
2076}
2077
2064void 2078void
2065X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) 2079X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x)
2066{ 2080{
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index ed49179133..47a1ec6792 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.h,v 1.20 2018/02/14 17:06:34 jsing Exp $ */ 1/* $OpenBSD: x509_vfy.h,v 1.21 2018/02/22 17:11:30 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 *
@@ -447,6 +447,8 @@ void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
447int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, 447int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
448 X509 *x509, STACK_OF(X509) *chain); 448 X509 *x509, STACK_OF(X509) *chain);
449X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); 449X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx);
450STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs);
451X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *xs);
450STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); 452STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx);
451void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 453void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
452void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 454void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);