xref: /openbsd-src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 (revision 0df4f61c8253267ff232f36e42af8352fb8f6bff)
1.\"	$OpenBSD: OpenSSL_add_all_algorithms.3,v 1.3 2016/11/22 21:38:18 jmc Exp $
2.\"
3.Dd $Mdocdate: November 22 2016 $
4.Dt OPENSSL_ADD_ALL_ALGORITHMS 3
5.Os
6.Sh NAME
7.Nm OpenSSL_add_all_algorithms ,
8.Nm OpenSSL_add_all_ciphers ,
9.Nm OpenSSL_add_all_digests ,
10.Nm EVP_cleanup
11.Nd add algorithms to internal table
12.Sh SYNOPSIS
13.In openssl/evp.h
14.Ft void
15.Fn OpenSSL_add_all_algorithms void
16.Ft void
17.Fn OpenSSL_add_all_ciphers void
18.Ft void
19.Fn OpenSSL_add_all_digests void
20.Ft void
21.Fn EVP_cleanup void
22.Sh DESCRIPTION
23OpenSSL keeps an internal table of digest algorithms and ciphers.
24It uses this table to look up ciphers via functions such as
25.Xr EVP_get_cipherbyname 3 .
26.Pp
27.Fn OpenSSL_add_all_algorithms
28adds all algorithms to the table (digests and ciphers).
29.Pp
30.Fn OpenSSL_add_all_digests
31adds all digest algorithms to the table.
32.Pp
33.Fn OpenSSL_add_all_ciphers
34adds all encryption algorithms to the table including password based
35encryption algorithms.
36.Pp
37.Fn EVP_cleanup
38removes all ciphers and digests from the table.
39.Pp
40A typical application will call
41.Fn OpenSSL_add_all_algorithms
42initially and
43.Fn EVP_cleanup
44before exiting.
45.Pp
46An application does not need to add algorithms to use them explicitly,
47for example by
48.Xr EVP_sha1 3 .
49It just needs to add them if it (or any of the functions it calls) needs
50to look up algorithms.
51.Pp
52The cipher and digest lookup functions are used in many parts of the
53library.
54If the table is not initialized, several functions will misbehave and
55complain they cannot find algorithms.
56This includes the PEM, PKCS#12, SSL and S/MIME libraries.
57This is a common query in the OpenSSL mailing lists.
58.Pp
59Calling
60.Fn OpenSSL_add_all_algorithms
61links in all algorithms: as a result a statically linked executable can
62be quite large.
63If this is important, it is possible to just add the required ciphers and
64digests.
65.Sh SEE ALSO
66.Xr evp 3 ,
67.Xr EVP_DigestInit 3 ,
68.Xr EVP_EncryptInit 3
69.Sh BUGS
70Although the functions do not return error codes, it is possible for them
71to fail.
72This will only happen as a result of a memory allocation failure so this
73is not too much of a problem in practice.
74