summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-01-31 08:02:53 +0000
committertb <>2024-01-31 08:02:53 +0000
commitfb4609081cb6826359fd9a676b94a527a364b71e (patch)
tree0b6e439c34070ac9ec4b53aacdc883729e9722a5 /src
parent6591873ca140c49434650ec8b1d34017955ca1db (diff)
downloadopenbsd-fb4609081cb6826359fd9a676b94a527a364b71e.tar.gz
openbsd-fb4609081cb6826359fd9a676b94a527a364b71e.tar.bz2
openbsd-fb4609081cb6826359fd9a676b94a527a364b71e.zip
Merge OBJ_NAME_do_all*(3) into EVP_CIPHER_do_all(3)
This is the only OBJ_NAME API that will remain after the next major bump. The API is misnamed and really is about EVP, so move it to an EVP manual documenting another API doing essentially the same thing. Remove most cross references to OBJ_NAME_*.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/EVP_CIPHER_do_all.397
-rw-r--r--src/lib/libcrypto/man/OBJ_NAME_add.345
-rw-r--r--src/lib/libcrypto/man/OBJ_create.35
-rw-r--r--src/lib/libcrypto/man/OBJ_find_sigid_algs.35
-rw-r--r--src/lib/libcrypto/man/OBJ_nid2obj.37
5 files changed, 96 insertions, 63 deletions
diff --git a/src/lib/libcrypto/man/EVP_CIPHER_do_all.3 b/src/lib/libcrypto/man/EVP_CIPHER_do_all.3
index 1d43d503de..9411a41f7d 100644
--- a/src/lib/libcrypto/man/EVP_CIPHER_do_all.3
+++ b/src/lib/libcrypto/man/EVP_CIPHER_do_all.3
@@ -1,6 +1,7 @@
1.\" $OpenBSD: EVP_CIPHER_do_all.3,v 1.1 2023/08/30 00:58:57 tb Exp $ 1.\" $OpenBSD: EVP_CIPHER_do_all.3,v 1.2 2024/01/31 08:02:53 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 3.\" Copyright (c) 2023,2024 Theo Buehler <tb@openbsd.org>
4.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 5.\"
5.\" Permission to use, copy, modify, and distribute this software for any 6.\" 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.\" purpose with or without fee is hereby granted, provided that the above
@@ -14,7 +15,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 17.\"
17.Dd $Mdocdate: August 30 2023 $ 18.Dd $Mdocdate: January 31 2024 $
18.Dt EVP_CIPHER_DO_ALL 3 19.Dt EVP_CIPHER_DO_ALL 3
19.Os 20.Os
20.Sh NAME 21.Sh NAME
@@ -49,6 +50,27 @@
49 const char *to, void *arg)" 50 const char *to, void *arg)"
50.Fa "void *arg" 51.Fa "void *arg"
51.Fc 52.Fc
53.Bd -literal
54typedef struct {
55 int type;
56 int alias;
57 const char *name;
58 const char *data;
59} OBJ_NAME;
60.Ed
61.Pp
62.Ft void
63.Fo OBJ_NAME_do_all
64.Fa "int type"
65.Fa "void (*fn)(const OBJ_NAME *obj_name, void *arg)"
66.Fa "void *arg"
67.Fc
68.Ft void
69.Fo OBJ_NAME_do_all_sorted
70.Fa "int type"
71.Fa "void (*fn)(const OBJ_NAME *obj_name, void *arg)"
72.Fa "void *arg"
73.Fc
52.Sh DESCRIPTION 74.Sh DESCRIPTION
53.Fn EVP_CIPHER_do_all 75.Fn EVP_CIPHER_do_all
54calls 76calls
@@ -117,18 +139,71 @@ in lexicographic order of their
117.Fa from 139.Fa from
118names as determined by 140names as determined by
119.Xr strcmp 3 . 141.Xr strcmp 3 .
142.Pp
143.Vt OBJ_NAME
144is an abstraction of the types underlying the lookup tables
145for ciphers and their aliases, and digests and their aliases, respectively.
146For a cipher,
147.Fa type
148is
149.Dv OBJ_NAME_TYPE_CIPHER_METH ,
150.Fa alias
151is 0,
152.Fa name
153is its lookup name and
154.Fa data
155is the
156.Vt EVP_CIPHER
157object it represents, cast to
158.Vt const char * .
159For a cipher alias,
160.Fa type
161is
162.Dv OBJ_NAME_TYPE_CIPHER_METH ,
163.Fa alias
164is
165.Dv OBJ_NAME_ALIAS ,
166.Fa name
167is its lookup name and
168.Fa data
169is the name it aliases.
170Digests representing an
171.Vt EVP_MD
172object and their aliases are represented similarly, except that their type is
173.Dv OBJ_NAME_TYPE_MD_METH .
174.Pp
175.Fn OBJ_NAME_do_all
176calls
177.Fa fn
178on every
179.Fa obj_name
180in the table that has the given
181.Fa type
182(either
183.Dv OBJ_NAME_TYPE_CIPHER_METH
184or
185.Dv OBJ_NAME_TYPE_MD_METH ) ,
186also passing the
187.Fa arg
188pointer.
189.Fn OBJ_NAME_do_all_sorted
190is similar except that it processes the
191.Fa obj_name
192in lexicographic order of their names as determined by
193.Xr strcmp 3 .
120.Sh SEE ALSO 194.Sh SEE ALSO
121.Xr evp 3 , 195.Xr evp 3 ,
122.Xr EVP_add_cipher 3 , 196.Xr EVP_get_cipherbyname 3 ,
123.Xr OBJ_NAME_do_all 3 197.Xr EVP_get_digestbyname 3
124.Sh HISTORY 198.Sh HISTORY
125These functions first appeared in OpenSSL 1.0.0 and have been available since 199These functions first appeared in OpenSSL 1.0.0 and have been available since
126.Ox 4.9 . 200.Ox 4.9 .
127.Sh BUGS 201.Sh CAVEATS
128.Fn EVP_CIPHER_do_all_sorted 202.Fn EVP_CIPHER_do_all_sorted ,
203.Fn EVP_MD_do_all_sorted ,
129and 204and
130.Fn EVP_MD_do_all_sorted 205.Fn OBJ_NAME_do_all_sorted
131are wrappers of 206cannot report errors.
132.Xr OBJ_NAME_do_all_sorted 3 . 207In some implementations they need to allocate internally and
133In particular, if memory allocation fails, they do nothing at all 208if memory allocation fails they do nothing at all,
134without telling the caller about the problem. 209without telling the caller about the problem.
diff --git a/src/lib/libcrypto/man/OBJ_NAME_add.3 b/src/lib/libcrypto/man/OBJ_NAME_add.3
index ad2ba80893..0b46010c49 100644
--- a/src/lib/libcrypto/man/OBJ_NAME_add.3
+++ b/src/lib/libcrypto/man/OBJ_NAME_add.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OBJ_NAME_add.3,v 1.5 2023/09/01 12:13:13 schwarze Exp $ 1.\" $OpenBSD: OBJ_NAME_add.3,v 1.6 2024/01/31 08:02:53 tb 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: September 1 2023 $ 17.Dd $Mdocdate: January 31 2024 $
18.Dt OBJ_NAME_ADD 3 18.Dt OBJ_NAME_ADD 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -23,9 +23,7 @@
23.Nm OBJ_NAME_get , 23.Nm OBJ_NAME_get ,
24.Nm OBJ_NAME_new_index , 24.Nm OBJ_NAME_new_index ,
25.Nm OBJ_NAME_init , 25.Nm OBJ_NAME_init ,
26.Nm OBJ_NAME_cleanup , 26.Nm OBJ_NAME_cleanup
27.Nm OBJ_NAME_do_all ,
28.Nm OBJ_NAME_do_all_sorted
29.Nd global associative array 27.Nd global associative array
30.Sh SYNOPSIS 28.Sh SYNOPSIS
31.In openssl/objects.h 29.In openssl/objects.h
@@ -63,19 +61,6 @@ typedef struct {
63 const char *data; 61 const char *data;
64} OBJ_NAME; 62} OBJ_NAME;
65.Ed 63.Ed
66.Pp
67.Ft void
68.Fo OBJ_NAME_do_all
69.Fa "int type"
70.Fa "void (*fn)(const OBJ_NAME *pair, void *arg)"
71.Fa "void *arg"
72.Fc
73.Ft void
74.Fo OBJ_NAME_do_all_sorted
75.Fa "int type"
76.Fa "void (*fn)(const OBJ_NAME *pair, void *arg)"
77.Fa "void *arg"
78.Fc
79.Sh DESCRIPTION 64.Sh DESCRIPTION
80These functions implement a single, static associative array 65These functions implement a single, static associative array
81with the following properties: 66with the following properties:
@@ -264,25 +249,6 @@ If the
264field is 0, the 249field is 0, the
265.Fa data 250.Fa data
266field contains the value; otherwise, it contains the alias target name. 251field contains the value; otherwise, it contains the alias target name.
267.Pp
268.Fn OBJ_NAME_do_all
269calls
270.Fa fn
271on every
272.Fa pair
273and alias in the array that has the given
274.Fa type ,
275also passing the
276.Fa arg
277pointer.
278.Fn OBJ_NAME_do_all_sorted
279is similar except that it processes the pairs and aliases
280in lexicographic order of their names as determined by
281.Xr strcmp 3 ,
282ignoring any
283.Fa cmp_func
284that may be defined for the
285.Fa type .
286.Sh RETURN VALUES 252.Sh RETURN VALUES
287.Fn OBJ_NAME_add 253.Fn OBJ_NAME_add
288and 254and
@@ -339,8 +305,3 @@ that requires more cleanup than merely calling
339.Xr free 3 305.Xr free 3
340on it, instances of the type need to begin with a magic number or string 306on it, instances of the type need to begin with a magic number or string
341that cannot occur at the beginning of a name. 307that cannot occur at the beginning of a name.
342.Pp
343.Fn OBJ_NAME_do_all_sorted
344is unable to report errors.
345If memory allocations fails, it does nothing at all
346without telling the caller about the problem.
diff --git a/src/lib/libcrypto/man/OBJ_create.3 b/src/lib/libcrypto/man/OBJ_create.3
index 6bc255e981..fa5bde3dd3 100644
--- a/src/lib/libcrypto/man/OBJ_create.3
+++ b/src/lib/libcrypto/man/OBJ_create.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OBJ_create.3,v 1.9 2024/01/13 19:06:20 tb Exp $ 1.\" $OpenBSD: OBJ_create.3,v 1.10 2024/01/31 08:02:53 tb Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400 3.\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400
4.\" selective merge up to: 4.\" selective merge up to:
@@ -69,7 +69,7 @@
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE. 70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\" 71.\"
72.Dd $Mdocdate: January 13 2024 $ 72.Dd $Mdocdate: January 31 2024 $
73.Dt OBJ_CREATE 3 73.Dt OBJ_CREATE 3
74.Os 74.Os
75.Sh NAME 75.Sh NAME
@@ -200,7 +200,6 @@ obj = OBJ_nid2obj(new_nid);
200.Ed 200.Ed
201.Sh SEE ALSO 201.Sh SEE ALSO
202.Xr ASN1_OBJECT_new 3 , 202.Xr ASN1_OBJECT_new 3 ,
203.Xr OBJ_NAME_add 3 ,
204.Xr OBJ_nid2obj 3 203.Xr OBJ_nid2obj 3
205.Sh HISTORY 204.Sh HISTORY
206.Fn OBJ_new_nid , 205.Fn OBJ_new_nid ,
diff --git a/src/lib/libcrypto/man/OBJ_find_sigid_algs.3 b/src/lib/libcrypto/man/OBJ_find_sigid_algs.3
index 9aeb54c90b..1d7a2b649b 100644
--- a/src/lib/libcrypto/man/OBJ_find_sigid_algs.3
+++ b/src/lib/libcrypto/man/OBJ_find_sigid_algs.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OBJ_find_sigid_algs.3,v 1.1 2023/07/22 06:35:26 tb Exp $ 1.\" $OpenBSD: OBJ_find_sigid_algs.3,v 1.2 2024/01/31 08:02:53 tb 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: July 22 2023 $ 17.Dd $Mdocdate: January 31 2024 $
18.Dt OBJ_FIND_SIGID_ALGS 3 18.Dt OBJ_FIND_SIGID_ALGS 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -82,7 +82,6 @@ is not built into the library.
82.Sh SEE ALSO 82.Sh SEE ALSO
83.Xr EVP_cleanup 3 , 83.Xr EVP_cleanup 3 ,
84.Xr OBJ_create 3 , 84.Xr OBJ_create 3 ,
85.Xr OBJ_NAME_add 3 ,
86.Xr OBJ_nid2obj 3 85.Xr OBJ_nid2obj 3
87.Sh HISTORY 86.Sh HISTORY
88These functions first appeared in OpenSSL 1.0.0 87These functions first appeared in OpenSSL 1.0.0
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3
index 4e420b8311..ccab1ed30c 100644
--- a/src/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/src/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OBJ_nid2obj.3,v 1.21 2023/09/05 13:50:22 schwarze Exp $ 1.\" $OpenBSD: OBJ_nid2obj.3,v 1.22 2024/01/31 08:02:53 tb Exp $
2.\" full merge up to: OpenSSL c264592d May 14 11:28:00 2006 +0000 2.\" full merge up to: OpenSSL c264592d May 14 11:28:00 2006 +0000
3.\" selective merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200 3.\" selective merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200
4.\" 4.\"
@@ -67,7 +67,7 @@
67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
68.\" OF THE POSSIBILITY OF SUCH DAMAGE. 68.\" OF THE POSSIBILITY OF SUCH DAMAGE.
69.\" 69.\"
70.Dd $Mdocdate: September 5 2023 $ 70.Dd $Mdocdate: January 31 2024 $
71.Dt OBJ_NID2OBJ 3 71.Dt OBJ_NID2OBJ 3
72.Os 72.Os
73.Sh NAME 73.Sh NAME
@@ -435,8 +435,7 @@ object = OBJ_txt2obj("1.2.3.4", 1);
435.Xr ASN1_OBJECT_new 3 , 435.Xr ASN1_OBJECT_new 3 ,
436.Xr BIO_new 3 , 436.Xr BIO_new 3 ,
437.Xr d2i_ASN1_OBJECT 3 , 437.Xr d2i_ASN1_OBJECT 3 ,
438.Xr OBJ_create 3 , 438.Xr OBJ_create 3
439.Xr OBJ_NAME_add 3
440.Sh HISTORY 439.Sh HISTORY
441.Fn OBJ_nid2obj , 440.Fn OBJ_nid2obj ,
442.Fn OBJ_nid2ln , 441.Fn OBJ_nid2ln ,