version_features.c 22 KB

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