2
0

c_allc.c 9.5 KB

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