summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-05-22 09:34:41 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-05-22 09:34:41 +0000
commite9c6211270fff7c455737efe3fd947f3d4bf8423 (patch)
tree47c6bcf41b011bd8e0fd2523847aecf8d19a9978 /lib
parentbfabcd64b37b8fed928e2efa0593a7a9114cd7e8 (diff)
Fix incorrect X509v3_get_ext_by_NID(3) return values
This error comes from upstream, where it is still wrong.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/man/X509v3_get_ext_by_NID.326
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/libcrypto/man/X509v3_get_ext_by_NID.3 b/lib/libcrypto/man/X509v3_get_ext_by_NID.3
index 54e4b583f77..640a72a1358 100644
--- a/lib/libcrypto/man/X509v3_get_ext_by_NID.3
+++ b/lib/libcrypto/man/X509v3_get_ext_by_NID.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.13 2021/07/12 14:54:00 schwarze Exp $
+.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.14 2024/05/22 09:34:40 tb Exp $
.\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 12 2021 $
+.Dd $Mdocdate: May 22 2024 $
.Dt X509V3_GET_EXT_BY_NID 3
.Os
.Sh NAME
@@ -248,7 +248,7 @@ from
The index
.Fa loc
can take any value from 0 to
-.Fn X509_get_ext_count x No - 1 .
+.Fn X509_get_ext_count x No \- 1 .
The returned extension is an internal pointer which must not be
freed up by the application.
.Pp
@@ -265,9 +265,9 @@ The search starts from the extension after
.Fa lastpos
or from the beginning if
.Fa lastpos
-is -1.
-If the extension is found, its index is returned; otherwise, -1 is
-returned.
+is \-1.
+If the extension is found, its index is returned; otherwise, a negative
+value is returned.
.Pp
.Fn X509v3_get_ext_by_critical
is similar to
@@ -300,7 +300,7 @@ at position
.Fa loc .
If
.Fa loc
-is -1, the new extension is added to the end.
+is \-1, the new extension is added to the end.
If
.Pf * Fa x
is
@@ -358,7 +358,7 @@ These search functions start from the extension
.Em after
the
.Fa lastpos
-parameter, so it should initially be set to -1.
+parameter, so it should initially be set to \-1.
If it is set to 0, the initial extension will not be checked.
.Sh RETURN VALUES
.Fn X509v3_get_ext_count
@@ -378,7 +378,14 @@ if an error occurs.
.Fn X509v3_get_ext_by_OBJ ,
and
.Fn X509v3_get_ext_by_critical
-return the extension index or -1 if an error occurs.
+return the extension index or \-1 if an error occurs.
+In addition
+.Fn X509v3_get_ext_by_NID
+returns \-2 if
+.Xr OBJ_nid2obj 3
+fails, which happens if
+.Fa nid
+has no corresponding table object.
.Pp
.Fn X509v3_add_ext
returns a stack of extensions or
@@ -388,6 +395,7 @@ on error.
.Fn X509_add_ext
returns 1 on success or 0 on error.
.Sh SEE ALSO
+.Xr OBJ_nid2obj 3 ,
.Xr X509_CRL_new 3 ,
.Xr X509_EXTENSION_new 3 ,
.Xr X509_new 3 ,