From 747d60986848bd4eec39b1e49097f775ad0d93f1 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sun, 18 Feb 2018 22:18:59 +0000 Subject: [PATCH] In ssl.h rev. 1.138 2018/02/17 15:13:12, jsing@ provided SSL_CTX_get0_certificate(3). It is public in OpenSSL, too, but OpenSSL has no documentation, so write some from scratch. --- lib/libssl/man/Makefile | 3 +- lib/libssl/man/SSL_CTX_get0_certificate.3 | 46 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 lib/libssl/man/SSL_CTX_get0_certificate.3 diff --git a/lib/libssl/man/Makefile b/lib/libssl/man/Makefile index 96daeb89755..963e1037e9d 100644 --- a/lib/libssl/man/Makefile +++ b/lib/libssl/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.59 2017/08/21 10:10:25 schwarze Exp $ +# $OpenBSD: Makefile,v 1.60 2018/02/18 22:18:59 schwarze Exp $ .include @@ -14,6 +14,7 @@ MAN = BIO_f_ssl.3 \ SSL_CTX_free.3 \ SSL_CTX_get_ex_new_index.3 \ SSL_CTX_get_verify_mode.3 \ + SSL_CTX_get0_certificate.3 \ SSL_CTX_load_verify_locations.3 \ SSL_CTX_new.3 \ SSL_CTX_sess_number.3 \ diff --git a/lib/libssl/man/SSL_CTX_get0_certificate.3 b/lib/libssl/man/SSL_CTX_get0_certificate.3 new file mode 100644 index 00000000000..39869120351 --- /dev/null +++ b/lib/libssl/man/SSL_CTX_get0_certificate.3 @@ -0,0 +1,46 @@ +.\" $OpenBSD: SSL_CTX_get0_certificate.3,v 1.1 2018/02/18 22:18:59 schwarze Exp $ +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: February 18 2018 $ +.Dt SSL_CTX_GET0_CERTIFICATE 3 +.Os +.Sh NAME +.Nm SSL_CTX_get0_certificate +.Nd get the active certificate from an SSL context +.Sh SYNOPSIS +.Ft X509 * +.Fo SSL_CTX_get0_certificate +.Fa "const SSL_CTX *ctx" +.Fc +.Sh DESCRIPTION +The +.Fn SSL_CTX_get0_certificate +function returns an internal pointer +to the ASN.1 certificate currently active in +.Fa ctx +or +.Dv NULL +if none was installed with +.Xr SSL_CTX_use_certificate 3 +or similar functions. +.Pp +The returned pointer must not be freed by the caller. +.Sh SEE ALSO +.Xr SSL_CTX_new 3 , +.Xr SSL_CTX_use_certificate 3 , +.Xr X509_get_pubkey 3 , +.Xr X509_get_subject_name 3 , +.Xr X509_new 3 -- 2.20.1