From e9cbf9a916bad5435d684cd832d9bd6250284e77 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 24 Feb 2018 20:57:49 +0000 Subject: [PATCH] In x509.h rev. 1.33 2018/02/22 16:47:50, jsing@ provided X509_REVOKED_get0_extensions(3) and in rev. 1.36 2018/02/22 16:58:45 X509_CRL_get0_extensions(3). Merge the documentation from OpenSSL and fix a few minor typos while here. --- lib/libcrypto/man/X509V3_get_d2i.3 | 43 +++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/lib/libcrypto/man/X509V3_get_d2i.3 b/lib/libcrypto/man/X509V3_get_d2i.3 index b28b84089cc..f21471b00cc 100644 --- a/lib/libcrypto/man/X509V3_get_d2i.3 +++ b/lib/libcrypto/man/X509V3_get_d2i.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: X509V3_get_d2i.3,v 1.7 2018/02/19 07:59:23 schwarze Exp $ -.\" full merge up to: OpenSSL 047dd81e Jul 4 23:03:17 2014 +0100 +.\" $OpenBSD: X509V3_get_d2i.3,v 1.8 2018/02/24 20:57:49 schwarze Exp $ +.\" full merge up to: OpenSSL ff7fbfd5 Nov 2 11:52:01 2015 +0000 .\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 19 2018 $ +.Dd $Mdocdate: February 24 2018 $ .Dt X509V3_GET_D2I 3 .Os .Sh NAME @@ -63,7 +63,9 @@ .Nm X509_CRL_add1_ext_i2d , .Nm X509_REVOKED_get_ext_d2i , .Nm X509_REVOKED_add1_ext_i2d , -.Nm X509_get0_extensions +.Nm X509_get0_extensions , +.Nm X509_CRL_get0_extensions , +.Nm X509_REVOKED_get0_extensions .Nd X509 extension decode and encode functions .Sh SYNOPSIS .In openssl/x509v3.h @@ -137,10 +139,18 @@ .Fa "int crit" .Fa "unsigned long flags" .Fc -.Ft const STACK_OF(X509_EXTENSION) +.Ft const STACK_OF(X509_EXTENSION) * .Fo X509_get0_extensions .Fa "const X509 *x" .Fc +.Ft const STACK_OF(X509_EXTENSION) * +.Fo X509_CRL_get0_extensions +.Fa "const X509_CRL *crl" +.Fc +.Ft const STACK_OF(X509_EXTENSION) * +.Fo X509_REVOKED_get0_extensions +.Fa "const X509_REVOKED *r" +.Fc .Sh DESCRIPTION .Fn X509V3_get_d2i looks for an extension with OID @@ -210,7 +220,7 @@ operate on the extensions of certificate and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . .Pp .Fn X509_CRL_get_ext_d2i and @@ -220,7 +230,7 @@ operate on the extensions of CRL and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . .Pp .Fn X509_REVOKED_get_ext_d2i and @@ -232,10 +242,14 @@ structure (i.e. for CRL entry extensions), and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . .Pp -.Fn X509_get0_extensions -returns a stack of all the extensions of a certificate. +.Fn X509_get0_extensions , +.Fn X509_CRL_get0_extensions , +and +.Fn X509_REVOKED_get0_extensions +return a stack of all the extensions of a certificate, a CRL, +or a CRL entry, respectively. .Pp In almost all cases an extension can occur at most once and multiple occurrences is an error. @@ -373,8 +387,13 @@ returns 1 if the operation is successful, 0 if it fails due to a non-fatal error (extension not found, already exists, cannot be encoded), or -1 due to a fatal error such as a memory allocation failure. .Pp -.Fn X509_get0_extensions -returns a stack of extensions. +.Fn X509_get0_extensions , +.Fn X509_CRL_get0_extensions , +and +.Fn X509_REVOKED_get0_extensions +return a stack of extensions, or +.Dv NULL +if no extensions are present. .Sh SEE ALSO .Xr d2i_X509 3 , .Xr d2i_X509_EXTENSION 3 , -- 2.20.1