version_features.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * Version feature information
  3. *
  4. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  5. * SPDX-License-Identifier: GPL-2.0
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * This file is part of mbed TLS (https://tls.mbed.org)
  22. */
  23. #if !defined(MBEDTLS_CONFIG_FILE)
  24. #include "mbedtls/config.h"
  25. #else
  26. #include MBEDTLS_CONFIG_FILE
  27. #endif
  28. #if defined(MBEDTLS_VERSION_C)
  29. #include "mbedtls/version.h"
  30. #include <string.h>
  31. static const char *features[] = {
  32. #if defined(MBEDTLS_VERSION_FEATURES)
  33. #if defined(MBEDTLS_HAVE_ASM)
  34. "MBEDTLS_HAVE_ASM",
  35. #endif /* MBEDTLS_HAVE_ASM */
  36. #if defined(MBEDTLS_HAVE_SSE2)
  37. "MBEDTLS_HAVE_SSE2",
  38. #endif /* MBEDTLS_HAVE_SSE2 */
  39. #if defined(MBEDTLS_HAVE_TIME)
  40. "MBEDTLS_HAVE_TIME",
  41. #endif /* MBEDTLS_HAVE_TIME */
  42. #if defined(MBEDTLS_HAVE_TIME_DATE)
  43. "MBEDTLS_HAVE_TIME_DATE",
  44. #endif /* MBEDTLS_HAVE_TIME_DATE */
  45. #if defined(MBEDTLS_PLATFORM_MEMORY)
  46. "MBEDTLS_PLATFORM_MEMORY",
  47. #endif /* MBEDTLS_PLATFORM_MEMORY */
  48. #if defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
  49. "MBEDTLS_PLATFORM_NO_STD_FUNCTIONS",
  50. #endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */
  51. #if defined(MBEDTLS_PLATFORM_EXIT_ALT)
  52. "MBEDTLS_PLATFORM_EXIT_ALT",
  53. #endif /* MBEDTLS_PLATFORM_EXIT_ALT */
  54. #if defined(MBEDTLS_PLATFORM_TIME_ALT)
  55. "MBEDTLS_PLATFORM_TIME_ALT",
  56. #endif /* MBEDTLS_PLATFORM_TIME_ALT */
  57. #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
  58. "MBEDTLS_PLATFORM_FPRINTF_ALT",
  59. #endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */
  60. #if defined(MBEDTLS_PLATFORM_PRINTF_ALT)
  61. "MBEDTLS_PLATFORM_PRINTF_ALT",
  62. #endif /* MBEDTLS_PLATFORM_PRINTF_ALT */
  63. #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
  64. "MBEDTLS_PLATFORM_SNPRINTF_ALT",
  65. #endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */
  66. #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
  67. "MBEDTLS_PLATFORM_NV_SEED_ALT",
  68. #endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */
  69. #if defined(MBEDTLS_DEPRECATED_WARNING)
  70. "MBEDTLS_DEPRECATED_WARNING",
  71. #endif /* MBEDTLS_DEPRECATED_WARNING */
  72. #if defined(MBEDTLS_DEPRECATED_REMOVED)
  73. "MBEDTLS_DEPRECATED_REMOVED",
  74. #endif /* MBEDTLS_DEPRECATED_REMOVED */
  75. #if defined(MBEDTLS_TIMING_ALT)
  76. "MBEDTLS_TIMING_ALT",
  77. #endif /* MBEDTLS_TIMING_ALT */
  78. #if defined(MBEDTLS_AES_ALT)
  79. "MBEDTLS_AES_ALT",
  80. #endif /* MBEDTLS_AES_ALT */
  81. #if defined(MBEDTLS_ARC4_ALT)
  82. "MBEDTLS_ARC4_ALT",
  83. #endif /* MBEDTLS_ARC4_ALT */
  84. #if defined(MBEDTLS_BLOWFISH_ALT)
  85. "MBEDTLS_BLOWFISH_ALT",
  86. #endif /* MBEDTLS_BLOWFISH_ALT */
  87. #if defined(MBEDTLS_CAMELLIA_ALT)
  88. "MBEDTLS_CAMELLIA_ALT",
  89. #endif /* MBEDTLS_CAMELLIA_ALT */
  90. #if defined(MBEDTLS_DES_ALT)
  91. "MBEDTLS_DES_ALT",
  92. #endif /* MBEDTLS_DES_ALT */
  93. #if defined(MBEDTLS_XTEA_ALT)
  94. "MBEDTLS_XTEA_ALT",
  95. #endif /* MBEDTLS_XTEA_ALT */
  96. #if defined(MBEDTLS_MD2_ALT)
  97. "MBEDTLS_MD2_ALT",
  98. #endif /* MBEDTLS_MD2_ALT */
  99. #if defined(MBEDTLS_MD4_ALT)
  100. "MBEDTLS_MD4_ALT",
  101. #endif /* MBEDTLS_MD4_ALT */
  102. #if defined(MBEDTLS_MD5_ALT)
  103. "MBEDTLS_MD5_ALT",
  104. #endif /* MBEDTLS_MD5_ALT */
  105. #if defined(MBEDTLS_RIPEMD160_ALT)
  106. "MBEDTLS_RIPEMD160_ALT",
  107. #endif /* MBEDTLS_RIPEMD160_ALT */
  108. #if defined(MBEDTLS_SHA1_ALT)
  109. "MBEDTLS_SHA1_ALT",
  110. #endif /* MBEDTLS_SHA1_ALT */
  111. #if defined(MBEDTLS_SHA256_ALT)
  112. "MBEDTLS_SHA256_ALT",
  113. #endif /* MBEDTLS_SHA256_ALT */
  114. #if defined(MBEDTLS_SHA512_ALT)
  115. "MBEDTLS_SHA512_ALT",
  116. #endif /* MBEDTLS_SHA512_ALT */
  117. #if defined(MBEDTLS_MD2_PROCESS_ALT)
  118. "MBEDTLS_MD2_PROCESS_ALT",
  119. #endif /* MBEDTLS_MD2_PROCESS_ALT */
  120. #if defined(MBEDTLS_MD4_PROCESS_ALT)
  121. "MBEDTLS_MD4_PROCESS_ALT",
  122. #endif /* MBEDTLS_MD4_PROCESS_ALT */
  123. #if defined(MBEDTLS_MD5_PROCESS_ALT)
  124. "MBEDTLS_MD5_PROCESS_ALT",
  125. #endif /* MBEDTLS_MD5_PROCESS_ALT */
  126. #if defined(MBEDTLS_RIPEMD160_PROCESS_ALT)
  127. "MBEDTLS_RIPEMD160_PROCESS_ALT",
  128. #endif /* MBEDTLS_RIPEMD160_PROCESS_ALT */
  129. #if defined(MBEDTLS_SHA1_PROCESS_ALT)
  130. "MBEDTLS_SHA1_PROCESS_ALT",
  131. #endif /* MBEDTLS_SHA1_PROCESS_ALT */
  132. #if defined(MBEDTLS_SHA256_PROCESS_ALT)
  133. "MBEDTLS_SHA256_PROCESS_ALT",
  134. #endif /* MBEDTLS_SHA256_PROCESS_ALT */
  135. #if defined(MBEDTLS_SHA512_PROCESS_ALT)
  136. "MBEDTLS_SHA512_PROCESS_ALT",
  137. #endif /* MBEDTLS_SHA512_PROCESS_ALT */
  138. #if defined(MBEDTLS_DES_SETKEY_ALT)
  139. "MBEDTLS_DES_SETKEY_ALT",
  140. #endif /* MBEDTLS_DES_SETKEY_ALT */
  141. #if defined(MBEDTLS_DES_CRYPT_ECB_ALT)
  142. "MBEDTLS_DES_CRYPT_ECB_ALT",
  143. #endif /* MBEDTLS_DES_CRYPT_ECB_ALT */
  144. #if defined(MBEDTLS_DES3_CRYPT_ECB_ALT)
  145. "MBEDTLS_DES3_CRYPT_ECB_ALT",
  146. #endif /* MBEDTLS_DES3_CRYPT_ECB_ALT */
  147. #if defined(MBEDTLS_AES_SETKEY_ENC_ALT)
  148. "MBEDTLS_AES_SETKEY_ENC_ALT",
  149. #endif /* MBEDTLS_AES_SETKEY_ENC_ALT */
  150. #if defined(MBEDTLS_AES_SETKEY_DEC_ALT)
  151. "MBEDTLS_AES_SETKEY_DEC_ALT",
  152. #endif /* MBEDTLS_AES_SETKEY_DEC_ALT */
  153. #if defined(MBEDTLS_AES_ENCRYPT_ALT)
  154. "MBEDTLS_AES_ENCRYPT_ALT",
  155. #endif /* MBEDTLS_AES_ENCRYPT_ALT */
  156. #if defined(MBEDTLS_AES_DECRYPT_ALT)
  157. "MBEDTLS_AES_DECRYPT_ALT",
  158. #endif /* MBEDTLS_AES_DECRYPT_ALT */
  159. #if defined(MBEDTLS_TEST_NULL_ENTROPY)
  160. "MBEDTLS_TEST_NULL_ENTROPY",
  161. #endif /* MBEDTLS_TEST_NULL_ENTROPY */
  162. #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
  163. "MBEDTLS_ENTROPY_HARDWARE_ALT",
  164. #endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */
  165. #if defined(MBEDTLS_AES_ROM_TABLES)
  166. "MBEDTLS_AES_ROM_TABLES",
  167. #endif /* MBEDTLS_AES_ROM_TABLES */
  168. #if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY)
  169. "MBEDTLS_CAMELLIA_SMALL_MEMORY",
  170. #endif /* MBEDTLS_CAMELLIA_SMALL_MEMORY */
  171. #if defined(MBEDTLS_CIPHER_MODE_CBC)
  172. "MBEDTLS_CIPHER_MODE_CBC",
  173. #endif /* MBEDTLS_CIPHER_MODE_CBC */
  174. #if defined(MBEDTLS_CIPHER_MODE_CFB)
  175. "MBEDTLS_CIPHER_MODE_CFB",
  176. #endif /* MBEDTLS_CIPHER_MODE_CFB */
  177. #if defined(MBEDTLS_CIPHER_MODE_CTR)
  178. "MBEDTLS_CIPHER_MODE_CTR",
  179. #endif /* MBEDTLS_CIPHER_MODE_CTR */
  180. #if defined(MBEDTLS_CIPHER_NULL_CIPHER)
  181. "MBEDTLS_CIPHER_NULL_CIPHER",
  182. #endif /* MBEDTLS_CIPHER_NULL_CIPHER */
  183. #if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
  184. "MBEDTLS_CIPHER_PADDING_PKCS7",
  185. #endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */
  186. #if defined(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS)
  187. "MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS",
  188. #endif /* MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS */
  189. #if defined(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN)
  190. "MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN",
  191. #endif /* MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN */
  192. #if defined(MBEDTLS_CIPHER_PADDING_ZEROS)
  193. "MBEDTLS_CIPHER_PADDING_ZEROS",
  194. #endif /* MBEDTLS_CIPHER_PADDING_ZEROS */
  195. #if defined(MBEDTLS_ENABLE_WEAK_CIPHERSUITES)
  196. "MBEDTLS_ENABLE_WEAK_CIPHERSUITES",
  197. #endif /* MBEDTLS_ENABLE_WEAK_CIPHERSUITES */
  198. #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES)
  199. "MBEDTLS_REMOVE_ARC4_CIPHERSUITES",
  200. #endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */
  201. #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
  202. "MBEDTLS_ECP_DP_SECP192R1_ENABLED",
  203. #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */
  204. #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
  205. "MBEDTLS_ECP_DP_SECP224R1_ENABLED",
  206. #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */
  207. #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
  208. "MBEDTLS_ECP_DP_SECP256R1_ENABLED",
  209. #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */
  210. #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
  211. "MBEDTLS_ECP_DP_SECP384R1_ENABLED",
  212. #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */
  213. #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
  214. "MBEDTLS_ECP_DP_SECP521R1_ENABLED",
  215. #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */
  216. #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)
  217. "MBEDTLS_ECP_DP_SECP192K1_ENABLED",
  218. #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */
  219. #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)
  220. "MBEDTLS_ECP_DP_SECP224K1_ENABLED",
  221. #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */
  222. #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
  223. "MBEDTLS_ECP_DP_SECP256K1_ENABLED",
  224. #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */
  225. #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)
  226. "MBEDTLS_ECP_DP_BP256R1_ENABLED",
  227. #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */
  228. #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)
  229. "MBEDTLS_ECP_DP_BP384R1_ENABLED",
  230. #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */
  231. #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)
  232. "MBEDTLS_ECP_DP_BP512R1_ENABLED",
  233. #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */
  234. #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)
  235. "MBEDTLS_ECP_DP_CURVE25519_ENABLED",
  236. #endif /* MBEDTLS_ECP_DP_CURVE25519_ENABLED */
  237. #if defined(MBEDTLS_ECP_NIST_OPTIM)
  238. "MBEDTLS_ECP_NIST_OPTIM",
  239. #endif /* MBEDTLS_ECP_NIST_OPTIM */
  240. #if defined(MBEDTLS_ECDSA_DETERMINISTIC)
  241. "MBEDTLS_ECDSA_DETERMINISTIC",
  242. #endif /* MBEDTLS_ECDSA_DETERMINISTIC */
  243. #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
  244. "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED",
  245. #endif /* MBEDTLS_KEY_EXCHANGE_PSK_ENABLED */
  246. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
  247. "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED",
  248. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */
  249. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  250. "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED",
  251. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  252. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
  253. "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED",
  254. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */
  255. #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
  256. "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED",
  257. #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */
  258. #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
  259. "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED",
  260. #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */
  261. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  262. "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED",
  263. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */
  264. #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  265. "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED",
  266. #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */
  267. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
  268. "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED",
  269. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
  270. #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)
  271. "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED",
  272. #endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED */
  273. #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
  274. "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED",
  275. #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
  276. #if defined(MBEDTLS_PK_PARSE_EC_EXTENDED)
  277. "MBEDTLS_PK_PARSE_EC_EXTENDED",
  278. #endif /* MBEDTLS_PK_PARSE_EC_EXTENDED */
  279. #if defined(MBEDTLS_ERROR_STRERROR_DUMMY)
  280. "MBEDTLS_ERROR_STRERROR_DUMMY",
  281. #endif /* MBEDTLS_ERROR_STRERROR_DUMMY */
  282. #if defined(MBEDTLS_GENPRIME)
  283. "MBEDTLS_GENPRIME",
  284. #endif /* MBEDTLS_GENPRIME */
  285. #if defined(MBEDTLS_FS_IO)
  286. "MBEDTLS_FS_IO",
  287. #endif /* MBEDTLS_FS_IO */
  288. #if defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES)
  289. "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES",
  290. #endif /* MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES */
  291. #if defined(MBEDTLS_NO_PLATFORM_ENTROPY)
  292. "MBEDTLS_NO_PLATFORM_ENTROPY",
  293. #endif /* MBEDTLS_NO_PLATFORM_ENTROPY */
  294. #if defined(MBEDTLS_ENTROPY_FORCE_SHA256)
  295. "MBEDTLS_ENTROPY_FORCE_SHA256",
  296. #endif /* MBEDTLS_ENTROPY_FORCE_SHA256 */
  297. #if defined(MBEDTLS_ENTROPY_NV_SEED)
  298. "MBEDTLS_ENTROPY_NV_SEED",
  299. #endif /* MBEDTLS_ENTROPY_NV_SEED */
  300. #if defined(MBEDTLS_MEMORY_DEBUG)
  301. "MBEDTLS_MEMORY_DEBUG",
  302. #endif /* MBEDTLS_MEMORY_DEBUG */
  303. #if defined(MBEDTLS_MEMORY_BACKTRACE)
  304. "MBEDTLS_MEMORY_BACKTRACE",
  305. #endif /* MBEDTLS_MEMORY_BACKTRACE */
  306. #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
  307. "MBEDTLS_PK_RSA_ALT_SUPPORT",
  308. #endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */
  309. #if defined(MBEDTLS_PKCS1_V15)
  310. "MBEDTLS_PKCS1_V15",
  311. #endif /* MBEDTLS_PKCS1_V15 */
  312. #if defined(MBEDTLS_PKCS1_V21)
  313. "MBEDTLS_PKCS1_V21",
  314. #endif /* MBEDTLS_PKCS1_V21 */
  315. #if defined(MBEDTLS_RSA_NO_CRT)
  316. "MBEDTLS_RSA_NO_CRT",
  317. #endif /* MBEDTLS_RSA_NO_CRT */
  318. #if defined(MBEDTLS_SELF_TEST)
  319. "MBEDTLS_SELF_TEST",
  320. #endif /* MBEDTLS_SELF_TEST */
  321. #if defined(MBEDTLS_SHA256_SMALLER)
  322. "MBEDTLS_SHA256_SMALLER",
  323. #endif /* MBEDTLS_SHA256_SMALLER */
  324. #if defined(MBEDTLS_SSL_ALL_ALERT_MESSAGES)
  325. "MBEDTLS_SSL_ALL_ALERT_MESSAGES",
  326. #endif /* MBEDTLS_SSL_ALL_ALERT_MESSAGES */
  327. #if defined(MBEDTLS_SSL_DEBUG_ALL)
  328. "MBEDTLS_SSL_DEBUG_ALL",
  329. #endif /* MBEDTLS_SSL_DEBUG_ALL */
  330. #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
  331. "MBEDTLS_SSL_ENCRYPT_THEN_MAC",
  332. #endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */
  333. #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
  334. "MBEDTLS_SSL_EXTENDED_MASTER_SECRET",
  335. #endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */
  336. #if defined(MBEDTLS_SSL_FALLBACK_SCSV)
  337. "MBEDTLS_SSL_FALLBACK_SCSV",
  338. #endif /* MBEDTLS_SSL_FALLBACK_SCSV */
  339. #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
  340. "MBEDTLS_SSL_HW_RECORD_ACCEL",
  341. #endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
  342. #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
  343. "MBEDTLS_SSL_CBC_RECORD_SPLITTING",
  344. #endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */
  345. #if defined(MBEDTLS_SSL_RENEGOTIATION)
  346. "MBEDTLS_SSL_RENEGOTIATION",
  347. #endif /* MBEDTLS_SSL_RENEGOTIATION */
  348. #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO)
  349. "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO",
  350. #endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */
  351. #if defined(MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE)
  352. "MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE",
  353. #endif /* MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE */
  354. #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
  355. "MBEDTLS_SSL_MAX_FRAGMENT_LENGTH",
  356. #endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
  357. #if defined(MBEDTLS_SSL_PROTO_SSL3)
  358. "MBEDTLS_SSL_PROTO_SSL3",
  359. #endif /* MBEDTLS_SSL_PROTO_SSL3 */
  360. #if defined(MBEDTLS_SSL_PROTO_TLS1)
  361. "MBEDTLS_SSL_PROTO_TLS1",
  362. #endif /* MBEDTLS_SSL_PROTO_TLS1 */
  363. #if defined(MBEDTLS_SSL_PROTO_TLS1_1)
  364. "MBEDTLS_SSL_PROTO_TLS1_1",
  365. #endif /* MBEDTLS_SSL_PROTO_TLS1_1 */
  366. #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
  367. "MBEDTLS_SSL_PROTO_TLS1_2",
  368. #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
  369. #if defined(MBEDTLS_SSL_PROTO_DTLS)
  370. "MBEDTLS_SSL_PROTO_DTLS",
  371. #endif /* MBEDTLS_SSL_PROTO_DTLS */
  372. #if defined(MBEDTLS_SSL_ALPN)
  373. "MBEDTLS_SSL_ALPN",
  374. #endif /* MBEDTLS_SSL_ALPN */
  375. #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
  376. "MBEDTLS_SSL_DTLS_ANTI_REPLAY",
  377. #endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */
  378. #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
  379. "MBEDTLS_SSL_DTLS_HELLO_VERIFY",
  380. #endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY */
  381. #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE)
  382. "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE",
  383. #endif /* MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE */
  384. #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
  385. "MBEDTLS_SSL_DTLS_BADMAC_LIMIT",
  386. #endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */
  387. #if defined(MBEDTLS_SSL_SESSION_TICKETS)
  388. "MBEDTLS_SSL_SESSION_TICKETS",
  389. #endif /* MBEDTLS_SSL_SESSION_TICKETS */
  390. #if defined(MBEDTLS_SSL_EXPORT_KEYS)
  391. "MBEDTLS_SSL_EXPORT_KEYS",
  392. #endif /* MBEDTLS_SSL_EXPORT_KEYS */
  393. #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
  394. "MBEDTLS_SSL_SERVER_NAME_INDICATION",
  395. #endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */
  396. #if defined(MBEDTLS_SSL_TRUNCATED_HMAC)
  397. "MBEDTLS_SSL_TRUNCATED_HMAC",
  398. #endif /* MBEDTLS_SSL_TRUNCATED_HMAC */
  399. #if defined(MBEDTLS_THREADING_ALT)
  400. "MBEDTLS_THREADING_ALT",
  401. #endif /* MBEDTLS_THREADING_ALT */
  402. #if defined(MBEDTLS_THREADING_PTHREAD)
  403. "MBEDTLS_THREADING_PTHREAD",
  404. #endif /* MBEDTLS_THREADING_PTHREAD */
  405. #if defined(MBEDTLS_VERSION_FEATURES)
  406. "MBEDTLS_VERSION_FEATURES",
  407. #endif /* MBEDTLS_VERSION_FEATURES */
  408. #if defined(MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3)
  409. "MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3",
  410. #endif /* MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 */
  411. #if defined(MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION)
  412. "MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION",
  413. #endif /* MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */
  414. #if defined(MBEDTLS_X509_CHECK_KEY_USAGE)
  415. "MBEDTLS_X509_CHECK_KEY_USAGE",
  416. #endif /* MBEDTLS_X509_CHECK_KEY_USAGE */
  417. #if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE)
  418. "MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE",
  419. #endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */
  420. #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
  421. "MBEDTLS_X509_RSASSA_PSS_SUPPORT",
  422. #endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */
  423. #if defined(MBEDTLS_ZLIB_SUPPORT)
  424. "MBEDTLS_ZLIB_SUPPORT",
  425. #endif /* MBEDTLS_ZLIB_SUPPORT */
  426. #if defined(MBEDTLS_AESNI_C)
  427. "MBEDTLS_AESNI_C",
  428. #endif /* MBEDTLS_AESNI_C */
  429. #if defined(MBEDTLS_AES_C)
  430. "MBEDTLS_AES_C",
  431. #endif /* MBEDTLS_AES_C */
  432. #if defined(MBEDTLS_ARC4_C)
  433. "MBEDTLS_ARC4_C",
  434. #endif /* MBEDTLS_ARC4_C */
  435. #if defined(MBEDTLS_ASN1_PARSE_C)
  436. "MBEDTLS_ASN1_PARSE_C",
  437. #endif /* MBEDTLS_ASN1_PARSE_C */
  438. #if defined(MBEDTLS_ASN1_WRITE_C)
  439. "MBEDTLS_ASN1_WRITE_C",
  440. #endif /* MBEDTLS_ASN1_WRITE_C */
  441. #if defined(MBEDTLS_BASE64_C)
  442. "MBEDTLS_BASE64_C",
  443. #endif /* MBEDTLS_BASE64_C */
  444. #if defined(MBEDTLS_BIGNUM_C)
  445. "MBEDTLS_BIGNUM_C",
  446. #endif /* MBEDTLS_BIGNUM_C */
  447. #if defined(MBEDTLS_BLOWFISH_C)
  448. "MBEDTLS_BLOWFISH_C",
  449. #endif /* MBEDTLS_BLOWFISH_C */
  450. #if defined(MBEDTLS_CAMELLIA_C)
  451. "MBEDTLS_CAMELLIA_C",
  452. #endif /* MBEDTLS_CAMELLIA_C */
  453. #if defined(MBEDTLS_CCM_C)
  454. "MBEDTLS_CCM_C",
  455. #endif /* MBEDTLS_CCM_C */
  456. #if defined(MBEDTLS_CERTS_C)
  457. "MBEDTLS_CERTS_C",
  458. #endif /* MBEDTLS_CERTS_C */
  459. #if defined(MBEDTLS_CIPHER_C)
  460. "MBEDTLS_CIPHER_C",
  461. #endif /* MBEDTLS_CIPHER_C */
  462. #if defined(MBEDTLS_CMAC_C)
  463. "MBEDTLS_CMAC_C",
  464. #endif /* MBEDTLS_CMAC_C */
  465. #if defined(MBEDTLS_CTR_DRBG_C)
  466. "MBEDTLS_CTR_DRBG_C",
  467. #endif /* MBEDTLS_CTR_DRBG_C */
  468. #if defined(MBEDTLS_DEBUG_C)
  469. "MBEDTLS_DEBUG_C",
  470. #endif /* MBEDTLS_DEBUG_C */
  471. #if defined(MBEDTLS_DES_C)
  472. "MBEDTLS_DES_C",
  473. #endif /* MBEDTLS_DES_C */
  474. #if defined(MBEDTLS_DHM_C)
  475. "MBEDTLS_DHM_C",
  476. #endif /* MBEDTLS_DHM_C */
  477. #if defined(MBEDTLS_ECDH_C)
  478. "MBEDTLS_ECDH_C",
  479. #endif /* MBEDTLS_ECDH_C */
  480. #if defined(MBEDTLS_ECDSA_C)
  481. "MBEDTLS_ECDSA_C",
  482. #endif /* MBEDTLS_ECDSA_C */
  483. #if defined(MBEDTLS_ECJPAKE_C)
  484. "MBEDTLS_ECJPAKE_C",
  485. #endif /* MBEDTLS_ECJPAKE_C */
  486. #if defined(MBEDTLS_ECP_C)
  487. "MBEDTLS_ECP_C",
  488. #endif /* MBEDTLS_ECP_C */
  489. #if defined(MBEDTLS_ENTROPY_C)
  490. "MBEDTLS_ENTROPY_C",
  491. #endif /* MBEDTLS_ENTROPY_C */
  492. #if defined(MBEDTLS_ERROR_C)
  493. "MBEDTLS_ERROR_C",
  494. #endif /* MBEDTLS_ERROR_C */
  495. #if defined(MBEDTLS_GCM_C)
  496. "MBEDTLS_GCM_C",
  497. #endif /* MBEDTLS_GCM_C */
  498. #if defined(MBEDTLS_HAVEGE_C)
  499. "MBEDTLS_HAVEGE_C",
  500. #endif /* MBEDTLS_HAVEGE_C */
  501. #if defined(MBEDTLS_HMAC_DRBG_C)
  502. "MBEDTLS_HMAC_DRBG_C",
  503. #endif /* MBEDTLS_HMAC_DRBG_C */
  504. #if defined(MBEDTLS_MD_C)
  505. "MBEDTLS_MD_C",
  506. #endif /* MBEDTLS_MD_C */
  507. #if defined(MBEDTLS_MD2_C)
  508. "MBEDTLS_MD2_C",
  509. #endif /* MBEDTLS_MD2_C */
  510. #if defined(MBEDTLS_MD4_C)
  511. "MBEDTLS_MD4_C",
  512. #endif /* MBEDTLS_MD4_C */
  513. #if defined(MBEDTLS_MD5_C)
  514. "MBEDTLS_MD5_C",
  515. #endif /* MBEDTLS_MD5_C */
  516. #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
  517. "MBEDTLS_MEMORY_BUFFER_ALLOC_C",
  518. #endif /* MBEDTLS_MEMORY_BUFFER_ALLOC_C */
  519. #if defined(MBEDTLS_NET_C)
  520. "MBEDTLS_NET_C",
  521. #endif /* MBEDTLS_NET_C */
  522. #if defined(MBEDTLS_OID_C)
  523. "MBEDTLS_OID_C",
  524. #endif /* MBEDTLS_OID_C */
  525. #if defined(MBEDTLS_PADLOCK_C)
  526. "MBEDTLS_PADLOCK_C",
  527. #endif /* MBEDTLS_PADLOCK_C */
  528. #if defined(MBEDTLS_PEM_PARSE_C)
  529. "MBEDTLS_PEM_PARSE_C",
  530. #endif /* MBEDTLS_PEM_PARSE_C */
  531. #if defined(MBEDTLS_PEM_WRITE_C)
  532. "MBEDTLS_PEM_WRITE_C",
  533. #endif /* MBEDTLS_PEM_WRITE_C */
  534. #if defined(MBEDTLS_PK_C)
  535. "MBEDTLS_PK_C",
  536. #endif /* MBEDTLS_PK_C */
  537. #if defined(MBEDTLS_PK_PARSE_C)
  538. "MBEDTLS_PK_PARSE_C",
  539. #endif /* MBEDTLS_PK_PARSE_C */
  540. #if defined(MBEDTLS_PK_WRITE_C)
  541. "MBEDTLS_PK_WRITE_C",
  542. #endif /* MBEDTLS_PK_WRITE_C */
  543. #if defined(MBEDTLS_PKCS5_C)
  544. "MBEDTLS_PKCS5_C",
  545. #endif /* MBEDTLS_PKCS5_C */
  546. #if defined(MBEDTLS_PKCS11_C)
  547. "MBEDTLS_PKCS11_C",
  548. #endif /* MBEDTLS_PKCS11_C */
  549. #if defined(MBEDTLS_PKCS12_C)
  550. "MBEDTLS_PKCS12_C",
  551. #endif /* MBEDTLS_PKCS12_C */
  552. #if defined(MBEDTLS_PLATFORM_C)
  553. "MBEDTLS_PLATFORM_C",
  554. #endif /* MBEDTLS_PLATFORM_C */
  555. #if defined(MBEDTLS_RIPEMD160_C)
  556. "MBEDTLS_RIPEMD160_C",
  557. #endif /* MBEDTLS_RIPEMD160_C */
  558. #if defined(MBEDTLS_RSA_C)
  559. "MBEDTLS_RSA_C",
  560. #endif /* MBEDTLS_RSA_C */
  561. #if defined(MBEDTLS_SHA1_C)
  562. "MBEDTLS_SHA1_C",
  563. #endif /* MBEDTLS_SHA1_C */
  564. #if defined(MBEDTLS_SHA256_C)
  565. "MBEDTLS_SHA256_C",
  566. #endif /* MBEDTLS_SHA256_C */
  567. #if defined(MBEDTLS_SHA512_C)
  568. "MBEDTLS_SHA512_C",
  569. #endif /* MBEDTLS_SHA512_C */
  570. #if defined(MBEDTLS_SSL_CACHE_C)
  571. "MBEDTLS_SSL_CACHE_C",
  572. #endif /* MBEDTLS_SSL_CACHE_C */
  573. #if defined(MBEDTLS_SSL_COOKIE_C)
  574. "MBEDTLS_SSL_COOKIE_C",
  575. #endif /* MBEDTLS_SSL_COOKIE_C */
  576. #if defined(MBEDTLS_SSL_TICKET_C)
  577. "MBEDTLS_SSL_TICKET_C",
  578. #endif /* MBEDTLS_SSL_TICKET_C */
  579. #if defined(MBEDTLS_SSL_CLI_C)
  580. "MBEDTLS_SSL_CLI_C",
  581. #endif /* MBEDTLS_SSL_CLI_C */
  582. #if defined(MBEDTLS_SSL_SRV_C)
  583. "MBEDTLS_SSL_SRV_C",
  584. #endif /* MBEDTLS_SSL_SRV_C */
  585. #if defined(MBEDTLS_SSL_TLS_C)
  586. "MBEDTLS_SSL_TLS_C",
  587. #endif /* MBEDTLS_SSL_TLS_C */
  588. #if defined(MBEDTLS_THREADING_C)
  589. "MBEDTLS_THREADING_C",
  590. #endif /* MBEDTLS_THREADING_C */
  591. #if defined(MBEDTLS_TIMING_C)
  592. "MBEDTLS_TIMING_C",
  593. #endif /* MBEDTLS_TIMING_C */
  594. #if defined(MBEDTLS_VERSION_C)
  595. "MBEDTLS_VERSION_C",
  596. #endif /* MBEDTLS_VERSION_C */
  597. #if defined(MBEDTLS_X509_USE_C)
  598. "MBEDTLS_X509_USE_C",
  599. #endif /* MBEDTLS_X509_USE_C */
  600. #if defined(MBEDTLS_X509_CRT_PARSE_C)
  601. "MBEDTLS_X509_CRT_PARSE_C",
  602. #endif /* MBEDTLS_X509_CRT_PARSE_C */
  603. #if defined(MBEDTLS_X509_CRL_PARSE_C)
  604. "MBEDTLS_X509_CRL_PARSE_C",
  605. #endif /* MBEDTLS_X509_CRL_PARSE_C */
  606. #if defined(MBEDTLS_X509_CSR_PARSE_C)
  607. "MBEDTLS_X509_CSR_PARSE_C",
  608. #endif /* MBEDTLS_X509_CSR_PARSE_C */
  609. #if defined(MBEDTLS_X509_CREATE_C)
  610. "MBEDTLS_X509_CREATE_C",
  611. #endif /* MBEDTLS_X509_CREATE_C */
  612. #if defined(MBEDTLS_X509_CRT_WRITE_C)
  613. "MBEDTLS_X509_CRT_WRITE_C",
  614. #endif /* MBEDTLS_X509_CRT_WRITE_C */
  615. #if defined(MBEDTLS_X509_CSR_WRITE_C)
  616. "MBEDTLS_X509_CSR_WRITE_C",
  617. #endif /* MBEDTLS_X509_CSR_WRITE_C */
  618. #if defined(MBEDTLS_XTEA_C)
  619. "MBEDTLS_XTEA_C",
  620. #endif /* MBEDTLS_XTEA_C */
  621. #endif /* MBEDTLS_VERSION_FEATURES */
  622. NULL
  623. };
  624. int mbedtls_version_check_feature( const char *feature )
  625. {
  626. const char **idx = features;
  627. if( *idx == NULL )
  628. return( -2 );
  629. if( feature == NULL )
  630. return( -1 );
  631. while( *idx != NULL )
  632. {
  633. if( !strcmp( *idx, feature ) )
  634. return( 0 );
  635. idx++;
  636. }
  637. return( -1 );
  638. }
  639. #endif /* MBEDTLS_VERSION_C */