1/*
2 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdio.h>
11#include "internal/cryptlib.h"
12#include <openssl/evp.h>
13#include "crypto/evp.h"
14#include <openssl/pkcs12.h>
15#include <openssl/objects.h>
16
17void openssl_add_all_ciphers_int(void)
18{
19
20#ifndef OPENSSL_NO_DES
21 EVP_add_cipher(EVP_des_cfb());
22 EVP_add_cipher(EVP_des_cfb1());
23 EVP_add_cipher(EVP_des_cfb8());
24 EVP_add_cipher(EVP_des_ede_cfb());
25 EVP_add_cipher(EVP_des_ede3_cfb());
26 EVP_add_cipher(EVP_des_ede3_cfb1());
27 EVP_add_cipher(EVP_des_ede3_cfb8());
28
29 EVP_add_cipher(EVP_des_ofb());
30 EVP_add_cipher(EVP_des_ede_ofb());
31 EVP_add_cipher(EVP_des_ede3_ofb());
32
33 EVP_add_cipher(EVP_desx_cbc());
34 EVP_add_cipher_alias(SN_desx_cbc, "DESX");
35 EVP_add_cipher_alias(SN_desx_cbc, "desx");
36
37 EVP_add_cipher(EVP_des_cbc());
38 EVP_add_cipher_alias(SN_des_cbc, "DES");
39 EVP_add_cipher_alias(SN_des_cbc, "des");
40 EVP_add_cipher(EVP_des_ede_cbc());
41 EVP_add_cipher(EVP_des_ede3_cbc());
42 EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
43 EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
44
45 EVP_add_cipher(EVP_des_ecb());
46 EVP_add_cipher(EVP_des_ede());
47 EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
48 EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
49 EVP_add_cipher(EVP_des_ede3());
50 EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
51 EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
52 EVP_add_cipher(EVP_des_ede3_wrap());
53 EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
54#endif
55
56#ifndef OPENSSL_NO_RC4
57 EVP_add_cipher(EVP_rc4());
58 EVP_add_cipher(EVP_rc4_40());
59# ifndef OPENSSL_NO_MD5
60 EVP_add_cipher(EVP_rc4_hmac_md5());
61# endif
62#endif
63
64#ifndef OPENSSL_NO_IDEA
65 EVP_add_cipher(EVP_idea_ecb());
66 EVP_add_cipher(EVP_idea_cfb());
67 EVP_add_cipher(EVP_idea_ofb());
68 EVP_add_cipher(EVP_idea_cbc());
69 EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
70 EVP_add_cipher_alias(SN_idea_cbc, "idea");
71#endif
72
73#ifndef OPENSSL_NO_SEED
74 EVP_add_cipher(EVP_seed_ecb());
75 EVP_add_cipher(EVP_seed_cfb());
76 EVP_add_cipher(EVP_seed_ofb());
77 EVP_add_cipher(EVP_seed_cbc());
78 EVP_add_cipher_alias(SN_seed_cbc, "SEED");
79 EVP_add_cipher_alias(SN_seed_cbc, "seed");
80#endif
81
82#ifndef OPENSSL_NO_SM4
83 EVP_add_cipher(EVP_sm4_ecb());
84 EVP_add_cipher(EVP_sm4_cbc());
85 EVP_add_cipher(EVP_sm4_cfb());
86 EVP_add_cipher(EVP_sm4_ofb());
87 EVP_add_cipher(EVP_sm4_ctr());
88 EVP_add_cipher_alias(SN_sm4_cbc, "SM4");
89 EVP_add_cipher_alias(SN_sm4_cbc, "sm4");
90#endif
91
92#ifndef OPENSSL_NO_RC2
93 EVP_add_cipher(EVP_rc2_ecb());
94 EVP_add_cipher(EVP_rc2_cfb());
95 EVP_add_cipher(EVP_rc2_ofb());
96 EVP_add_cipher(EVP_rc2_cbc());
97 EVP_add_cipher(EVP_rc2_40_cbc());
98 EVP_add_cipher(EVP_rc2_64_cbc());
99 EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
100 EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
101 EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
102 EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
103 EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
104#endif
105
106#ifndef OPENSSL_NO_BF
107 EVP_add_cipher(EVP_bf_ecb());
108 EVP_add_cipher(EVP_bf_cfb());
109 EVP_add_cipher(EVP_bf_ofb());
110 EVP_add_cipher(EVP_bf_cbc());
111 EVP_add_cipher_alias(SN_bf_cbc, "BF");
112 EVP_add_cipher_alias(SN_bf_cbc, "bf");
113 EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
114#endif
115
116#ifndef OPENSSL_NO_CAST
117 EVP_add_cipher(EVP_cast5_ecb());
118 EVP_add_cipher(EVP_cast5_cfb());
119 EVP_add_cipher(EVP_cast5_ofb());
120 EVP_add_cipher(EVP_cast5_cbc());
121 EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
122 EVP_add_cipher_alias(SN_cast5_cbc, "cast");
123 EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
124 EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
125#endif
126
127#ifndef OPENSSL_NO_RC5
128 EVP_add_cipher(EVP_rc5_32_12_16_ecb());
129 EVP_add_cipher(EVP_rc5_32_12_16_cfb());
130 EVP_add_cipher(EVP_rc5_32_12_16_ofb());
131 EVP_add_cipher(EVP_rc5_32_12_16_cbc());
132 EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
133 EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
134#endif
135
136 EVP_add_cipher(EVP_aes_128_ecb());
137 EVP_add_cipher(EVP_aes_128_cbc());
138 EVP_add_cipher(EVP_aes_128_cfb());
139 EVP_add_cipher(EVP_aes_128_cfb1());
140 EVP_add_cipher(EVP_aes_128_cfb8());
141 EVP_add_cipher(EVP_aes_128_ofb());
142 EVP_add_cipher(EVP_aes_128_ctr());
143 EVP_add_cipher(EVP_aes_128_gcm());
144#ifndef OPENSSL_NO_OCB
145 EVP_add_cipher(EVP_aes_128_ocb());
146#endif
147 EVP_add_cipher(EVP_aes_128_xts());
148 EVP_add_cipher(EVP_aes_128_ccm());
149 EVP_add_cipher(EVP_aes_128_wrap());
150 EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
151 EVP_add_cipher(EVP_aes_128_wrap_pad());
152 EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
153 EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
154 EVP_add_cipher(EVP_aes_192_ecb());
155 EVP_add_cipher(EVP_aes_192_cbc());
156 EVP_add_cipher(EVP_aes_192_cfb());
157 EVP_add_cipher(EVP_aes_192_cfb1());
158 EVP_add_cipher(EVP_aes_192_cfb8());
159 EVP_add_cipher(EVP_aes_192_ofb());
160 EVP_add_cipher(EVP_aes_192_ctr());
161 EVP_add_cipher(EVP_aes_192_gcm());
162#ifndef OPENSSL_NO_OCB
163 EVP_add_cipher(EVP_aes_192_ocb());
164#endif
165 EVP_add_cipher(EVP_aes_192_ccm());
166 EVP_add_cipher(EVP_aes_192_wrap());
167 EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
168 EVP_add_cipher(EVP_aes_192_wrap_pad());
169 EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
170 EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
171 EVP_add_cipher(EVP_aes_256_ecb());
172 EVP_add_cipher(EVP_aes_256_cbc());
173 EVP_add_cipher(EVP_aes_256_cfb());
174 EVP_add_cipher(EVP_aes_256_cfb1());
175 EVP_add_cipher(EVP_aes_256_cfb8());
176 EVP_add_cipher(EVP_aes_256_ofb());
177 EVP_add_cipher(EVP_aes_256_ctr());
178 EVP_add_cipher(EVP_aes_256_gcm());
179#ifndef OPENSSL_NO_OCB
180 EVP_add_cipher(EVP_aes_256_ocb());
181#endif
182 EVP_add_cipher(EVP_aes_256_xts());
183 EVP_add_cipher(EVP_aes_256_ccm());
184 EVP_add_cipher(EVP_aes_256_wrap());
185 EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
186 EVP_add_cipher(EVP_aes_256_wrap_pad());
187 EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
188 EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
189 EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
190 EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
191 EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
192 EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
193#ifndef OPENSSL_NO_SIV
194 EVP_add_cipher(EVP_aes_128_siv());
195 EVP_add_cipher(EVP_aes_192_siv());
196 EVP_add_cipher(EVP_aes_256_siv());
197#endif
198#ifndef OPENSSL_NO_ARIA
199 EVP_add_cipher(EVP_aria_128_ecb());
200 EVP_add_cipher(EVP_aria_128_cbc());
201 EVP_add_cipher(EVP_aria_128_cfb());
202 EVP_add_cipher(EVP_aria_128_cfb1());
203 EVP_add_cipher(EVP_aria_128_cfb8());
204 EVP_add_cipher(EVP_aria_128_ctr());
205 EVP_add_cipher(EVP_aria_128_ofb());
206 EVP_add_cipher(EVP_aria_128_gcm());
207 EVP_add_cipher(EVP_aria_128_ccm());
208 EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
209 EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
210 EVP_add_cipher(EVP_aria_192_ecb());
211 EVP_add_cipher(EVP_aria_192_cbc());
212 EVP_add_cipher(EVP_aria_192_cfb());
213 EVP_add_cipher(EVP_aria_192_cfb1());
214 EVP_add_cipher(EVP_aria_192_cfb8());
215 EVP_add_cipher(EVP_aria_192_ctr());
216 EVP_add_cipher(EVP_aria_192_ofb());
217 EVP_add_cipher(EVP_aria_192_gcm());
218 EVP_add_cipher(EVP_aria_192_ccm());
219 EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
220 EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
221 EVP_add_cipher(EVP_aria_256_ecb());
222 EVP_add_cipher(EVP_aria_256_cbc());
223 EVP_add_cipher(EVP_aria_256_cfb());
224 EVP_add_cipher(EVP_aria_256_cfb1());
225 EVP_add_cipher(EVP_aria_256_cfb8());
226 EVP_add_cipher(EVP_aria_256_ctr());
227 EVP_add_cipher(EVP_aria_256_ofb());
228 EVP_add_cipher(EVP_aria_256_gcm());
229 EVP_add_cipher(EVP_aria_256_ccm());
230 EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
231 EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
232#endif
233
234#ifndef OPENSSL_NO_CAMELLIA
235 EVP_add_cipher(EVP_camellia_128_ecb());
236 EVP_add_cipher(EVP_camellia_128_cbc());
237 EVP_add_cipher(EVP_camellia_128_cfb());
238 EVP_add_cipher(EVP_camellia_128_cfb1());
239 EVP_add_cipher(EVP_camellia_128_cfb8());
240 EVP_add_cipher(EVP_camellia_128_ofb());
241 EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
242 EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
243 EVP_add_cipher(EVP_camellia_192_ecb());
244 EVP_add_cipher(EVP_camellia_192_cbc());
245 EVP_add_cipher(EVP_camellia_192_cfb());
246 EVP_add_cipher(EVP_camellia_192_cfb1());
247 EVP_add_cipher(EVP_camellia_192_cfb8());
248 EVP_add_cipher(EVP_camellia_192_ofb());
249 EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
250 EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
251 EVP_add_cipher(EVP_camellia_256_ecb());
252 EVP_add_cipher(EVP_camellia_256_cbc());
253 EVP_add_cipher(EVP_camellia_256_cfb());
254 EVP_add_cipher(EVP_camellia_256_cfb1());
255 EVP_add_cipher(EVP_camellia_256_cfb8());
256 EVP_add_cipher(EVP_camellia_256_ofb());
257 EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
258 EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
259 EVP_add_cipher(EVP_camellia_128_ctr());
260 EVP_add_cipher(EVP_camellia_192_ctr());
261 EVP_add_cipher(EVP_camellia_256_ctr());
262#endif
263
264#ifndef OPENSSL_NO_CHACHA
265 EVP_add_cipher(EVP_chacha20());
266# ifndef OPENSSL_NO_POLY1305
267 EVP_add_cipher(EVP_chacha20_poly1305());
268# endif
269#endif
270}
271