summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2024-12-23 08:39:57 +0000
committerschwarze <>2024-12-23 08:39:57 +0000
commit91ac30d1f192fcfdf38e95c27804a08d2d07bbcb (patch)
tree65de021d1f10fc0640b195a8ae28623fef07bb11 /src
parent5ff25ec0cf88897ba5ecee183e9a8fb02d657ebb (diff)
downloadopenbsd-91ac30d1f192fcfdf38e95c27804a08d2d07bbcb.tar.gz
openbsd-91ac30d1f192fcfdf38e95c27804a08d2d07bbcb.tar.bz2
openbsd-91ac30d1f192fcfdf38e95c27804a08d2d07bbcb.zip
new manual page X509V3_parse_list(3) written from scratch
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509V3_parse_list.3100
2 files changed, 102 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 9c05e70748..fef17409c7 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.302 2024/12/20 01:54:03 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.303 2024/12/23 08:39:57 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -307,6 +307,7 @@ MAN= \
307 X509V3_EXT_print.3 \ 307 X509V3_EXT_print.3 \
308 X509V3_extensions_print.3 \ 308 X509V3_extensions_print.3 \
309 X509V3_get_d2i.3 \ 309 X509V3_get_d2i.3 \
310 X509V3_parse_list.3 \
310 X509_ALGOR_dup.3 \ 311 X509_ALGOR_dup.3 \
311 X509_ATTRIBUTE_get0_object.3 \ 312 X509_ATTRIBUTE_get0_object.3 \
312 X509_ATTRIBUTE_new.3 \ 313 X509_ATTRIBUTE_new.3 \
diff --git a/src/lib/libcrypto/man/X509V3_parse_list.3 b/src/lib/libcrypto/man/X509V3_parse_list.3
new file mode 100644
index 0000000000..7bb508ac7b
--- /dev/null
+++ b/src/lib/libcrypto/man/X509V3_parse_list.3
@@ -0,0 +1,100 @@
1.\" $OpenBSD: X509V3_parse_list.3,v 1.1 2024/12/23 08:39:57 schwarze Exp $
2.\"
3.\" Copyright (c) 2024 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: December 23 2024 $
18.Dt X509V3_PARSE_LIST 3
19.Os
20.Sh NAME
21.Nm X509V3_parse_list ,
22.Nm X509V3_conf_free
23.Nd create and destroy CONF_VALUE objects
24.Sh SYNOPSIS
25.In openssl/x509v3.h
26.Ft STACK_OF(CONF_VALUE) *
27.Fn X509V3_parse_list "const char *string"
28.Ft void
29.Fn X509V3_conf_free "CONF_VALUE *conf"
30.Sh DESCRIPTION
31.Fn X509V3_parse_list
32parses the
33.Fa string
34and allocates an array of
35.Vt CONF_VALUE
36objects according to the following rules.
37.Bl -enum -width 2n
38.It
39The string is split into fields at comma
40.Pq Sq \&,
41characters.
42.It
43If a field contains a colon
44.Pq Sq \&:
45character, the part before the colon is regarded as a name
46and the part after the first colon as the associated value.
47Otherwise, the whole field is regarded as the name and
48.Dv NULL
49is used as the associated value.
50.It
51For each name and each value, leading and trailing whitespace as defined by
52.Xr isspace 3
53is ignored.
54.It
55Parsing ends when a NUL, carriage return, or newline character
56is encountered.
57.El
58.Pp
59A new, empty
60.Vt STACK_OF(CONF_VALUE)
61is allocated and for each parsed name, one
62.Vt CONF_VALUE
63structure containing the optional value is pushed onto it.
64.Pp
65.Fn X509V3_conf_free
66releases all memory used by
67.Fa conf .
68If
69.Fa conf
70is
71.Dv NULL ,
72no action occurs.
73.Pp
74The typical way to release the memory returned from
75.Fn X509V3_parse_list
76is by calling
77.Fn sk_CONF_VALUE_pop_free
78on it, passing a pointer to the function
79.Fn X509V3_conf_free
80as the second argument.
81.Sh RETURN VALUES
82.Fn X509V3_parse_list
83returns the new
84.Vt STACK_OF(CONF_VALUE)
85object or
86.Dv NULL
87if an error occurs, in particular if there isn't any name,
88if the name before a colon or after a comma is empty,
89if the value after a colon is empty,
90or if memory allocation fails.
91.Sh SEE ALSO
92.Xr isspace 3 ,
93.Xr sk_pop_free 3 ,
94.Xr STACK_OF 3
95.Sh HISTORY
96.Fn X509V3_parse_list
97and
98.Fn X509V3_conf_free
99first appeared in OpenSSL 0.9.2 and have been available since
100.Ox 2.6 .