config.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. /**
  2. * \file config.h
  3. *
  4. * \brief Configuration options (set of defines)
  5. *
  6. * Copyright (C) 2006-2010, Brainspark B.V.
  7. *
  8. * This file is part of PolarSSL (http://www.polarssl.org)
  9. * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
  10. *
  11. * All rights reserved.
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License along
  24. * with this program; if not, write to the Free Software Foundation, Inc.,
  25. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  26. *
  27. * This set of compile-time options may be used to enable
  28. * or disable features selectively, and reduce the global
  29. * memory footprint.
  30. */
  31. #ifndef POLARSSL_CONFIG_H
  32. #define POLARSSL_CONFIG_H
  33. #ifndef _CRT_SECURE_NO_DEPRECATE
  34. #define _CRT_SECURE_NO_DEPRECATE 1
  35. #endif
  36. #define free vPortFree
  37. #define malloc pvPortMalloc
  38. /**
  39. * \name SECTION: System support
  40. *
  41. * This section sets system specific settings.
  42. * \{
  43. */
  44. /**
  45. * \def POLARSSL_HAVE_INT8
  46. *
  47. * The system uses 8-bit wide native integers.
  48. *
  49. * Uncomment if native integers are 8-bit wide.
  50. #define POLARSSL_HAVE_INT8
  51. */
  52. /**
  53. * \def POLARSSL_HAVE_INT16
  54. *
  55. * The system uses 16-bit wide native integers.
  56. *
  57. * Uncomment if native integers are 16-bit wide.
  58. #define POLARSSL_HAVE_INT16
  59. */
  60. /**
  61. * \def POLARSSL_HAVE_LONGLONG
  62. *
  63. * The compiler supports the use of long long.
  64. *
  65. * Uncomment if the compiler supports long long.
  66. #define POLARSSL_HAVE_LONGLONG
  67. */
  68. /**
  69. * \def POLARSSL_HAVE_ASM
  70. *
  71. * The compiler has support for asm()
  72. *
  73. * Uncomment to enable the use of assembly code.
  74. *
  75. * Requires support for asm() in compiler.
  76. *
  77. * Used in:
  78. * library/timing.c
  79. * library/padlock.c
  80. * include/polarssl/bn_mul.h
  81. *
  82. */
  83. //#define POLARSSL_HAVE_ASM
  84. /**
  85. * \def POLARSSL_HAVE_SSE2
  86. *
  87. * CPI supports SSE2 instruction set.
  88. *
  89. * Uncomment if the CPU supports SSE2 (IA-32 specific).
  90. *
  91. #define POLARSSL_HAVE_SSE2
  92. */
  93. /* \} name */
  94. /**
  95. * \name SECTION: PolarSSL feature support
  96. *
  97. * This section sets support for features that are or are not needed
  98. * within the modules that are enabled.
  99. * \{
  100. */
  101. /**
  102. * \def POLARSSL_AES_ROM_TABLES
  103. *
  104. * Store the AES tables in ROM.
  105. *
  106. * Uncomment this macro to store the AES tables in ROM.
  107. *
  108. #define POLARSSL_AES_ROM_TABLES
  109. */
  110. /**
  111. * \def POLARSSL_CIPHER_MODE_CFB
  112. *
  113. * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
  114. */
  115. #define POLARSSL_CIPHER_MODE_CFB
  116. /**
  117. * \def POLARSSL_CIPHER_MODE_CTR
  118. *
  119. * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
  120. */
  121. #define POLARSSL_CIPHER_MODE_CTR
  122. /**
  123. * \def POLARSSL_DEBUG_MSG
  124. *
  125. * Requires: POLARSSL_DEBUG_C
  126. *
  127. * Enable all SSL/TLS debugging messages.
  128. */
  129. #define POLARSSL_DEBUG_MSG
  130. /**
  131. * \def POLARSSL_GENPRIME
  132. *
  133. * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
  134. *
  135. * Enable the RSA prime-number generation code.
  136. */
  137. #define POLARSSL_GENPRIME
  138. /**
  139. * \def POLARSSL_FS_IO
  140. *
  141. * Enable functions that use the filesystem.
  142. #define POLARSSL_FS_IO
  143. */
  144. /**
  145. * \def POLARSSL_PKCS1_V21
  146. *
  147. * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
  148. *
  149. * Enable support for PKCS#1 v2.1 encoding.
  150. * This enables support for RSAES-OAEP and RSASSA-PSS operations.
  151. */
  152. #define POLARSSL_PKCS1_V21
  153. /**
  154. * \def POLARSSL_RSA_NO_CRT
  155. *
  156. * Do not use the Chinese Remainder Theorem for the RSA private operation.
  157. *
  158. * Uncomment this macro to disable the use of CRT in RSA.
  159. *
  160. #define POLARSSL_RSA_NO_CRT
  161. */
  162. /**
  163. * \def POLARSSL_SELF_TEST
  164. *
  165. * Enable the checkup functions (*_self_test).
  166. #define POLARSSL_SELF_TEST
  167. */
  168. /**
  169. * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
  170. *
  171. * If set, the X509 parser will not break-off when parsing an X509 certificate
  172. * and encountering an unknown critical extension.
  173. *
  174. * Uncomment to prevent an error.
  175. *
  176. #define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
  177. */
  178. /* \} name */
  179. /**
  180. * \name SECTION: PolarSSL modules
  181. *
  182. * This section enables or disables entire modules in PolarSSL
  183. * \{
  184. */
  185. /**
  186. * \def POLARSSL_AES_C
  187. *
  188. * Enable the AES block cipher.
  189. *
  190. * Module: library/aes.c
  191. * Caller: library/ssl_tls.c
  192. * library/pem.c
  193. *
  194. * This module enables the following ciphersuites:
  195. * SSL_RSA_AES_128_SHA
  196. * SSL_RSA_AES_256_SHA
  197. * SSL_EDH_RSA_AES_256_SHA
  198. */
  199. #define POLARSSL_AES_C
  200. /**
  201. * \def POLARSSL_ARC4_C
  202. *
  203. * Enable the ARCFOUR stream cipher.
  204. *
  205. * Module: library/arc4.c
  206. * Caller: library/ssl_tls.c
  207. *
  208. * This module enables the following ciphersuites:
  209. * SSL_RSA_RC4_128_MD5
  210. * SSL_RSA_RC4_128_SHA
  211. */
  212. #define POLARSSL_ARC4_C
  213. /**
  214. * \def POLARSSL_BASE64_C
  215. *
  216. * Enable the Base64 module.
  217. *
  218. * Module: library/base64.c
  219. * Caller: library/pem.c
  220. *
  221. * This module is required for PEM support (required by X.509).
  222. */
  223. #define POLARSSL_BASE64_C
  224. /**
  225. * \def POLARSSL_BIGNUM_C
  226. *
  227. * Enable the multo-precision integer library.
  228. *
  229. * Module: library/bignum.c
  230. * Caller: library/dhm.c
  231. * library/rsa.c
  232. * library/ssl_tls.c
  233. * library/x509parse.c
  234. *
  235. * This module is required for RSA and DHM support.
  236. */
  237. #define POLARSSL_BIGNUM_C
  238. /**
  239. * \def POLARSSL_CAMELLIA_C
  240. *
  241. * Enable the Camellia block cipher.
  242. *
  243. * Module: library/camellia.c
  244. * Caller: library/ssl_tls.c
  245. *
  246. * This module enabled the following cipher suites:
  247. * SSL_RSA_CAMELLIA_128_SHA
  248. * SSL_RSA_CAMELLIA_256_SHA
  249. * SSL_EDH_RSA_CAMELLIA_256_SHA
  250. */
  251. #define POLARSSL_CAMELLIA_C
  252. /**
  253. * \def POLARSSL_CERTS_C
  254. *
  255. * Enable the test certificates.
  256. *
  257. * Module: library/certs.c
  258. * Caller:
  259. *
  260. * This module is used for testing (ssl_client/server).
  261. */
  262. #define POLARSSL_CERTS_C
  263. /**
  264. * \def POLARSSL_CIPHER_C
  265. *
  266. * Enable the generic cipher layer.
  267. *
  268. * Module: library/cipher.c
  269. * Caller:
  270. *
  271. * Uncomment to enable generic cipher wrappers.
  272. */
  273. #define POLARSSL_CIPHER_C
  274. /**
  275. * \def POLARSSL_DEBUG_C
  276. *
  277. * Enable the debug functions.
  278. *
  279. * Module: library/debug.c
  280. * Caller: library/ssl_cli.c
  281. * library/ssl_srv.c
  282. * library/ssl_tls.c
  283. *
  284. * This module provides debugging functions.
  285. */
  286. #define POLARSSL_DEBUG_C
  287. /**
  288. * \def POLARSSL_DES_C
  289. *
  290. * Enable the DES block cipher.
  291. *
  292. * Module: library/des.c
  293. * Caller: library/ssl_tls.c
  294. *
  295. * This module enables the following ciphersuites:
  296. * SSL_RSA_DES_168_SHA
  297. * SSL_EDH_RSA_DES_168_SHA
  298. */
  299. #define POLARSSL_DES_C
  300. /**
  301. * \def POLARSSL_DHM_C
  302. *
  303. * Enable the Diffie-Hellman-Merkle key exchange.
  304. *
  305. * Module: library/dhm.c
  306. * Caller: library/ssl_cli.c
  307. * library/ssl_srv.c
  308. *
  309. * This module enables the following ciphersuites:
  310. * SSL_EDH_RSA_DES_168_SHA
  311. * SSL_EDH_RSA_AES_256_SHA
  312. * SSL_EDH_RSA_CAMELLIA_256_SHA
  313. */
  314. #define POLARSSL_DHM_C
  315. /**
  316. * \def POLARSSL_ERROR_C
  317. *
  318. * Enable error code to error string conversion.
  319. *
  320. * Module: library/error.c
  321. * Caller:
  322. *
  323. * This module enables err_strerror().
  324. */
  325. #define POLARSSL_ERROR_C
  326. /**
  327. * \def POLARSSL_HAVEGE_C
  328. *
  329. * Enable the HAVEGE random generator.
  330. *
  331. * Module: library/havege.c
  332. * Caller:
  333. *
  334. * Requires: POLARSSL_TIMING_C
  335. *
  336. * This module enables the HAVEGE random number generator.
  337. #define POLARSSL_HAVEGE_C
  338. */
  339. /**
  340. * \def POLARSSL_MD_C
  341. *
  342. * Enable the generic message digest layer.
  343. *
  344. * Module: library/md.c
  345. * Caller:
  346. *
  347. * Uncomment to enable generic message digest wrappers.
  348. */
  349. #define POLARSSL_MD_C
  350. /**
  351. * \def POLARSSL_MD2_C
  352. *
  353. * Enable the MD2 hash algorithm
  354. *
  355. * Module: library/md2.c
  356. * Caller: library/x509parse.c
  357. *
  358. * Uncomment to enable support for (rare) MD2-signed X.509 certs.
  359. *
  360. #define POLARSSL_MD2_C
  361. */
  362. /**
  363. * \def POLARSSL_MD4_C
  364. *
  365. * Enable the MD4 hash algorithm
  366. *
  367. * Module: library/md4.c
  368. * Caller: library/x509parse.c
  369. *
  370. * Uncomment to enable support for (rare) MD4-signed X.509 certs.
  371. *
  372. #define POLARSSL_MD4_C
  373. */
  374. /**
  375. * \def POLARSSL_MD5_C
  376. *
  377. * Enable the MD5 hash algorithm
  378. *
  379. * Module: library/md5.c
  380. * Caller: library/ssl_tls.c
  381. * library/x509parse.c
  382. *
  383. * This module is required for SSL/TLS and X.509.
  384. */
  385. #define POLARSSL_MD5_C
  386. /**
  387. * \def POLARSSL_NET_C
  388. *
  389. * Enable the TCP/IP networking routines.
  390. *
  391. * Module: library/net.c
  392. * Caller:
  393. *
  394. * This module provides TCP/IP networking routines.
  395. */
  396. #define POLARSSL_NET_C
  397. /**
  398. * \def POLARSSL_PADLOCK_C
  399. *
  400. * Enable VIA Padlock support on x86.
  401. *
  402. * Module: library/padlock.c
  403. * Caller: library/aes.c
  404. *
  405. * This modules adds support for the VIA PadLock on x86.
  406. #define POLARSSL_PADLOCK_C
  407. */
  408. /**
  409. * \def POLARSSL_PEM_C
  410. *
  411. * Enable PEM decoding
  412. *
  413. * Module: library/pem.c
  414. * Caller: library/x509parse.c
  415. *
  416. * Requires: POLARSSL_BASE64_C
  417. *
  418. * This modules adds support for decoding PEM files.
  419. */
  420. #define POLARSSL_PEM_C
  421. /**
  422. * \def POLARSSL_PKCS11_C
  423. *
  424. * Enable support for PKCS#11 smartcard support.
  425. *
  426. * Module: library/ssl_srv.c
  427. * Caller: library/ssl_cli.c
  428. * library/ssl_srv.c
  429. *
  430. * Requires: POLARSSL_SSL_TLS_C
  431. *
  432. * This module is required for SSL/TLS PKCS #11 smartcard support.
  433. * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
  434. #define POLARSSL_PKCS11_C
  435. */
  436. /**
  437. * \def POLARSSL_RSA_C
  438. *
  439. * Enable the RSA public-key cryptosystem.
  440. *
  441. * Module: library/rsa.c
  442. * Caller: library/ssl_cli.c
  443. * library/ssl_srv.c
  444. * library/ssl_tls.c
  445. * library/x509.c
  446. *
  447. * Requires: POLARSSL_BIGNUM_C
  448. *
  449. * This module is required for SSL/TLS and MD5-signed certificates.
  450. */
  451. #define POLARSSL_RSA_C
  452. /**
  453. * \def POLARSSL_SHA1_C
  454. *
  455. * Enable the SHA1 cryptographic hash algorithm.
  456. *
  457. * Module: library/sha1.c
  458. * Caller: library/ssl_cli.c
  459. * library/ssl_srv.c
  460. * library/ssl_tls.c
  461. * library/x509parse.c
  462. *
  463. * This module is required for SSL/TLS and SHA1-signed certificates.
  464. */
  465. #define POLARSSL_SHA1_C
  466. /**
  467. * \def POLARSSL_SHA2_C
  468. *
  469. * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
  470. *
  471. * Module: library/sha2.c
  472. * Caller: library/md_wrap.c
  473. * library/x509parse.c
  474. *
  475. * This module adds support for SHA-224 and SHA-256.
  476. */
  477. #define POLARSSL_SHA2_C
  478. /**
  479. * \def POLARSSL_SHA4_C
  480. *
  481. * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
  482. *
  483. * Module: library/sha4.c
  484. * Caller: library/md_wrap.c
  485. * library/x509parse.c
  486. *
  487. * This module adds support for SHA-384 and SHA-512.
  488. */
  489. #define POLARSSL_SHA4_C
  490. /**
  491. * \def POLARSSL_SSL_CLI_C
  492. *
  493. * Enable the SSL/TLS client code.
  494. *
  495. * Module: library/ssl_cli.c
  496. * Caller:
  497. *
  498. * Requires: POLARSSL_SSL_TLS_C
  499. *
  500. * This module is required for SSL/TLS client support.
  501. #define POLARSSL_SSL_CLI_C
  502. */
  503. /*
  504. * \def POLARSSL_SSL_SRV_C
  505. *
  506. * Enable the SSL/TLS server code.
  507. *
  508. * Module: library/ssl_srv.c
  509. * Caller:
  510. *
  511. * Requires: POLARSSL_SSL_TLS_C
  512. *
  513. * This module is required for SSL/TLS server support.
  514. */
  515. #define POLARSSL_SSL_SRV_C
  516. /**
  517. * \def POLARSSL_SSL_TLS_C
  518. *
  519. * Enable the generic SSL/TLS code.
  520. *
  521. * Module: library/ssl_tls.c
  522. * Caller: library/ssl_cli.c
  523. * library/ssl_srv.c
  524. *
  525. * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C, POLARSSL_X509_PARSE_C
  526. *
  527. * This module is required for SSL/TLS.
  528. */
  529. #define POLARSSL_SSL_TLS_C
  530. /**
  531. * \def POLARSSL_TIMING_C
  532. *
  533. * Enable the portable timing interface.
  534. *
  535. * Module: library/timing.c
  536. * Caller: library/havege.c
  537. *
  538. * This module is used by the HAVEGE random number generator.
  539. #define POLARSSL_TIMING_C
  540. */
  541. /**
  542. * \def POLARSSL_VERSION_C
  543. *
  544. * Enable run-time version information.
  545. *
  546. * Module: library/version.c
  547. *
  548. * This module provides run-time version information.
  549. */
  550. #define POLARSSL_VERSION_C
  551. /**
  552. * \def POLARSSL_X509_PARSE_C
  553. *
  554. * Enable X.509 certificate parsing.
  555. *
  556. * Module: library/x509parse.c
  557. * Caller: library/ssl_cli.c
  558. * library/ssl_srv.c
  559. * library/ssl_tls.c
  560. *
  561. * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
  562. *
  563. * This module is required for X.509 certificate parsing.
  564. */
  565. #define POLARSSL_X509_PARSE_C
  566. /**
  567. * \def POLARSSL_XTEA_C
  568. *
  569. * Enable the XTEA block cipher.
  570. *
  571. * Module: library/xtea.c
  572. * Caller:
  573. */
  574. #define POLARSSL_XTEA_C
  575. /* \} name */
  576. #endif /* config.h */