summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2021-11-19 16:00:54 +0000
committerschwarze <>2021-11-19 16:00:54 +0000
commitbf0a7754da3b2b67699a5244a5a180f9cf5ee394 (patch)
tree5a42b1c5bee42beec52ac4a847de361c7a0463b5 /src/lib
parentfea16ad0956deabd721f79aa9eb7735bfd3e1afa (diff)
downloadopenbsd-bf0a7754da3b2b67699a5244a5a180f9cf5ee394.tar.gz
openbsd-bf0a7754da3b2b67699a5244a5a180f9cf5ee394.tar.bz2
openbsd-bf0a7754da3b2b67699a5244a5a180f9cf5ee394.zip
new manual page ASN1_BIT_STRING_num_asc(3)
documenting the three functions using the BIT_STRING_BITNAME structure
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/ASN1_BIT_STRING_num_asc.3146
-rw-r--r--src/lib/libcrypto/man/ASN1_BIT_STRING_set.35
-rw-r--r--src/lib/libcrypto/man/ASN1_STRING_new.35
-rw-r--r--src/lib/libcrypto/man/Makefile3
4 files changed, 154 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/ASN1_BIT_STRING_num_asc.3 b/src/lib/libcrypto/man/ASN1_BIT_STRING_num_asc.3
new file mode 100644
index 0000000000..3891ced8a8
--- /dev/null
+++ b/src/lib/libcrypto/man/ASN1_BIT_STRING_num_asc.3
@@ -0,0 +1,146 @@
1.\" $OpenBSD: ASN1_BIT_STRING_num_asc.3,v 1.1 2021/11/19 16:00:54 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 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: November 19 2021 $
18.Dt ASN1_BIT_STRING_NUM_ASC 3
19.Os
20.Sh NAME
21.Nm ASN1_BIT_STRING_num_asc ,
22.Nm ASN1_BIT_STRING_set_asc ,
23.Nm ASN1_BIT_STRING_name_print
24.Nd names for individual bits
25.Sh SYNOPSIS
26.In openssl/asn1.h
27.Bd -unfilled
28typedef struct {
29 int bitnum;
30 const char *lname;
31 const char *sname;
32} BIT_STRING_BITNAME;
33.Ed
34.Pp
35.Ft int
36.Fo ASN1_BIT_STRING_num_asc
37.Fa "const char *name"
38.Fa "BIT_STRING_BITNAME *table"
39.Fc
40.Ft int
41.Fo ASN1_BIT_STRING_set_asc
42.Fa "ASN1_BIT_STRING *bitstr"
43.Fa "const char *name"
44.Fa "int set"
45.Fa "BIT_STRING_BITNAME *table"
46.Fc
47.Ft int
48.Fo ASN1_BIT_STRING_name_print
49.Fa "BIO *bio"
50.Fa "ASN1_BIT_STRING *bitstr"
51.Fa "BIT_STRING_BITNAME *table"
52.Fa "int indent"
53.Fc
54.Sh DESCRIPTION
55These functions provide access to individual bits of an ASN.1 BIT STRING
56based on a
57.Fa table
58assigning names to individual bits.
59The
60.Fa table
61is a variable-sized array.
62Each element contains a long name
63.Fa lname
64and a short name
65.Fa sname
66for the bit with the bit number
67.Fa bitnum .
68The table needs to be terminated with a dummy element containing a
69.Dv NULL
70pointer in the
71.Fa lname
72field.
73.Pp
74.Fn ASN1_BIT_STRING_num_asc
75retrieves the
76.Fa bitnum
77from the first element in the
78.Fa table
79where at least one of the names matches the
80.Fa name
81argument in the sense of
82.Xr strcmp 3 .
83That bit number can then be used for
84.Xr ASN1_BIT_STRING_get_bit 3 .
85.Pp
86.Fn ASN1_BIT_STRING_set_asc
87converts the
88.Fa name
89to a bit number using
90.Fn ASN1_BIT_STRING_num_asc
91and sets or clears that bit in
92.Fa bitstr
93according to the
94.Fa set
95argument, using
96.Xr ASN1_BIT_STRING_set_bit 3 .
97If
98.Fa bitstr
99is a
100.Dv NULL
101pointer, no action occurs.
102.Pp
103.Fn ASN1_BIT_STRING_name_print
104prints a single line of text to the given
105.Fa BIO .
106The line starts with
107.Fa indent
108space characters, contains the long names of the bit contained in the
109.Fa table
110that are set in
111.Fa bitstr ,
112separated by commas, and ends with a newline character.
113If any bits are set in
114.Fa bitstr
115that have no corresponding entries in the
116.Fa table ,
117those bits are silently ignored and nothing is printed for them.
118.Sh RETURN VALUES
119.Fn ASN1_BIT_STRING_num_asc
120returns a non-negative bit number or \-1 if the
121.Fa name
122is not found in the
123.Fa table .
124.Pp
125.Fn ASN1_BIT_STRING_set_asc
126returns 1 on success or 0 if the
127.Fa name
128is not found in the
129.Fa table
130or if memory allocation fails.
131.Pp
132.Fn ASN1_BIT_STRING_name_print
133is intended to return 1 for success or 0 for failure.
134.Sh SEE ALSO
135.Xr ASN1_BIT_STRING_new 3 ,
136.Xr ASN1_BIT_STRING_set 3 ,
137.Xr BIO_new 3 ,
138.Xr strcmp 3
139.Sh HISTORY
140These functions first appeared in OpenSSL 0.9.5
141and have been available since
142.Ox 2.7 .
143.Sh BUGS
144.Fn ASN1_BIT_STRING_name_print
145ignores all errors and always returns 1,
146even if nothing or only part of the desired output was printed.
diff --git a/src/lib/libcrypto/man/ASN1_BIT_STRING_set.3 b/src/lib/libcrypto/man/ASN1_BIT_STRING_set.3
index 608c3ef1b8..5b18c1c438 100644
--- a/src/lib/libcrypto/man/ASN1_BIT_STRING_set.3
+++ b/src/lib/libcrypto/man/ASN1_BIT_STRING_set.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_BIT_STRING_set.3,v 1.1 2021/11/15 16:18:36 schwarze Exp $ 1.\" $OpenBSD: ASN1_BIT_STRING_set.3,v 1.2 2021/11/19 16:00:54 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: November 15 2021 $ 17.Dd $Mdocdate: November 19 2021 $
18.Dt ASN1_BIT_STRING_SET 3 18.Dt ASN1_BIT_STRING_SET 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -161,6 +161,7 @@ or if no bit is set in
161.Fa bitstr . 161.Fa bitstr .
162.Sh SEE ALSO 162.Sh SEE ALSO
163.Xr ASN1_BIT_STRING_new 3 , 163.Xr ASN1_BIT_STRING_new 3 ,
164.Xr ASN1_BIT_STRING_num_asc 3 ,
164.Xr ASN1_STRING_set 3 , 165.Xr ASN1_STRING_set 3 ,
165.Xr d2i_ASN1_BIT_STRING 3 166.Xr d2i_ASN1_BIT_STRING 3
166.Sh HISTORY 167.Sh HISTORY
diff --git a/src/lib/libcrypto/man/ASN1_STRING_new.3 b/src/lib/libcrypto/man/ASN1_STRING_new.3
index fbc999a325..619ab91e48 100644
--- a/src/lib/libcrypto/man/ASN1_STRING_new.3
+++ b/src/lib/libcrypto/man/ASN1_STRING_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_STRING_new.3,v 1.22 2021/11/15 16:18:36 schwarze Exp $ 1.\" $OpenBSD: ASN1_STRING_new.3,v 1.23 2021/11/19 16:00:54 schwarze Exp $
2.\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 2.\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400
3.\" 3.\"
4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> 4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\" 17.\"
18.Dd $Mdocdate: November 15 2021 $ 18.Dd $Mdocdate: November 19 2021 $
19.Dt ASN1_STRING_NEW 3 19.Dt ASN1_STRING_NEW 3
20.Os 20.Os
21.Sh NAME 21.Sh NAME
@@ -203,6 +203,7 @@ object if successful; otherwise
203is returned and an error code can be retrieved with 203is returned and an error code can be retrieved with
204.Xr ERR_get_error 3 . 204.Xr ERR_get_error 3 .
205.Sh SEE ALSO 205.Sh SEE ALSO
206.Xr ASN1_BIT_STRING_num_asc 3 ,
206.Xr ASN1_BIT_STRING_set 3 , 207.Xr ASN1_BIT_STRING_set 3 ,
207.Xr ASN1_INTEGER_get 3 , 208.Xr ASN1_INTEGER_get 3 ,
208.Xr ASN1_item_pack 3 , 209.Xr ASN1_item_pack 3 ,
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 830c556849..5d3a7d3d23 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,10 +1,11 @@
1# $OpenBSD: Makefile,v 1.216 2021/11/17 16:08:32 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.217 2021/11/19 16:00:54 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5MAN= \ 5MAN= \
6 ACCESS_DESCRIPTION_new.3 \ 6 ACCESS_DESCRIPTION_new.3 \
7 AES_encrypt.3 \ 7 AES_encrypt.3 \
8 ASN1_BIT_STRING_num_asc.3 \
8 ASN1_BIT_STRING_set.3 \ 9 ASN1_BIT_STRING_set.3 \
9 ASN1_INTEGER_get.3 \ 10 ASN1_INTEGER_get.3 \
10 ASN1_OBJECT_new.3 \ 11 ASN1_OBJECT_new.3 \