aboutsummaryrefslogtreecommitdiff
path: root/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3
diff options
context:
space:
mode:
Diffstat (limited to 'secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3')
-rw-r--r--secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.397
1 files changed, 57 insertions, 40 deletions
diff --git a/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 b/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3
index e2671252b801..62b27506a161 100644
--- a/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3
+++ b/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -68,8 +68,6 @@
. \}
.\}
.rr rF
-.\"
-.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
@@ -132,14 +130,23 @@
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
-.IX Title "X509V3_GET_EXT_BY_NID 3"
-.TH X509V3_GET_EXT_BY_NID 3 "2022-06-21" "1.1.1p" "OpenSSL"
+.IX Title "X509V3_GET_EXT_BY_NID 3ossl"
+.TH X509V3_GET_EXT_BY_NID 3ossl "2023-09-19" "3.0.11" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-X509v3_get_ext_count, X509v3_get_ext, X509v3_get_ext_by_NID, X509v3_get_ext_by_OBJ, X509v3_get_ext_by_critical, X509v3_delete_ext, X509v3_add_ext, X509_get_ext_count, X509_get_ext, X509_get_ext_by_NID, X509_get_ext_by_OBJ, X509_get_ext_by_critical, X509_delete_ext, X509_add_ext, X509_CRL_get_ext_count, X509_CRL_get_ext, X509_CRL_get_ext_by_NID, X509_CRL_get_ext_by_OBJ, X509_CRL_get_ext_by_critical, X509_CRL_delete_ext, X509_CRL_add_ext, X509_REVOKED_get_ext_count, X509_REVOKED_get_ext, X509_REVOKED_get_ext_by_NID, X509_REVOKED_get_ext_by_OBJ, X509_REVOKED_get_ext_by_critical, X509_REVOKED_delete_ext, X509_REVOKED_add_ext \- extension stack utility functions
+X509v3_get_ext_count, X509v3_get_ext, X509v3_get_ext_by_NID,
+X509v3_get_ext_by_OBJ, X509v3_get_ext_by_critical, X509v3_delete_ext,
+X509v3_add_ext, X509_get_ext_count, X509_get_ext,
+X509_get_ext_by_NID, X509_get_ext_by_OBJ, X509_get_ext_by_critical,
+X509_delete_ext, X509_add_ext, X509_CRL_get_ext_count, X509_CRL_get_ext,
+X509_CRL_get_ext_by_NID, X509_CRL_get_ext_by_OBJ, X509_CRL_get_ext_by_critical,
+X509_CRL_delete_ext, X509_CRL_add_ext, X509_REVOKED_get_ext_count,
+X509_REVOKED_get_ext, X509_REVOKED_get_ext_by_NID, X509_REVOKED_get_ext_by_OBJ,
+X509_REVOKED_get_ext_by_critical, X509_REVOKED_delete_ext,
+X509_REVOKED_add_ext \- extension stack utility functions
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
@@ -169,7 +176,8 @@ X509v3_get_ext_count, X509v3_get_ext, X509v3_get_ext_by_NID, X509v3_get_ext_by_O
\& int X509_CRL_get_ext_count(const X509_CRL *x);
\& X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
\& int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos);
-\& int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos);
+\& int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
+\& int lastpos);
\& int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos);
\& X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
\& int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
@@ -185,70 +193,79 @@ X509v3_get_ext_count, X509v3_get_ext, X509v3_get_ext_by_NID, X509v3_get_ext_by_O
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-\&\fBX509v3_get_ext_count()\fR retrieves the number of extensions in \fBx\fR.
+\&\fBX509v3_get_ext_count()\fR retrieves the number of extensions in \fIx\fR.
.PP
-\&\fBX509v3_get_ext()\fR retrieves extension \fBloc\fR from \fBx\fR. The index \fBloc\fR
-can take any value from \fB0\fR to X509_get_ext_count(x) \- 1. The returned
-extension is an internal pointer which \fBmust not\fR be freed up by the
+\&\fBX509v3_get_ext()\fR retrieves extension \fIloc\fR from \fIx\fR. The index \fIloc\fR
+can take any value from 0 to X509_get_ext_count(\fIx\fR) \- 1. The returned
+extension is an internal pointer which \fB\s-1MUST NOT\s0\fR be freed by the
application.
.PP
\&\fBX509v3_get_ext_by_NID()\fR and \fBX509v3_get_ext_by_OBJ()\fR look for an extension
-with \fBnid\fR or \fBobj\fR from extension stack \fBx\fR. The search starts from the
-extension after \fBlastpos\fR or from the beginning if <lastpos> is \fB\-1\fR. If
-the extension is found its index is returned otherwise \fB\-1\fR is returned.
+with \fInid\fR or \fIobj\fR from extension \s-1STACK\s0 \fIx\fR. The search starts from the
+extension after \fIlastpos\fR or from the beginning if \fIlastpos\fR is \-1. If
+the extension is found, its index is returned, otherwise \-1 is returned.
.PP
\&\fBX509v3_get_ext_by_critical()\fR is similar to \fBX509v3_get_ext_by_NID()\fR except it
-looks for an extension of criticality \fBcrit\fR. A zero value for \fBcrit\fR
-looks for a non-critical extension a nonzero value looks for a critical
+looks for an extension of criticality \fIcrit\fR. A zero value for \fIcrit\fR
+looks for a non-critical extension. A nonzero value looks for a critical
extension.
.PP
-\&\fBX509v3_delete_ext()\fR deletes the extension with index \fBloc\fR from \fBx\fR. The
-deleted extension is returned and must be freed by the caller. If \fBloc\fR
-is in invalid index value \fB\s-1NULL\s0\fR is returned.
+\&\fBX509v3_delete_ext()\fR deletes the extension with index \fIloc\fR from \fIx\fR.
+The deleted extension is returned and must be freed by the caller.
+If \fIloc\fR is an invalid index value, \s-1NULL\s0 is returned.
.PP
-\&\fBX509v3_add_ext()\fR adds extension \fBex\fR to stack \fB*x\fR at position \fBloc\fR. If
-\&\fBloc\fR is \fB\-1\fR the new extension is added to the end. If \fB*x\fR is \fB\s-1NULL\s0\fR
-a new stack will be allocated. The passed extension \fBex\fR is duplicated
+\&\fBX509v3_add_ext()\fR adds extension \fIex\fR to \s-1STACK\s0 \fI*x\fR at position \fIloc\fR. If
+\&\fIloc\fR is \-1, the new extension is added to the end. If \fI*x\fR is \s-1NULL,\s0
+a new \s-1STACK\s0 will be allocated. The passed extension \fIex\fR is duplicated
internally so it must be freed after use.
.PP
\&\fBX509_get_ext_count()\fR, \fBX509_get_ext()\fR, \fBX509_get_ext_by_NID()\fR,
\&\fBX509_get_ext_by_OBJ()\fR, \fBX509_get_ext_by_critical()\fR, \fBX509_delete_ext()\fR
-and \fBX509_add_ext()\fR operate on the extensions of certificate \fBx\fR they are
+and \fBX509_add_ext()\fR operate on the extensions of certificate \fIx\fR. They are
otherwise identical to the X509v3 functions.
.PP
\&\fBX509_CRL_get_ext_count()\fR, \fBX509_CRL_get_ext()\fR, \fBX509_CRL_get_ext_by_NID()\fR,
\&\fBX509_CRL_get_ext_by_OBJ()\fR, \fBX509_CRL_get_ext_by_critical()\fR,
\&\fBX509_CRL_delete_ext()\fR and \fBX509_CRL_add_ext()\fR operate on the extensions of
-\&\s-1CRL\s0 \fBx\fR they are otherwise identical to the X509v3 functions.
+\&\s-1CRL\s0 \fIx\fR. They are otherwise identical to the X509v3 functions.
.PP
\&\fBX509_REVOKED_get_ext_count()\fR, \fBX509_REVOKED_get_ext()\fR,
\&\fBX509_REVOKED_get_ext_by_NID()\fR, \fBX509_REVOKED_get_ext_by_OBJ()\fR,
\&\fBX509_REVOKED_get_ext_by_critical()\fR, \fBX509_REVOKED_delete_ext()\fR and
-\&\fBX509_REVOKED_add_ext()\fR operate on the extensions of \s-1CRL\s0 entry \fBx\fR
-they are otherwise identical to the X509v3 functions.
+\&\fBX509_REVOKED_add_ext()\fR operate on the extensions of \s-1CRL\s0 entry \fIx\fR.
+They are otherwise identical to the X509v3 functions.
.SH "NOTES"
.IX Header "NOTES"
-These functions are used to examine stacks of extensions directly. Many
-applications will want to parse or encode and add an extension: they should
-use the extension encode and decode functions instead such as
+These functions are used to examine stacks of extensions directly.
+Applications that want to parse or encode and add an extension should
+use the extension encode and decode functions instead, such as
\&\fBX509_add1_ext_i2d()\fR and \fBX509_get_ext_d2i()\fR.
.PP
-Extension indices start from zero, so a zero index return value is \fBnot\fR an
-error. These search functions start from the extension \fBafter\fR the \fBlastpos\fR
-parameter so it should initially be set to \fB\-1\fR, if it is set to zero the
-initial extension will not be checked.
+For \fBX509v3_get_ext_by_NID()\fR, \fBX509v3_get_ext_by_OBJ()\fR,
+\&\fBX509v3_get_ext_by_critical()\fR and its variants, a zero index return value
+is not an error since extension \s-1STACK\s0 \fIx\fR indices start from zero.
+These search functions start from the extension \fBafter\fR the \fIlastpos\fR parameter
+so it should initially be set to \-1. If it is set to zero, the initial extension
+will not be checked.
+.PP
+\&\fBX509v3_delete_ext()\fR and its variants are a bit counter-intuitive
+because these functions do not free the extension they delete.
+They return an \fBX509_EXTENSION\fR object which must be explicitly freed
+using \fBX509_EXTENSION_free()\fR.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
-\&\fBX509v3_get_ext_count()\fR returns the extension count.
+\&\fBX509v3_get_ext_count()\fR returns the extension count or 0 for failure.
.PP
\&\fBX509v3_get_ext()\fR, \fBX509v3_delete_ext()\fR and \fBX509_delete_ext()\fR return an
-\&\fBX509_EXTENSION\fR pointer or \fB\s-1NULL\s0\fR if an error occurs.
+\&\fBX509_EXTENSION\fR structure or \s-1NULL\s0 if an error occurs.
+.PP
+\&\fBX509v3_get_ext_by_OBJ()\fR and \fBX509v3_get_ext_by_critical()\fR return
+the extension index or \-1 if an error occurs.
.PP
-\&\fBX509v3_get_ext_by_NID()\fR \fBX509v3_get_ext_by_OBJ()\fR and
-\&\fBX509v3_get_ext_by_critical()\fR return the an extension index or \fB\-1\fR if an
+\&\fBX509v3_get_ext_by_NID()\fR returns the extension index or negative values if an
error occurs.
.PP
-\&\fBX509v3_add_ext()\fR returns a stack of extensions or \fB\s-1NULL\s0\fR on error.
+\&\fBX509v3_add_ext()\fR returns a \s-1STACK\s0 of extensions or \s-1NULL\s0 on error.
.PP
\&\fBX509_add_ext()\fR returns 1 on success and 0 on error.
.SH "SEE ALSO"
@@ -256,9 +273,9 @@ error occurs.
\&\fBX509V3_get_d2i\fR\|(3)
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
-Copyright 2015\-2020 The OpenSSL Project Authors. All Rights Reserved.
+Copyright 2015\-2022 The OpenSSL Project Authors. All Rights Reserved.
.PP
-Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
+Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file \s-1LICENSE\s0 in the source distribution or at
<https://www.openssl.org/source/license.html>.