Add aliases for des-ede-ecb and des-ede3-ecb ciphers.
[openssl.git] / crypto / evp / c_allc.c
1 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2  * All rights reserved.
3  *
4  * This package is an SSL implementation written
5  * by Eric Young (eay@cryptsoft.com).
6  * The implementation was written so as to conform with Netscapes SSL.
7  *
8  * This library is free for commercial and non-commercial use as long as
9  * the following conditions are aheared to.  The following conditions
10  * apply to all code found in this distribution, be it the RC4, RSA,
11  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
12  * included with this distribution is covered by the same copyright terms
13  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14  *
15  * Copyright remains Eric Young's, and as such any Copyright notices in
16  * the code are not to be removed.
17  * If this package is used in a product, Eric Young should be given attribution
18  * as the author of the parts of the library used.
19  * This can be in the form of a textual message at program startup or
20  * in documentation (online or textual) provided with the package.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the copyright
26  *    notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  *    notice, this list of conditions and the following disclaimer in the
29  *    documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  *    must display the following acknowledgement:
32  *    "This product includes cryptographic software written by
33  *     Eric Young (eay@cryptsoft.com)"
34  *    The word 'cryptographic' can be left out if the rouines from the library
35  *    being used are not cryptographic related :-).
36  * 4. If you include any Windows specific code (or a derivative thereof) from
37  *    the apps directory (application code) you must include an acknowledgement:
38  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39  *
40  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE.
51  *
52  * The licence and distribution terms for any publically available version or
53  * derivative of this code cannot be changed.  i.e. this code cannot simply be
54  * copied and put under another distribution licence
55  * [including the GNU Public Licence.]
56  */
57
58 #include <stdio.h>
59 #include "internal/cryptlib.h"
60 #include <openssl/evp.h>
61 #include <internal/evp_int.h>
62 #include <openssl/pkcs12.h>
63 #include <openssl/objects.h>
64
65 void openssl_add_all_ciphers_int(void)
66 {
67
68 #ifndef OPENSSL_NO_DES
69     EVP_add_cipher(EVP_des_cfb());
70     EVP_add_cipher(EVP_des_cfb1());
71     EVP_add_cipher(EVP_des_cfb8());
72     EVP_add_cipher(EVP_des_ede_cfb());
73     EVP_add_cipher(EVP_des_ede3_cfb());
74     EVP_add_cipher(EVP_des_ede3_cfb1());
75     EVP_add_cipher(EVP_des_ede3_cfb8());
76
77     EVP_add_cipher(EVP_des_ofb());
78     EVP_add_cipher(EVP_des_ede_ofb());
79     EVP_add_cipher(EVP_des_ede3_ofb());
80
81     EVP_add_cipher(EVP_desx_cbc());
82     EVP_add_cipher_alias(SN_desx_cbc, "DESX");
83     EVP_add_cipher_alias(SN_desx_cbc, "desx");
84
85     EVP_add_cipher(EVP_des_cbc());
86     EVP_add_cipher_alias(SN_des_cbc, "DES");
87     EVP_add_cipher_alias(SN_des_cbc, "des");
88     EVP_add_cipher(EVP_des_ede_cbc());
89     EVP_add_cipher(EVP_des_ede3_cbc());
90     EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
91     EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
92
93     EVP_add_cipher(EVP_des_ecb());
94     EVP_add_cipher(EVP_des_ede());
95     EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
96     EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
97     EVP_add_cipher(EVP_des_ede3());
98     EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
99     EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
100     EVP_add_cipher(EVP_des_ede3_wrap());
101     EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
102 #endif
103
104 #ifndef OPENSSL_NO_RC4
105     EVP_add_cipher(EVP_rc4());
106     EVP_add_cipher(EVP_rc4_40());
107 # ifndef OPENSSL_NO_MD5
108     EVP_add_cipher(EVP_rc4_hmac_md5());
109 # endif
110 #endif
111
112 #ifndef OPENSSL_NO_IDEA
113     EVP_add_cipher(EVP_idea_ecb());
114     EVP_add_cipher(EVP_idea_cfb());
115     EVP_add_cipher(EVP_idea_ofb());
116     EVP_add_cipher(EVP_idea_cbc());
117     EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
118     EVP_add_cipher_alias(SN_idea_cbc, "idea");
119 #endif
120
121 #ifndef OPENSSL_NO_SEED
122     EVP_add_cipher(EVP_seed_ecb());
123     EVP_add_cipher(EVP_seed_cfb());
124     EVP_add_cipher(EVP_seed_ofb());
125     EVP_add_cipher(EVP_seed_cbc());
126     EVP_add_cipher_alias(SN_seed_cbc, "SEED");
127     EVP_add_cipher_alias(SN_seed_cbc, "seed");
128 #endif
129
130 #ifndef OPENSSL_NO_RC2
131     EVP_add_cipher(EVP_rc2_ecb());
132     EVP_add_cipher(EVP_rc2_cfb());
133     EVP_add_cipher(EVP_rc2_ofb());
134     EVP_add_cipher(EVP_rc2_cbc());
135     EVP_add_cipher(EVP_rc2_40_cbc());
136     EVP_add_cipher(EVP_rc2_64_cbc());
137     EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
138     EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
139     EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
140     EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
141     EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
142 #endif
143
144 #ifndef OPENSSL_NO_BF
145     EVP_add_cipher(EVP_bf_ecb());
146     EVP_add_cipher(EVP_bf_cfb());
147     EVP_add_cipher(EVP_bf_ofb());
148     EVP_add_cipher(EVP_bf_cbc());
149     EVP_add_cipher_alias(SN_bf_cbc, "BF");
150     EVP_add_cipher_alias(SN_bf_cbc, "bf");
151     EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
152 #endif
153
154 #ifndef OPENSSL_NO_CAST
155     EVP_add_cipher(EVP_cast5_ecb());
156     EVP_add_cipher(EVP_cast5_cfb());
157     EVP_add_cipher(EVP_cast5_ofb());
158     EVP_add_cipher(EVP_cast5_cbc());
159     EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
160     EVP_add_cipher_alias(SN_cast5_cbc, "cast");
161     EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
162     EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
163 #endif
164
165 #ifndef OPENSSL_NO_RC5
166     EVP_add_cipher(EVP_rc5_32_12_16_ecb());
167     EVP_add_cipher(EVP_rc5_32_12_16_cfb());
168     EVP_add_cipher(EVP_rc5_32_12_16_ofb());
169     EVP_add_cipher(EVP_rc5_32_12_16_cbc());
170     EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
171     EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
172 #endif
173
174     EVP_add_cipher(EVP_aes_128_ecb());
175     EVP_add_cipher(EVP_aes_128_cbc());
176     EVP_add_cipher(EVP_aes_128_cfb());
177     EVP_add_cipher(EVP_aes_128_cfb1());
178     EVP_add_cipher(EVP_aes_128_cfb8());
179     EVP_add_cipher(EVP_aes_128_ofb());
180     EVP_add_cipher(EVP_aes_128_ctr());
181     EVP_add_cipher(EVP_aes_128_gcm());
182 #ifndef OPENSSL_NO_OCB
183     EVP_add_cipher(EVP_aes_128_ocb());
184 #endif
185     EVP_add_cipher(EVP_aes_128_xts());
186     EVP_add_cipher(EVP_aes_128_ccm());
187     EVP_add_cipher(EVP_aes_128_wrap());
188     EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
189     EVP_add_cipher(EVP_aes_128_wrap_pad());
190     EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
191     EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
192     EVP_add_cipher(EVP_aes_192_ecb());
193     EVP_add_cipher(EVP_aes_192_cbc());
194     EVP_add_cipher(EVP_aes_192_cfb());
195     EVP_add_cipher(EVP_aes_192_cfb1());
196     EVP_add_cipher(EVP_aes_192_cfb8());
197     EVP_add_cipher(EVP_aes_192_ofb());
198     EVP_add_cipher(EVP_aes_192_ctr());
199     EVP_add_cipher(EVP_aes_192_gcm());
200 #ifndef OPENSSL_NO_OCB
201     EVP_add_cipher(EVP_aes_192_ocb());
202 #endif
203     EVP_add_cipher(EVP_aes_192_ccm());
204     EVP_add_cipher(EVP_aes_192_wrap());
205     EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
206     EVP_add_cipher(EVP_aes_192_wrap_pad());
207     EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
208     EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
209     EVP_add_cipher(EVP_aes_256_ecb());
210     EVP_add_cipher(EVP_aes_256_cbc());
211     EVP_add_cipher(EVP_aes_256_cfb());
212     EVP_add_cipher(EVP_aes_256_cfb1());
213     EVP_add_cipher(EVP_aes_256_cfb8());
214     EVP_add_cipher(EVP_aes_256_ofb());
215     EVP_add_cipher(EVP_aes_256_ctr());
216     EVP_add_cipher(EVP_aes_256_gcm());
217 #ifndef OPENSSL_NO_OCB
218     EVP_add_cipher(EVP_aes_256_ocb());
219 #endif
220     EVP_add_cipher(EVP_aes_256_xts());
221     EVP_add_cipher(EVP_aes_256_ccm());
222     EVP_add_cipher(EVP_aes_256_wrap());
223     EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
224     EVP_add_cipher(EVP_aes_256_wrap_pad());
225     EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
226     EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
227     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
228     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
229     EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
230     EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
231
232 #ifndef OPENSSL_NO_CAMELLIA
233     EVP_add_cipher(EVP_camellia_128_ecb());
234     EVP_add_cipher(EVP_camellia_128_cbc());
235     EVP_add_cipher(EVP_camellia_128_cfb());
236     EVP_add_cipher(EVP_camellia_128_cfb1());
237     EVP_add_cipher(EVP_camellia_128_cfb8());
238     EVP_add_cipher(EVP_camellia_128_ofb());
239     EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
240     EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
241     EVP_add_cipher(EVP_camellia_192_ecb());
242     EVP_add_cipher(EVP_camellia_192_cbc());
243     EVP_add_cipher(EVP_camellia_192_cfb());
244     EVP_add_cipher(EVP_camellia_192_cfb1());
245     EVP_add_cipher(EVP_camellia_192_cfb8());
246     EVP_add_cipher(EVP_camellia_192_ofb());
247     EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
248     EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
249     EVP_add_cipher(EVP_camellia_256_ecb());
250     EVP_add_cipher(EVP_camellia_256_cbc());
251     EVP_add_cipher(EVP_camellia_256_cfb());
252     EVP_add_cipher(EVP_camellia_256_cfb1());
253     EVP_add_cipher(EVP_camellia_256_cfb8());
254     EVP_add_cipher(EVP_camellia_256_ofb());
255     EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
256     EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
257     EVP_add_cipher(EVP_camellia_128_ctr());
258     EVP_add_cipher(EVP_camellia_192_ctr());
259     EVP_add_cipher(EVP_camellia_256_ctr());
260 #endif
261
262 #ifndef OPENSSL_NO_CHACHA
263     EVP_add_cipher(EVP_chacha20());
264 # ifndef OPENSSL_NO_POLY1305
265     EVP_add_cipher(EVP_chacha20_poly1305());
266 # endif
267 #endif
268 }