summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-08-30 00:58:57 +0000
committertb <>2023-08-30 00:58:57 +0000
commit1aa9536098c9828d022dfa472e268174a5592d14 (patch)
treebac43d507ba79cd2a54c25ac7a9b240404253823 /src/lib
parent6374d451ab78e6a8b8173aa5795b5e7f4c9c1081 (diff)
downloadopenbsd-1aa9536098c9828d022dfa472e268174a5592d14.tar.gz
openbsd-1aa9536098c9828d022dfa472e268174a5592d14.tar.bz2
openbsd-1aa9536098c9828d022dfa472e268174a5592d14.zip
Document EVP_{CIPHER,MD}_do_all{,_sorted}(3)
The function prototypes in the SYNOPSIS don't look great, but schwarze assures me that this is how it is supposed to be. It is rather strange that OpenSSL chose to sprinkle OPENSSL_init_crypto() calls into these four functions rather than two inside OBJ_NAME_do_all{,_sorted}(3). Surely there was a good reason for that. With input and fixes from schwarze
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_CIPHER_do_all.3134
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/evp.35
3 files changed, 139 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/EVP_CIPHER_do_all.3 b/src/lib/libcrypto/man/EVP_CIPHER_do_all.3
new file mode 100644
index 0000000000..1d43d503de
--- /dev/null
+++ b/src/lib/libcrypto/man/EVP_CIPHER_do_all.3
@@ -0,0 +1,134 @@
1.\" $OpenBSD: EVP_CIPHER_do_all.3,v 1.1 2023/08/30 00:58:57 tb Exp $
2.\"
3.\" Copyright (c) 2023 Theo Buehler <tb@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: August 30 2023 $
18.Dt EVP_CIPHER_DO_ALL 3
19.Os
20.Sh NAME
21.Nm EVP_CIPHER_do_all ,
22.Nm EVP_CIPHER_do_all_sorted ,
23.Nm EVP_MD_do_all ,
24.Nm EVP_MD_do_all_sorted
25.Nd iterate over lookup tables for ciphers and digests
26.Sh SYNOPSIS
27.In openssl/evp.h
28.Ft void
29.Fo EVP_CIPHER_do_all
30.Fa "void (*fn)(const EVP_CIPHER *cipher, const char *from,\
31 const char *to, void *arg)"
32.Fa "void *arg"
33.Fc
34.Ft void
35.Fo EVP_CIPHER_do_all_sorted
36.Fa "void (*fn)(const EVP_CIPHER *cipher, const char *from,\
37 const char *to, void *arg)"
38.Fa "void *arg"
39.Fc
40.Ft void
41.Fo EVP_MD_do_all
42.Fa "void (*fn)(const EVP_MD *md, const char *from,\
43 const char *to, void *arg)"
44.Fa "void *arg"
45.Fc
46.Ft void
47.Fo EVP_MD_do_all_sorted
48.Fa "void (*fn)(const EVP_MD *md, const char *from,\
49 const char *to, void *arg)"
50.Fa "void *arg"
51.Fc
52.Sh DESCRIPTION
53.Fn EVP_CIPHER_do_all
54calls
55.Fa fn
56on every entry of the global table of cipher names and aliases.
57For a cipher name entry,
58.Fa fn
59is called with a non-NULL
60.Fa cipher ,
61its non-NULL cipher name
62.Fa from ,
63a NULL
64.Fa to ,
65and the
66.Fa arg
67pointer.
68For an alias entry,
69.Fa fn
70is called with a NULL
71.Fa cipher ,
72its alias
73.Fa from ,
74the cipher name that alias points
75.Fa to ,
76and the
77.Fa arg
78pointer.
79.Pp
80.Fn EVP_CIPHER_do_all_sorted
81is similar, except that it processes the cipher names and aliases
82in lexicographic order of their
83.Fa from
84names as determined by
85.Xr strcmp 3 .
86.Pp
87.Fn EVP_MD_do_all
88calls
89.Fa fn
90on every entry of the global table of digest names and aliases.
91For a digest name entry,
92.Fa fn
93is called with a non-NULL
94.Fa md ,
95its non-NULL digest name
96.Fa from ,
97a NULL
98.Fa to ,
99and the
100.Fa arg
101pointer.
102For an alias entry,
103.Fa fn
104is called with a NULL
105.Fa md ,
106its alias
107.Fa from ,
108the digest name that alias points
109.Fa to ,
110and the
111.Fa arg
112pointer.
113.Pp
114.Fn EVP_MD_do_all_sorted
115is similar, except that it processes the digest names and aliases
116in lexicographic order of their
117.Fa from
118names as determined by
119.Xr strcmp 3 .
120.Sh SEE ALSO
121.Xr evp 3 ,
122.Xr EVP_add_cipher 3 ,
123.Xr OBJ_NAME_do_all 3
124.Sh HISTORY
125These functions first appeared in OpenSSL 1.0.0 and have been available since
126.Ox 4.9 .
127.Sh BUGS
128.Fn EVP_CIPHER_do_all_sorted
129and
130.Fn EVP_MD_do_all_sorted
131are wrappers of
132.Xr OBJ_NAME_do_all_sorted 3 .
133In particular, if memory allocation fails, they do nothing at all
134without telling the caller about the problem.
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 2c243f7fec..4052638e0e 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.264 2023/08/27 15:33:08 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.265 2023/08/30 00:58:57 tb Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -165,6 +165,7 @@ MAN= \
165 EVP_AEAD_CTX_init.3 \ 165 EVP_AEAD_CTX_init.3 \
166 EVP_BytesToKey.3 \ 166 EVP_BytesToKey.3 \
167 EVP_CIPHER_CTX_get_cipher_data.3 \ 167 EVP_CIPHER_CTX_get_cipher_data.3 \
168 EVP_CIPHER_do_all.3 \
168 EVP_CIPHER_meth_new.3 \ 169 EVP_CIPHER_meth_new.3 \
169 EVP_DigestInit.3 \ 170 EVP_DigestInit.3 \
170 EVP_DigestSignInit.3 \ 171 EVP_DigestSignInit.3 \
diff --git a/src/lib/libcrypto/man/evp.3 b/src/lib/libcrypto/man/evp.3
index d53fa94fe1..3b93d8ba64 100644
--- a/src/lib/libcrypto/man/evp.3
+++ b/src/lib/libcrypto/man/evp.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: evp.3,v 1.20 2023/08/27 15:33:08 schwarze Exp $ 1.\" $OpenBSD: evp.3,v 1.21 2023/08/30 00:58:57 tb Exp $
2.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100 2.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>, 4.\" This file was written by Ulf Moeller <ulf@openssl.org>,
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: August 27 2023 $ 54.Dd $Mdocdate: August 30 2023 $
55.Dt EVP 3 55.Dt EVP 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -200,6 +200,7 @@ operations are more efficient using the high-level interfaces.
200.Xr EVP_camellia_128_cbc 3 , 200.Xr EVP_camellia_128_cbc 3 ,
201.Xr EVP_chacha20 3 , 201.Xr EVP_chacha20 3 ,
202.Xr EVP_CIPHER_CTX_get_cipher_data 3 , 202.Xr EVP_CIPHER_CTX_get_cipher_data 3 ,
203.Xr EVP_CIPHER_do_all 3 ,
203.Xr EVP_CIPHER_meth_new 3 , 204.Xr EVP_CIPHER_meth_new 3 ,
204.Xr EVP_des_cbc 3 , 205.Xr EVP_des_cbc 3 ,
205.Xr EVP_DigestInit 3 , 206.Xr EVP_DigestInit 3 ,