78fe12aa3f65007f500ee5dc983eb31e7ebbae4c
[openssl.git] / doc / crypto / OpenSSL_add_all_algorithms.pod
1 =pod
2
3 =head1 NAME
4
5 OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests, EVP_cleanup -
6 add algorithms to internal table
7
8 =head1 SYNOPSIS
9
10  #include <openssl/evp.h>
11
12 Deprecated:
13
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)
22
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)
28  #  else
29  #   define OpenSSL_add_all_algorithms() \
30      OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
31                          | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
32  #  endif
33
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)
38
39  #  define EVP_cleanup()
40 # endif
41
42 =head1 DESCRIPTION
43
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
49 information.
50
51 OpenSSL_add_all_digests() adds all digest algorithms to the table.
52
53 OpenSSL_add_all_algorithms() adds all algorithms to the table (digests and
54 ciphers).
55
56 OpenSSL_add_all_ciphers() adds all encryption algorithms to the table including
57 password based encryption algorithms.
58
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.
61
62 =head1 RETURN VALUES
63
64 None of the functions return a value.
65
66 =head1 NOTES
67
68 A typical application will call OpenSSL_add_all_algorithms() initially and
69 EVP_cleanup() before exiting.
70
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.
74
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.
79
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.
83
84 =head1 BUGS
85
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.
89
90 =head1 SEE ALSO
91
92 L<evp(3)>, L<EVP_DigestInit(3)>,
93 L<EVP_EncryptInit(3)>
94
95 =head1 HISTORY
96
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().
100
101 =cut