version_features.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /*
  2. * Version feature information
  3. *
  4. * Copyright (C) 2006-2014, Brainspark B.V.
  5. *
  6. * This file is part of PolarSSL (http://www.polarssl.org)
  7. * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
  8. *
  9. * All rights reserved.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License along
  22. * with this program; if not, write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  24. */
  25. #if !defined(POLARSSL_CONFIG_FILE)
  26. #include "polarssl/config.h"
  27. #else
  28. #include POLARSSL_CONFIG_FILE
  29. #endif
  30. #if defined(POLARSSL_VERSION_C)
  31. #include "polarssl/version.h"
  32. #include <string.h>
  33. #if defined(_MSC_VER) && !defined strcasecmp && !defined(EFIX64) && \
  34. !defined(EFI32)
  35. #define strcasecmp _stricmp
  36. #endif
  37. const char *features[] = {
  38. #if defined(POLARSSL_VERSION_FEATURES)
  39. #if defined(POLARSSL_HAVE_INT8)
  40. "POLARSSL_HAVE_INT8",
  41. #endif /* POLARSSL_HAVE_INT8 */
  42. #if defined(POLARSSL_HAVE_INT16)
  43. "POLARSSL_HAVE_INT16",
  44. #endif /* POLARSSL_HAVE_INT16 */
  45. #if defined(POLARSSL_HAVE_LONGLONG)
  46. "POLARSSL_HAVE_LONGLONG",
  47. #endif /* POLARSSL_HAVE_LONGLONG */
  48. #if defined(POLARSSL_HAVE_ASM)
  49. "POLARSSL_HAVE_ASM",
  50. #endif /* POLARSSL_HAVE_ASM */
  51. #if defined(POLARSSL_HAVE_SSE2)
  52. "POLARSSL_HAVE_SSE2",
  53. #endif /* POLARSSL_HAVE_SSE2 */
  54. #if defined(POLARSSL_HAVE_TIME)
  55. "POLARSSL_HAVE_TIME",
  56. #endif /* POLARSSL_HAVE_TIME */
  57. #if defined(POLARSSL_HAVE_IPV6)
  58. "POLARSSL_HAVE_IPV6",
  59. #endif /* POLARSSL_HAVE_IPV6 */
  60. #if defined(POLARSSL_PLATFORM_MEMORY)
  61. "POLARSSL_PLATFORM_MEMORY",
  62. #endif /* POLARSSL_PLATFORM_MEMORY */
  63. #if defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS)
  64. "POLARSSL_PLATFORM_NO_STD_FUNCTIONS",
  65. #endif /* POLARSSL_PLATFORM_NO_STD_FUNCTIONS */
  66. #if defined(POLARSSL_PLATFORM_PRINTF_ALT)
  67. "POLARSSL_PLATFORM_PRINTF_ALT",
  68. #endif /* POLARSSL_PLATFORM_PRINTF_ALT */
  69. #if defined(POLARSSL_PLATFORM_FPRINTF_ALT)
  70. "POLARSSL_PLATFORM_FPRINTF_ALT",
  71. #endif /* POLARSSL_PLATFORM_FPRINTF_ALT */
  72. #if defined(POLARSSL_TIMING_ALT)
  73. "POLARSSL_TIMING_ALT",
  74. #endif /* POLARSSL_TIMING_ALT */
  75. #if defined(POLARSSL_AES_ALT)
  76. "POLARSSL_AES_ALT",
  77. #endif /* POLARSSL_AES_ALT */
  78. #if defined(POLARSSL_ARC4_ALT)
  79. "POLARSSL_ARC4_ALT",
  80. #endif /* POLARSSL_ARC4_ALT */
  81. #if defined(POLARSSL_BLOWFISH_ALT)
  82. "POLARSSL_BLOWFISH_ALT",
  83. #endif /* POLARSSL_BLOWFISH_ALT */
  84. #if defined(POLARSSL_CAMELLIA_ALT)
  85. "POLARSSL_CAMELLIA_ALT",
  86. #endif /* POLARSSL_CAMELLIA_ALT */
  87. #if defined(POLARSSL_DES_ALT)
  88. "POLARSSL_DES_ALT",
  89. #endif /* POLARSSL_DES_ALT */
  90. #if defined(POLARSSL_XTEA_ALT)
  91. "POLARSSL_XTEA_ALT",
  92. #endif /* POLARSSL_XTEA_ALT */
  93. #if defined(POLARSSL_MD2_ALT)
  94. "POLARSSL_MD2_ALT",
  95. #endif /* POLARSSL_MD2_ALT */
  96. #if defined(POLARSSL_MD4_ALT)
  97. "POLARSSL_MD4_ALT",
  98. #endif /* POLARSSL_MD4_ALT */
  99. #if defined(POLARSSL_MD5_ALT)
  100. "POLARSSL_MD5_ALT",
  101. #endif /* POLARSSL_MD5_ALT */
  102. #if defined(POLARSSL_RIPEMD160_ALT)
  103. "POLARSSL_RIPEMD160_ALT",
  104. #endif /* POLARSSL_RIPEMD160_ALT */
  105. #if defined(POLARSSL_SHA1_ALT)
  106. "POLARSSL_SHA1_ALT",
  107. #endif /* POLARSSL_SHA1_ALT */
  108. #if defined(POLARSSL_SHA256_ALT)
  109. "POLARSSL_SHA256_ALT",
  110. #endif /* POLARSSL_SHA256_ALT */
  111. #if defined(POLARSSL_SHA512_ALT)
  112. "POLARSSL_SHA512_ALT",
  113. #endif /* POLARSSL_SHA512_ALT */
  114. #if defined(POLARSSL_AES_ROM_TABLES)
  115. "POLARSSL_AES_ROM_TABLES",
  116. #endif /* POLARSSL_AES_ROM_TABLES */
  117. #if defined(POLARSSL_CIPHER_MODE_CBC)
  118. "POLARSSL_CIPHER_MODE_CBC",
  119. #endif /* POLARSSL_CIPHER_MODE_CBC */
  120. #if defined(POLARSSL_CIPHER_MODE_CFB)
  121. "POLARSSL_CIPHER_MODE_CFB",
  122. #endif /* POLARSSL_CIPHER_MODE_CFB */
  123. #if defined(POLARSSL_CIPHER_MODE_CTR)
  124. "POLARSSL_CIPHER_MODE_CTR",
  125. #endif /* POLARSSL_CIPHER_MODE_CTR */
  126. #if defined(POLARSSL_CIPHER_NULL_CIPHER)
  127. "POLARSSL_CIPHER_NULL_CIPHER",
  128. #endif /* POLARSSL_CIPHER_NULL_CIPHER */
  129. #if defined(POLARSSL_CIPHER_PADDING_PKCS7)
  130. "POLARSSL_CIPHER_PADDING_PKCS7",
  131. #endif /* POLARSSL_CIPHER_PADDING_PKCS7 */
  132. #if defined(POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS)
  133. "POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS",
  134. #endif /* POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS */
  135. #if defined(POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN)
  136. "POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN",
  137. #endif /* POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN */
  138. #if defined(POLARSSL_CIPHER_PADDING_ZEROS)
  139. "POLARSSL_CIPHER_PADDING_ZEROS",
  140. #endif /* POLARSSL_CIPHER_PADDING_ZEROS */
  141. #if defined(POLARSSL_ENABLE_WEAK_CIPHERSUITES)
  142. "POLARSSL_ENABLE_WEAK_CIPHERSUITES",
  143. #endif /* POLARSSL_ENABLE_WEAK_CIPHERSUITES */
  144. #if defined(POLARSSL_REMOVE_ARC4_CIPHERSUITES)
  145. "POLARSSL_REMOVE_ARC4_CIPHERSUITES",
  146. #endif /* POLARSSL_REMOVE_ARC4_CIPHERSUITES */
  147. #if defined(POLARSSL_ECP_DP_SECP192R1_ENABLED)
  148. "POLARSSL_ECP_DP_SECP192R1_ENABLED",
  149. #endif /* POLARSSL_ECP_DP_SECP192R1_ENABLED */
  150. #if defined(POLARSSL_ECP_DP_SECP224R1_ENABLED)
  151. "POLARSSL_ECP_DP_SECP224R1_ENABLED",
  152. #endif /* POLARSSL_ECP_DP_SECP224R1_ENABLED */
  153. #if defined(POLARSSL_ECP_DP_SECP256R1_ENABLED)
  154. "POLARSSL_ECP_DP_SECP256R1_ENABLED",
  155. #endif /* POLARSSL_ECP_DP_SECP256R1_ENABLED */
  156. #if defined(POLARSSL_ECP_DP_SECP384R1_ENABLED)
  157. "POLARSSL_ECP_DP_SECP384R1_ENABLED",
  158. #endif /* POLARSSL_ECP_DP_SECP384R1_ENABLED */
  159. #if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED)
  160. "POLARSSL_ECP_DP_SECP521R1_ENABLED",
  161. #endif /* POLARSSL_ECP_DP_SECP521R1_ENABLED */
  162. #if defined(POLARSSL_ECP_DP_SECP192K1_ENABLED)
  163. "POLARSSL_ECP_DP_SECP192K1_ENABLED",
  164. #endif /* POLARSSL_ECP_DP_SECP192K1_ENABLED */
  165. #if defined(POLARSSL_ECP_DP_SECP224K1_ENABLED)
  166. "POLARSSL_ECP_DP_SECP224K1_ENABLED",
  167. #endif /* POLARSSL_ECP_DP_SECP224K1_ENABLED */
  168. #if defined(POLARSSL_ECP_DP_SECP256K1_ENABLED)
  169. "POLARSSL_ECP_DP_SECP256K1_ENABLED",
  170. #endif /* POLARSSL_ECP_DP_SECP256K1_ENABLED */
  171. #if defined(POLARSSL_ECP_DP_BP256R1_ENABLED)
  172. "POLARSSL_ECP_DP_BP256R1_ENABLED",
  173. #endif /* POLARSSL_ECP_DP_BP256R1_ENABLED */
  174. #if defined(POLARSSL_ECP_DP_BP384R1_ENABLED)
  175. "POLARSSL_ECP_DP_BP384R1_ENABLED",
  176. #endif /* POLARSSL_ECP_DP_BP384R1_ENABLED */
  177. #if defined(POLARSSL_ECP_DP_BP512R1_ENABLED)
  178. "POLARSSL_ECP_DP_BP512R1_ENABLED",
  179. #endif /* POLARSSL_ECP_DP_BP512R1_ENABLED */
  180. #if defined(POLARSSL_ECP_DP_M221_ENABLED)
  181. "POLARSSL_ECP_DP_M221_ENABLED",
  182. #endif /* POLARSSL_ECP_DP_M221_ENABLED */
  183. #if defined(POLARSSL_ECP_DP_M255_ENABLED)
  184. "POLARSSL_ECP_DP_M255_ENABLED",
  185. #endif /* POLARSSL_ECP_DP_M255_ENABLED */
  186. #if defined(POLARSSL_ECP_DP_M383_ENABLED)
  187. "POLARSSL_ECP_DP_M383_ENABLED",
  188. #endif /* POLARSSL_ECP_DP_M383_ENABLED */
  189. #if defined(POLARSSL_ECP_DP_M511_ENABLED)
  190. "POLARSSL_ECP_DP_M511_ENABLED",
  191. #endif /* POLARSSL_ECP_DP_M511_ENABLED */
  192. #if defined(POLARSSL_ECP_NIST_OPTIM)
  193. "POLARSSL_ECP_NIST_OPTIM",
  194. #endif /* POLARSSL_ECP_NIST_OPTIM */
  195. #if defined(POLARSSL_ECDSA_DETERMINISTIC)
  196. "POLARSSL_ECDSA_DETERMINISTIC",
  197. #endif /* POLARSSL_ECDSA_DETERMINISTIC */
  198. #if defined(POLARSSL_KEY_EXCHANGE_PSK_ENABLED)
  199. "POLARSSL_KEY_EXCHANGE_PSK_ENABLED",
  200. #endif /* POLARSSL_KEY_EXCHANGE_PSK_ENABLED */
  201. #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED)
  202. "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED",
  203. #endif /* POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED */
  204. #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
  205. "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED",
  206. #endif /* POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED */
  207. #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED)
  208. "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED",
  209. #endif /* POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED */
  210. #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED)
  211. "POLARSSL_KEY_EXCHANGE_RSA_ENABLED",
  212. #endif /* POLARSSL_KEY_EXCHANGE_RSA_ENABLED */
  213. #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED)
  214. "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED",
  215. #endif /* POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED */
  216. #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED)
  217. "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED",
  218. #endif /* POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED */
  219. #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
  220. "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED",
  221. #endif /* POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED */
  222. #if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
  223. "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED",
  224. #endif /* POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
  225. #if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED)
  226. "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED",
  227. #endif /* POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED */
  228. #if defined(POLARSSL_PK_PARSE_EC_EXTENDED)
  229. "POLARSSL_PK_PARSE_EC_EXTENDED",
  230. #endif /* POLARSSL_PK_PARSE_EC_EXTENDED */
  231. #if defined(POLARSSL_ERROR_STRERROR_BC)
  232. "POLARSSL_ERROR_STRERROR_BC",
  233. #endif /* POLARSSL_ERROR_STRERROR_BC */
  234. #if defined(POLARSSL_ERROR_STRERROR_DUMMY)
  235. "POLARSSL_ERROR_STRERROR_DUMMY",
  236. #endif /* POLARSSL_ERROR_STRERROR_DUMMY */
  237. #if defined(POLARSSL_GENPRIME)
  238. "POLARSSL_GENPRIME",
  239. #endif /* POLARSSL_GENPRIME */
  240. #if defined(POLARSSL_FS_IO)
  241. "POLARSSL_FS_IO",
  242. #endif /* POLARSSL_FS_IO */
  243. #if defined(POLARSSL_NO_DEFAULT_ENTROPY_SOURCES)
  244. "POLARSSL_NO_DEFAULT_ENTROPY_SOURCES",
  245. #endif /* POLARSSL_NO_DEFAULT_ENTROPY_SOURCES */
  246. #if defined(POLARSSL_NO_PLATFORM_ENTROPY)
  247. "POLARSSL_NO_PLATFORM_ENTROPY",
  248. #endif /* POLARSSL_NO_PLATFORM_ENTROPY */
  249. #if defined(POLARSSL_ENTROPY_FORCE_SHA256)
  250. "POLARSSL_ENTROPY_FORCE_SHA256",
  251. #endif /* POLARSSL_ENTROPY_FORCE_SHA256 */
  252. #if defined(POLARSSL_MEMORY_DEBUG)
  253. "POLARSSL_MEMORY_DEBUG",
  254. #endif /* POLARSSL_MEMORY_DEBUG */
  255. #if defined(POLARSSL_MEMORY_BACKTRACE)
  256. "POLARSSL_MEMORY_BACKTRACE",
  257. #endif /* POLARSSL_MEMORY_BACKTRACE */
  258. #if defined(POLARSSL_PKCS1_V15)
  259. "POLARSSL_PKCS1_V15",
  260. #endif /* POLARSSL_PKCS1_V15 */
  261. #if defined(POLARSSL_PKCS1_V21)
  262. "POLARSSL_PKCS1_V21",
  263. #endif /* POLARSSL_PKCS1_V21 */
  264. #if defined(POLARSSL_RSA_NO_CRT)
  265. "POLARSSL_RSA_NO_CRT",
  266. #endif /* POLARSSL_RSA_NO_CRT */
  267. #if defined(POLARSSL_SELF_TEST)
  268. "POLARSSL_SELF_TEST",
  269. #endif /* POLARSSL_SELF_TEST */
  270. #if defined(POLARSSL_SSL_ALERT_MESSAGES)
  271. "POLARSSL_SSL_ALERT_MESSAGES",
  272. #endif /* POLARSSL_SSL_ALERT_MESSAGES */
  273. #if defined(POLARSSL_SSL_DEBUG_ALL)
  274. "POLARSSL_SSL_DEBUG_ALL",
  275. #endif /* POLARSSL_SSL_DEBUG_ALL */
  276. #if defined(POLARSSL_SSL_HW_RECORD_ACCEL)
  277. "POLARSSL_SSL_HW_RECORD_ACCEL",
  278. #endif /* POLARSSL_SSL_HW_RECORD_ACCEL */
  279. #if defined(POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO)
  280. "POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO",
  281. #endif /* POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */
  282. #if defined(POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE)
  283. "POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE",
  284. #endif /* POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE */
  285. #if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
  286. "POLARSSL_SSL_MAX_FRAGMENT_LENGTH",
  287. #endif /* POLARSSL_SSL_MAX_FRAGMENT_LENGTH */
  288. #if defined(POLARSSL_SSL_PROTO_SSL3)
  289. "POLARSSL_SSL_PROTO_SSL3",
  290. #endif /* POLARSSL_SSL_PROTO_SSL3 */
  291. #if defined(POLARSSL_SSL_PROTO_TLS1)
  292. "POLARSSL_SSL_PROTO_TLS1",
  293. #endif /* POLARSSL_SSL_PROTO_TLS1 */
  294. #if defined(POLARSSL_SSL_PROTO_TLS1_1)
  295. "POLARSSL_SSL_PROTO_TLS1_1",
  296. #endif /* POLARSSL_SSL_PROTO_TLS1_1 */
  297. #if defined(POLARSSL_SSL_PROTO_TLS1_2)
  298. "POLARSSL_SSL_PROTO_TLS1_2",
  299. #endif /* POLARSSL_SSL_PROTO_TLS1_2 */
  300. #if defined(POLARSSL_SSL_ALPN)
  301. "POLARSSL_SSL_ALPN",
  302. #endif /* POLARSSL_SSL_ALPN */
  303. #if defined(POLARSSL_SSL_SESSION_TICKETS)
  304. "POLARSSL_SSL_SESSION_TICKETS",
  305. #endif /* POLARSSL_SSL_SESSION_TICKETS */
  306. #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
  307. "POLARSSL_SSL_SERVER_NAME_INDICATION",
  308. #endif /* POLARSSL_SSL_SERVER_NAME_INDICATION */
  309. #if defined(POLARSSL_SSL_TRUNCATED_HMAC)
  310. "POLARSSL_SSL_TRUNCATED_HMAC",
  311. #endif /* POLARSSL_SSL_TRUNCATED_HMAC */
  312. #if defined(POLARSSL_SSL_SET_CURVES)
  313. "POLARSSL_SSL_SET_CURVES",
  314. #endif /* POLARSSL_SSL_SET_CURVES */
  315. #if defined(POLARSSL_THREADING_ALT)
  316. "POLARSSL_THREADING_ALT",
  317. #endif /* POLARSSL_THREADING_ALT */
  318. #if defined(POLARSSL_THREADING_PTHREAD)
  319. "POLARSSL_THREADING_PTHREAD",
  320. #endif /* POLARSSL_THREADING_PTHREAD */
  321. #if defined(POLARSSL_VERSION_FEATURES)
  322. "POLARSSL_VERSION_FEATURES",
  323. #endif /* POLARSSL_VERSION_FEATURES */
  324. #if defined(POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
  325. "POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3",
  326. #endif /* POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 */
  327. #if defined(POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION)
  328. "POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION",
  329. #endif /* POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */
  330. #if defined(POLARSSL_X509_CHECK_KEY_USAGE)
  331. "POLARSSL_X509_CHECK_KEY_USAGE",
  332. #endif /* POLARSSL_X509_CHECK_KEY_USAGE */
  333. #if defined(POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE)
  334. "POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE",
  335. #endif /* POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE */
  336. #if defined(POLARSSL_X509_RSASSA_PSS_SUPPORT)
  337. "POLARSSL_X509_RSASSA_PSS_SUPPORT",
  338. #endif /* POLARSSL_X509_RSASSA_PSS_SUPPORT */
  339. #if defined(POLARSSL_ZLIB_SUPPORT)
  340. "POLARSSL_ZLIB_SUPPORT",
  341. #endif /* POLARSSL_ZLIB_SUPPORT */
  342. #if defined(POLARSSL_AESNI_C)
  343. "POLARSSL_AESNI_C",
  344. #endif /* POLARSSL_AESNI_C */
  345. #if defined(POLARSSL_AES_C)
  346. "POLARSSL_AES_C",
  347. #endif /* POLARSSL_AES_C */
  348. #if defined(POLARSSL_ARC4_C)
  349. "POLARSSL_ARC4_C",
  350. #endif /* POLARSSL_ARC4_C */
  351. #if defined(POLARSSL_ASN1_PARSE_C)
  352. "POLARSSL_ASN1_PARSE_C",
  353. #endif /* POLARSSL_ASN1_PARSE_C */
  354. #if defined(POLARSSL_ASN1_WRITE_C)
  355. "POLARSSL_ASN1_WRITE_C",
  356. #endif /* POLARSSL_ASN1_WRITE_C */
  357. #if defined(POLARSSL_BASE64_C)
  358. "POLARSSL_BASE64_C",
  359. #endif /* POLARSSL_BASE64_C */
  360. #if defined(POLARSSL_BIGNUM_C)
  361. "POLARSSL_BIGNUM_C",
  362. #endif /* POLARSSL_BIGNUM_C */
  363. #if defined(POLARSSL_BLOWFISH_C)
  364. "POLARSSL_BLOWFISH_C",
  365. #endif /* POLARSSL_BLOWFISH_C */
  366. #if defined(POLARSSL_CAMELLIA_C)
  367. "POLARSSL_CAMELLIA_C",
  368. #endif /* POLARSSL_CAMELLIA_C */
  369. #if defined(POLARSSL_CCM_C)
  370. "POLARSSL_CCM_C",
  371. #endif /* POLARSSL_CCM_C */
  372. #if defined(POLARSSL_CERTS_C)
  373. "POLARSSL_CERTS_C",
  374. #endif /* POLARSSL_CERTS_C */
  375. #if defined(POLARSSL_CIPHER_C)
  376. "POLARSSL_CIPHER_C",
  377. #endif /* POLARSSL_CIPHER_C */
  378. #if defined(POLARSSL_CTR_DRBG_C)
  379. "POLARSSL_CTR_DRBG_C",
  380. #endif /* POLARSSL_CTR_DRBG_C */
  381. #if defined(POLARSSL_DEBUG_C)
  382. "POLARSSL_DEBUG_C",
  383. #endif /* POLARSSL_DEBUG_C */
  384. #if defined(POLARSSL_DES_C)
  385. "POLARSSL_DES_C",
  386. #endif /* POLARSSL_DES_C */
  387. #if defined(POLARSSL_DHM_C)
  388. "POLARSSL_DHM_C",
  389. #endif /* POLARSSL_DHM_C */
  390. #if defined(POLARSSL_ECDH_C)
  391. "POLARSSL_ECDH_C",
  392. #endif /* POLARSSL_ECDH_C */
  393. #if defined(POLARSSL_ECDSA_C)
  394. "POLARSSL_ECDSA_C",
  395. #endif /* POLARSSL_ECDSA_C */
  396. #if defined(POLARSSL_ECP_C)
  397. "POLARSSL_ECP_C",
  398. #endif /* POLARSSL_ECP_C */
  399. #if defined(POLARSSL_ENTROPY_C)
  400. "POLARSSL_ENTROPY_C",
  401. #endif /* POLARSSL_ENTROPY_C */
  402. #if defined(POLARSSL_ERROR_C)
  403. "POLARSSL_ERROR_C",
  404. #endif /* POLARSSL_ERROR_C */
  405. #if defined(POLARSSL_GCM_C)
  406. "POLARSSL_GCM_C",
  407. #endif /* POLARSSL_GCM_C */
  408. #if defined(POLARSSL_HAVEGE_C)
  409. "POLARSSL_HAVEGE_C",
  410. #endif /* POLARSSL_HAVEGE_C */
  411. #if defined(POLARSSL_HMAC_DRBG_C)
  412. "POLARSSL_HMAC_DRBG_C",
  413. #endif /* POLARSSL_HMAC_DRBG_C */
  414. #if defined(POLARSSL_MD_C)
  415. "POLARSSL_MD_C",
  416. #endif /* POLARSSL_MD_C */
  417. #if defined(POLARSSL_MD2_C)
  418. "POLARSSL_MD2_C",
  419. #endif /* POLARSSL_MD2_C */
  420. #if defined(POLARSSL_MD4_C)
  421. "POLARSSL_MD4_C",
  422. #endif /* POLARSSL_MD4_C */
  423. #if defined(POLARSSL_MD5_C)
  424. "POLARSSL_MD5_C",
  425. #endif /* POLARSSL_MD5_C */
  426. #if defined(POLARSSL_MEMORY_C)
  427. "POLARSSL_MEMORY_C",
  428. #endif /* POLARSSL_MEMORY_C */
  429. #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
  430. "POLARSSL_MEMORY_BUFFER_ALLOC_C",
  431. #endif /* POLARSSL_MEMORY_BUFFER_ALLOC_C */
  432. #if defined(POLARSSL_NET_C)
  433. "POLARSSL_NET_C",
  434. #endif /* POLARSSL_NET_C */
  435. #if defined(POLARSSL_OID_C)
  436. "POLARSSL_OID_C",
  437. #endif /* POLARSSL_OID_C */
  438. #if defined(POLARSSL_PADLOCK_C)
  439. "POLARSSL_PADLOCK_C",
  440. #endif /* POLARSSL_PADLOCK_C */
  441. #if defined(POLARSSL_PBKDF2_C)
  442. "POLARSSL_PBKDF2_C",
  443. #endif /* POLARSSL_PBKDF2_C */
  444. #if defined(POLARSSL_PEM_PARSE_C)
  445. "POLARSSL_PEM_PARSE_C",
  446. #endif /* POLARSSL_PEM_PARSE_C */
  447. #if defined(POLARSSL_PEM_WRITE_C)
  448. "POLARSSL_PEM_WRITE_C",
  449. #endif /* POLARSSL_PEM_WRITE_C */
  450. #if defined(POLARSSL_PK_C)
  451. "POLARSSL_PK_C",
  452. #endif /* POLARSSL_PK_C */
  453. #if defined(POLARSSL_PK_PARSE_C)
  454. "POLARSSL_PK_PARSE_C",
  455. #endif /* POLARSSL_PK_PARSE_C */
  456. #if defined(POLARSSL_PK_WRITE_C)
  457. "POLARSSL_PK_WRITE_C",
  458. #endif /* POLARSSL_PK_WRITE_C */
  459. #if defined(POLARSSL_PKCS5_C)
  460. "POLARSSL_PKCS5_C",
  461. #endif /* POLARSSL_PKCS5_C */
  462. #if defined(POLARSSL_PKCS11_C)
  463. "POLARSSL_PKCS11_C",
  464. #endif /* POLARSSL_PKCS11_C */
  465. #if defined(POLARSSL_PKCS12_C)
  466. "POLARSSL_PKCS12_C",
  467. #endif /* POLARSSL_PKCS12_C */
  468. #if defined(POLARSSL_PLATFORM_C)
  469. "POLARSSL_PLATFORM_C",
  470. #endif /* POLARSSL_PLATFORM_C */
  471. #if defined(POLARSSL_RIPEMD160_C)
  472. "POLARSSL_RIPEMD160_C",
  473. #endif /* POLARSSL_RIPEMD160_C */
  474. #if defined(POLARSSL_RSA_C)
  475. "POLARSSL_RSA_C",
  476. #endif /* POLARSSL_RSA_C */
  477. #if defined(POLARSSL_SHA1_C)
  478. "POLARSSL_SHA1_C",
  479. #endif /* POLARSSL_SHA1_C */
  480. #if defined(POLARSSL_SHA256_C)
  481. "POLARSSL_SHA256_C",
  482. #endif /* POLARSSL_SHA256_C */
  483. #if defined(POLARSSL_SHA512_C)
  484. "POLARSSL_SHA512_C",
  485. #endif /* POLARSSL_SHA512_C */
  486. #if defined(POLARSSL_SSL_CACHE_C)
  487. "POLARSSL_SSL_CACHE_C",
  488. #endif /* POLARSSL_SSL_CACHE_C */
  489. #if defined(POLARSSL_SSL_CLI_C)
  490. "POLARSSL_SSL_CLI_C",
  491. #endif /* POLARSSL_SSL_CLI_C */
  492. #if defined(POLARSSL_SSL_SRV_C)
  493. "POLARSSL_SSL_SRV_C",
  494. #endif /* POLARSSL_SSL_SRV_C */
  495. #if defined(POLARSSL_SSL_TLS_C)
  496. "POLARSSL_SSL_TLS_C",
  497. #endif /* POLARSSL_SSL_TLS_C */
  498. #if defined(POLARSSL_THREADING_C)
  499. "POLARSSL_THREADING_C",
  500. #endif /* POLARSSL_THREADING_C */
  501. #if defined(POLARSSL_TIMING_C)
  502. "POLARSSL_TIMING_C",
  503. #endif /* POLARSSL_TIMING_C */
  504. #if defined(POLARSSL_VERSION_C)
  505. "POLARSSL_VERSION_C",
  506. #endif /* POLARSSL_VERSION_C */
  507. #if defined(POLARSSL_X509_USE_C)
  508. "POLARSSL_X509_USE_C",
  509. #endif /* POLARSSL_X509_USE_C */
  510. #if defined(POLARSSL_X509_CRT_PARSE_C)
  511. "POLARSSL_X509_CRT_PARSE_C",
  512. #endif /* POLARSSL_X509_CRT_PARSE_C */
  513. #if defined(POLARSSL_X509_CRL_PARSE_C)
  514. "POLARSSL_X509_CRL_PARSE_C",
  515. #endif /* POLARSSL_X509_CRL_PARSE_C */
  516. #if defined(POLARSSL_X509_CSR_PARSE_C)
  517. "POLARSSL_X509_CSR_PARSE_C",
  518. #endif /* POLARSSL_X509_CSR_PARSE_C */
  519. #if defined(POLARSSL_X509_CREATE_C)
  520. "POLARSSL_X509_CREATE_C",
  521. #endif /* POLARSSL_X509_CREATE_C */
  522. #if defined(POLARSSL_X509_CRT_WRITE_C)
  523. "POLARSSL_X509_CRT_WRITE_C",
  524. #endif /* POLARSSL_X509_CRT_WRITE_C */
  525. #if defined(POLARSSL_X509_CSR_WRITE_C)
  526. "POLARSSL_X509_CSR_WRITE_C",
  527. #endif /* POLARSSL_X509_CSR_WRITE_C */
  528. #if defined(POLARSSL_XTEA_C)
  529. "POLARSSL_XTEA_C",
  530. #endif /* POLARSSL_XTEA_C */
  531. #endif /* POLARSSL_VERSION_FEATURES */
  532. NULL
  533. };
  534. int version_check_feature( const char *feature )
  535. {
  536. const char **idx = features;
  537. if( *idx == NULL )
  538. return( -2 );
  539. if( feature == NULL )
  540. return( -1 );
  541. while( *idx != NULL )
  542. {
  543. if( !strcasecmp( *idx, feature ) )
  544. return( 0 );
  545. idx++;
  546. }
  547. return( -1 );
  548. }
  549. #endif /* POLARSSL_VERSION_C */