c_allc.c 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /*
  2. * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (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 "internal/evp_int.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_aes_128_cbc, "AES128");
  137. EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
  138. EVP_add_cipher(EVP_aes_192_ecb());
  139. EVP_add_cipher(EVP_aes_192_cbc());
  140. EVP_add_cipher(EVP_aes_192_cfb());
  141. EVP_add_cipher(EVP_aes_192_cfb1());
  142. EVP_add_cipher(EVP_aes_192_cfb8());
  143. EVP_add_cipher(EVP_aes_192_ofb());
  144. EVP_add_cipher(EVP_aes_192_ctr());
  145. EVP_add_cipher(EVP_aes_192_gcm());
  146. #ifndef OPENSSL_NO_OCB
  147. EVP_add_cipher(EVP_aes_192_ocb());
  148. #endif
  149. EVP_add_cipher(EVP_aes_192_ccm());
  150. EVP_add_cipher(EVP_aes_192_wrap());
  151. EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
  152. EVP_add_cipher(EVP_aes_192_wrap_pad());
  153. EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
  154. EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
  155. EVP_add_cipher(EVP_aes_256_ecb());
  156. EVP_add_cipher(EVP_aes_256_cbc());
  157. EVP_add_cipher(EVP_aes_256_cfb());
  158. EVP_add_cipher(EVP_aes_256_cfb1());
  159. EVP_add_cipher(EVP_aes_256_cfb8());
  160. EVP_add_cipher(EVP_aes_256_ofb());
  161. EVP_add_cipher(EVP_aes_256_ctr());
  162. EVP_add_cipher(EVP_aes_256_gcm());
  163. #ifndef OPENSSL_NO_OCB
  164. EVP_add_cipher(EVP_aes_256_ocb());
  165. #endif
  166. EVP_add_cipher(EVP_aes_256_xts());
  167. EVP_add_cipher(EVP_aes_256_ccm());
  168. EVP_add_cipher(EVP_aes_256_wrap());
  169. EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
  170. EVP_add_cipher(EVP_aes_256_wrap_pad());
  171. EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
  172. EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
  173. EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
  174. EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
  175. EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
  176. EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
  177. #ifndef OPENSSL_NO_ARIA
  178. EVP_add_cipher(EVP_aria_128_ecb());
  179. EVP_add_cipher(EVP_aria_128_cbc());
  180. EVP_add_cipher(EVP_aria_128_cfb());
  181. EVP_add_cipher(EVP_aria_128_cfb1());
  182. EVP_add_cipher(EVP_aria_128_cfb8());
  183. EVP_add_cipher(EVP_aria_128_ctr());
  184. EVP_add_cipher(EVP_aria_128_ofb());
  185. EVP_add_cipher(EVP_aria_128_gcm());
  186. EVP_add_cipher(EVP_aria_128_ccm());
  187. EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
  188. EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
  189. EVP_add_cipher(EVP_aria_192_ecb());
  190. EVP_add_cipher(EVP_aria_192_cbc());
  191. EVP_add_cipher(EVP_aria_192_cfb());
  192. EVP_add_cipher(EVP_aria_192_cfb1());
  193. EVP_add_cipher(EVP_aria_192_cfb8());
  194. EVP_add_cipher(EVP_aria_192_ctr());
  195. EVP_add_cipher(EVP_aria_192_ofb());
  196. EVP_add_cipher(EVP_aria_192_gcm());
  197. EVP_add_cipher(EVP_aria_192_ccm());
  198. EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
  199. EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
  200. EVP_add_cipher(EVP_aria_256_ecb());
  201. EVP_add_cipher(EVP_aria_256_cbc());
  202. EVP_add_cipher(EVP_aria_256_cfb());
  203. EVP_add_cipher(EVP_aria_256_cfb1());
  204. EVP_add_cipher(EVP_aria_256_cfb8());
  205. EVP_add_cipher(EVP_aria_256_ctr());
  206. EVP_add_cipher(EVP_aria_256_ofb());
  207. EVP_add_cipher(EVP_aria_256_gcm());
  208. EVP_add_cipher(EVP_aria_256_ccm());
  209. EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
  210. EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
  211. #endif
  212. #ifndef OPENSSL_NO_CAMELLIA
  213. EVP_add_cipher(EVP_camellia_128_ecb());
  214. EVP_add_cipher(EVP_camellia_128_cbc());
  215. EVP_add_cipher(EVP_camellia_128_cfb());
  216. EVP_add_cipher(EVP_camellia_128_cfb1());
  217. EVP_add_cipher(EVP_camellia_128_cfb8());
  218. EVP_add_cipher(EVP_camellia_128_ofb());
  219. EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
  220. EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
  221. EVP_add_cipher(EVP_camellia_192_ecb());
  222. EVP_add_cipher(EVP_camellia_192_cbc());
  223. EVP_add_cipher(EVP_camellia_192_cfb());
  224. EVP_add_cipher(EVP_camellia_192_cfb1());
  225. EVP_add_cipher(EVP_camellia_192_cfb8());
  226. EVP_add_cipher(EVP_camellia_192_ofb());
  227. EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
  228. EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
  229. EVP_add_cipher(EVP_camellia_256_ecb());
  230. EVP_add_cipher(EVP_camellia_256_cbc());
  231. EVP_add_cipher(EVP_camellia_256_cfb());
  232. EVP_add_cipher(EVP_camellia_256_cfb1());
  233. EVP_add_cipher(EVP_camellia_256_cfb8());
  234. EVP_add_cipher(EVP_camellia_256_ofb());
  235. EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
  236. EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
  237. EVP_add_cipher(EVP_camellia_128_ctr());
  238. EVP_add_cipher(EVP_camellia_192_ctr());
  239. EVP_add_cipher(EVP_camellia_256_ctr());
  240. #endif
  241. #ifndef OPENSSL_NO_CHACHA
  242. EVP_add_cipher(EVP_chacha20());
  243. # ifndef OPENSSL_NO_POLY1305
  244. EVP_add_cipher(EVP_chacha20_poly1305());
  245. # endif
  246. #endif
  247. }