5 OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests, EVP_cleanup -
6 add algorithms to internal table
10 #include <openssl/evp.h>
14 # if OPENSSL_API_COMPAT < 0x10100000L
15 # define OPENSSL_add_all_algorithms_conf() \
16 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
17 | OPENSSL_INIT_ADD_ALL_DIGESTS \
18 | OPENSSL_INIT_LOAD_CONFIG, NULL)
19 # define OPENSSL_add_all_algorithms_noconf() \
20 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
21 | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
23 # ifdef OPENSSL_LOAD_CONF
24 # define OpenSSL_add_all_algorithms() \
25 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
26 | OPENSSL_INIT_ADD_ALL_DIGESTS \
27 | OPENSSL_INIT_LOAD_CONFIG, NULL)
29 # define OpenSSL_add_all_algorithms() \
30 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
31 | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
34 # define OpenSSL_add_all_ciphers() \
35 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL)
36 # define OpenSSL_add_all_digests() \
37 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
39 # define EVP_cleanup()
44 OpenSSL keeps an internal table of digest algorithms and ciphers. It uses
45 this table to lookup ciphers via functions such as EVP_get_cipher_byname(). In
46 OpenSSL versions prior to 1.1.0 these functions initialised and de-initialised
47 this table. From OpenSSL 1.1.0 are deprecated. No explicit initialisation or
48 de-initialisation is required. See L<OPENSSL_init_crypto(3)> for further
51 OpenSSL_add_all_digests() adds all digest algorithms to the table.
53 OpenSSL_add_all_algorithms() adds all algorithms to the table (digests and
56 OpenSSL_add_all_ciphers() adds all encryption algorithms to the table including
57 password based encryption algorithms.
59 In versions prior to 1.1.0 EVP_cleanup() removed all ciphers and digests from
60 the table. It no longer has any effect in OpenSSL 1.1.0.
64 None of the functions return a value.
68 A typical application will call OpenSSL_add_all_algorithms() initially and
69 EVP_cleanup() before exiting.
71 An application does not need to add algorithms to use them explicitly, for example
72 by EVP_sha1(). It just needs to add them if it (or any of the functions it calls)
73 needs to lookup algorithms.
75 The cipher and digest lookup functions are used in many parts of the library. If
76 the table is not initialized several functions will misbehave and complain they
77 cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries.
78 This is a common query in the OpenSSL mailing lists.
80 Calling OpenSSL_add_all_algorithms() links in all algorithms: as a result a
81 statically linked executable can be quite large. If this is important it is possible
82 to just add the required ciphers and digests.
86 Although the functions do not return error codes it is possible for them to fail.
87 This will only happen as a result of a memory allocation failure so this is not
88 too much of a problem in practice.
92 L<evp(3)>, L<EVP_DigestInit(3)>,
97 The OpenSSL_add_all_algorithms(), OpenSSL_add_all_ciphers(),
98 OpenSSL_add_all_digests(), and EVP_cleanup(), functions
99 were deprecated in OpenSSL 1.1.0 by OPENSSL_init_crypto().