-.\" $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 <steve@openssl.org>.
.\" 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
.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
.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
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
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
(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.
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 ,