From fa2d9de703f0090c30f45cb99f79591dad4ed787 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 17 Feb 2018 15:13:12 +0000 Subject: Provide SSL_CTX_get0_certificate() --- src/lib/libssl/ssl_lib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 16f2b54637..79021d7e0b 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.174 2018/02/14 17:08:44 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.175 2018/02/17 15:13:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2877,6 +2877,15 @@ SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store) ctx->cert_store = store; } +X509 * +SSL_CTX_get0_certificate(const SSL_CTX *ctx) +{ + if (ctx->internal->cert == NULL) + return NULL; + + return ctx->internal->cert->key->x509; +} + int SSL_want(const SSL *s) { -- cgit v1.2.3-55-g6feb