Provide X509_STORE_CTX_get0_chain() and X509_STORE_CTX_get0_store().
authorjsing <jsing@openbsd.org>
Thu, 22 Feb 2018 17:11:30 +0000 (17:11 +0000)
committerjsing <jsing@openbsd.org>
Thu, 22 Feb 2018 17:11:30 +0000 (17:11 +0000)
lib/libcrypto/Symbols.list
lib/libcrypto/x509/x509_vfy.c
lib/libcrypto/x509/x509_vfy.h

index fe4c0d1..46cb15f 100644 (file)
@@ -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
index 70e03cf..c8ccae5 100644 (file)
@@ -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)
 {
index ed49179..47a1ec6 100644 (file)
@@ -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);