1 /*
2 * Copyright 1995-2022 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
openssl_add_all_ciphers_int(void)17 void 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_id_aes128_wrap_pad, "aes128-wrap-pad");
153 EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
154 EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
155 EVP_add_cipher(EVP_aes_192_ecb());
156 EVP_add_cipher(EVP_aes_192_cbc());
157 EVP_add_cipher(EVP_aes_192_cfb());
158 EVP_add_cipher(EVP_aes_192_cfb1());
159 EVP_add_cipher(EVP_aes_192_cfb8());
160 EVP_add_cipher(EVP_aes_192_ofb());
161 EVP_add_cipher(EVP_aes_192_ctr());
162 EVP_add_cipher(EVP_aes_192_gcm());
163 #ifndef OPENSSL_NO_OCB
164 EVP_add_cipher(EVP_aes_192_ocb());
165 #endif
166 EVP_add_cipher(EVP_aes_192_ccm());
167 EVP_add_cipher(EVP_aes_192_wrap());
168 EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
169 EVP_add_cipher(EVP_aes_192_wrap_pad());
170 EVP_add_cipher_alias(SN_id_aes192_wrap_pad, "aes192-wrap-pad");
171 EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
172 EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
173 EVP_add_cipher(EVP_aes_256_ecb());
174 EVP_add_cipher(EVP_aes_256_cbc());
175 EVP_add_cipher(EVP_aes_256_cfb());
176 EVP_add_cipher(EVP_aes_256_cfb1());
177 EVP_add_cipher(EVP_aes_256_cfb8());
178 EVP_add_cipher(EVP_aes_256_ofb());
179 EVP_add_cipher(EVP_aes_256_ctr());
180 EVP_add_cipher(EVP_aes_256_gcm());
181 #ifndef OPENSSL_NO_OCB
182 EVP_add_cipher(EVP_aes_256_ocb());
183 #endif
184 EVP_add_cipher(EVP_aes_256_xts());
185 EVP_add_cipher(EVP_aes_256_ccm());
186 EVP_add_cipher(EVP_aes_256_wrap());
187 EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
188 EVP_add_cipher(EVP_aes_256_wrap_pad());
189 EVP_add_cipher_alias(SN_id_aes256_wrap_pad, "aes256-wrap-pad");
190 EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
191 EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
192 EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
193 EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
194 EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
195 EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
196 #ifndef OPENSSL_NO_ARIA
197 EVP_add_cipher(EVP_aria_128_ecb());
198 EVP_add_cipher(EVP_aria_128_cbc());
199 EVP_add_cipher(EVP_aria_128_cfb());
200 EVP_add_cipher(EVP_aria_128_cfb1());
201 EVP_add_cipher(EVP_aria_128_cfb8());
202 EVP_add_cipher(EVP_aria_128_ctr());
203 EVP_add_cipher(EVP_aria_128_ofb());
204 EVP_add_cipher(EVP_aria_128_gcm());
205 EVP_add_cipher(EVP_aria_128_ccm());
206 EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
207 EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
208 EVP_add_cipher(EVP_aria_192_ecb());
209 EVP_add_cipher(EVP_aria_192_cbc());
210 EVP_add_cipher(EVP_aria_192_cfb());
211 EVP_add_cipher(EVP_aria_192_cfb1());
212 EVP_add_cipher(EVP_aria_192_cfb8());
213 EVP_add_cipher(EVP_aria_192_ctr());
214 EVP_add_cipher(EVP_aria_192_ofb());
215 EVP_add_cipher(EVP_aria_192_gcm());
216 EVP_add_cipher(EVP_aria_192_ccm());
217 EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
218 EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
219 EVP_add_cipher(EVP_aria_256_ecb());
220 EVP_add_cipher(EVP_aria_256_cbc());
221 EVP_add_cipher(EVP_aria_256_cfb());
222 EVP_add_cipher(EVP_aria_256_cfb1());
223 EVP_add_cipher(EVP_aria_256_cfb8());
224 EVP_add_cipher(EVP_aria_256_ctr());
225 EVP_add_cipher(EVP_aria_256_ofb());
226 EVP_add_cipher(EVP_aria_256_gcm());
227 EVP_add_cipher(EVP_aria_256_ccm());
228 EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
229 EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
230 #endif
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 }
269