Kconfig 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. menu "mbedTLS"
  2. choice MBEDTLS_MEM_ALLOC_MODE
  3. prompt "Memory allocation strategy"
  4. default MBEDTLS_INTERNAL_MEM_ALLOC
  5. help
  6. Allocation strategy for mbedTLS, essentially provides ability to
  7. allocate all required dynamic allocations from,
  8. - Internal DRAM memory only
  9. - External SPIRAM memory only
  10. - Either internal or external memory based on default malloc()
  11. behavior in ESP-IDF
  12. - Custom allocation mode, by overwriting calloc()/free() using
  13. mbedtls_platform_set_calloc_free() function
  14. Recommended mode here is always internal, since that is most preferred
  15. from security perspective. But if application requirement does not
  16. allow sufficient free internal memory then alternate mode can be
  17. selected.
  18. config MBEDTLS_INTERNAL_MEM_ALLOC
  19. bool "Internal memory"
  20. config MBEDTLS_EXTERNAL_MEM_ALLOC
  21. bool "External SPIRAM"
  22. depends on SPIRAM_SUPPORT
  23. config MBEDTLS_DEFAULT_MEM_ALLOC
  24. bool "Default alloc mode"
  25. config MBEDTLS_CUSTOM_MEM_ALLOC
  26. bool "Custom alloc mode"
  27. endchoice #MBEDTLS_MEM_ALLOC_MODE
  28. config MBEDTLS_SSL_MAX_CONTENT_LEN
  29. int "TLS maximum message content length"
  30. default 16384
  31. range 512 16384
  32. depends on !MBEDTLS_ASYMMETRIC_CONTENT_LEN
  33. help
  34. Maximum TLS message length (in bytes) supported by mbedTLS.
  35. 16384 is the default and this value is required to comply
  36. fully with TLS standards.
  37. However you can set a lower value in order to save RAM. This
  38. is safe if the other end of the connection supports Maximum
  39. Fragment Length Negotiation Extension (max_fragment_length,
  40. see RFC6066) or you know for certain that it will never send a
  41. message longer than a certain number of bytes.
  42. If the value is set too low, symptoms are a failed TLS
  43. handshake or a return value of MBEDTLS_ERR_SSL_INVALID_RECORD
  44. (-0x7200).
  45. config MBEDTLS_ASYMMETRIC_CONTENT_LEN
  46. bool "Asymmetric in/out fragment length"
  47. default n
  48. help
  49. If enabled, this option allows customizing TLS in/out fragment length
  50. in asymmetric way. Please note that enabling this with default values
  51. saves 12KB of dynamic memory per TLS connection.
  52. config MBEDTLS_SSL_IN_CONTENT_LEN
  53. int "TLS maximum incoming fragment length"
  54. default 16384
  55. range 512 16384
  56. depends on MBEDTLS_ASYMMETRIC_CONTENT_LEN
  57. help
  58. This defines maximum incoming fragment length, overriding default
  59. maximum content length (MBEDTLS_SSL_MAX_CONTENT_LEN).
  60. config MBEDTLS_SSL_OUT_CONTENT_LEN
  61. int "TLS maximum outgoing fragment length"
  62. default 4096
  63. range 512 16384
  64. depends on MBEDTLS_ASYMMETRIC_CONTENT_LEN
  65. help
  66. This defines maximum outgoing fragment length, overriding default
  67. maximum content length (MBEDTLS_SSL_MAX_CONTENT_LEN).
  68. config MBEDTLS_DEBUG
  69. bool "Enable mbedTLS debugging"
  70. default n
  71. help
  72. Enable mbedTLS debugging functions at compile time.
  73. If this option is enabled, you can include
  74. "mbedtls/esp_debug.h" and call mbedtls_esp_enable_debug_log()
  75. at runtime in order to enable mbedTLS debug output via the ESP
  76. log mechanism.
  77. config MBEDTLS_HARDWARE_AES
  78. bool "Enable hardware AES acceleration"
  79. default y
  80. help
  81. Enable hardware accelerated AES encryption & decryption.
  82. Note that if the ESP32 CPU is running at 240MHz, hardware AES does not
  83. offer any speed boost over software AES.
  84. config MBEDTLS_HARDWARE_MPI
  85. bool "Enable hardware MPI (bignum) acceleration"
  86. default n
  87. help
  88. Enable hardware accelerated multiple precision integer operations.
  89. Hardware accelerated multiplication, modulo multiplication,
  90. and modular exponentiation for up to 4096 bit results.
  91. These operations are used by RSA.
  92. config MBEDTLS_MPI_USE_INTERRUPT
  93. bool "Use interrupt for MPI operations"
  94. depends on MBEDTLS_HARDWARE_MPI
  95. default n
  96. help
  97. Use an interrupt to coordinate MPI operations.
  98. This allows other code to run on the CPU while an MPI operation is pending.
  99. Otherwise the CPU busy-waits.
  100. config MBEDTLS_HARDWARE_SHA
  101. bool "Enable hardware SHA acceleration"
  102. default n
  103. help
  104. Enable hardware accelerated SHA1, SHA256, SHA384 & SHA512 in mbedTLS.
  105. Due to a hardware limitation, hardware acceleration is only
  106. guaranteed if SHA digests are calculated one at a time. If more
  107. than one SHA digest is calculated at the same time, one will
  108. be calculated fully in hardware and the rest will be calculated
  109. (at least partially calculated) in software. This happens automatically.
  110. SHA hardware acceleration is faster than software in some situations but
  111. slower in others. You should benchmark to find the best setting for you.
  112. config MBEDTLS_HAVE_TIME
  113. bool "Enable mbedtls time"
  114. depends on !ESP32_TIME_SYSCALL_USE_NONE
  115. default y
  116. help
  117. System has time.h and time().
  118. The time does not need to be correct, only time differences are used.
  119. config MBEDTLS_HAVE_TIME_DATE
  120. bool "Enable mbedtls certificate expiry check"
  121. depends on MBEDTLS_HAVE_TIME
  122. default n
  123. help
  124. System has time.h and time(), gmtime() and the clock is correct.
  125. The time needs to be correct (not necesarily very accurate, but at least
  126. the date should be correct). This is used to verify the validity period of
  127. X.509 certificates.
  128. It is suggested that you should get the real time by "SNTP".
  129. choice MBEDTLS_TLS_MODE
  130. bool "TLS Protocol Role"
  131. default MBEDTLS_TLS_SERVER_AND_CLIENT
  132. help
  133. mbedTLS can be compiled with protocol support for the TLS
  134. server, TLS client, or both server and client.
  135. Reducing the number of TLS roles supported saves code size.
  136. config MBEDTLS_TLS_SERVER_AND_CLIENT
  137. bool "Server & Client"
  138. select MBEDTLS_TLS_SERVER
  139. select MBEDTLS_TLS_CLIENT
  140. config MBEDTLS_TLS_SERVER_ONLY
  141. bool "Server"
  142. select MBEDTLS_TLS_SERVER
  143. config MBEDTLS_TLS_CLIENT_ONLY
  144. bool "Client"
  145. select MBEDTLS_TLS_CLIENT
  146. config MBEDTLS_TLS_DISABLED
  147. bool "None"
  148. endchoice
  149. config MBEDTLS_TLS_SERVER
  150. bool
  151. select MBEDTLS_TLS_ENABLED
  152. config MBEDTLS_TLS_CLIENT
  153. bool
  154. select MBEDTLS_TLS_ENABLED
  155. config MBEDTLS_TLS_ENABLED
  156. bool
  157. menu "TLS Key Exchange Methods"
  158. depends on MBEDTLS_TLS_ENABLED
  159. config MBEDTLS_PSK_MODES
  160. bool "Enable pre-shared-key ciphersuites"
  161. default n
  162. help
  163. Enable to show configuration for different types of pre-shared-key TLS authentatication methods.
  164. Leaving this options disabled will save code size if they are not used.
  165. config MBEDTLS_KEY_EXCHANGE_PSK
  166. bool "Enable PSK based ciphersuite modes"
  167. depends on MBEDTLS_PSK_MODES
  168. default n
  169. help
  170. Enable to support symmetric key PSK (pre-shared-key) TLS key exchange modes.
  171. config MBEDTLS_KEY_EXCHANGE_DHE_PSK
  172. bool "Enable DHE-PSK based ciphersuite modes"
  173. depends on MBEDTLS_PSK_MODES
  174. default y
  175. help
  176. Enable to support Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  177. config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
  178. bool "Enable ECDHE-PSK based ciphersuite modes"
  179. depends on MBEDTLS_PSK_MODES
  180. default y
  181. help
  182. Enable to support Elliptic-Curve-Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  183. config MBEDTLS_KEY_EXCHANGE_RSA_PSK
  184. bool "Enable RSA-PSK based ciphersuite modes"
  185. depends on MBEDTLS_PSK_MODES
  186. default y
  187. help
  188. Enable to support RSA PSK (pre-shared-key) TLS authentication modes.
  189. config MBEDTLS_KEY_EXCHANGE_RSA
  190. bool "Enable RSA-only based ciphersuite modes"
  191. default y
  192. help
  193. Enable to support ciphersuites with prefix TLS-RSA-WITH-
  194. config MBEDTLS_KEY_EXCHANGE_DHE_RSA
  195. bool "Enable DHE-RSA based ciphersuite modes"
  196. default y
  197. help
  198. Enable to support ciphersuites with prefix TLS-DHE-RSA-WITH-
  199. config MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE
  200. bool "Support Elliptic Curve based ciphersuites"
  201. depends on MBEDTLS_ECP_C
  202. default y
  203. help
  204. Enable to show Elliptic Curve based ciphersuite mode options.
  205. Disabling all Elliptic Curve ciphersuites saves code size and
  206. can give slightly faster TLS handshakes, provided the server supports
  207. RSA-only ciphersuite modes.
  208. config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA
  209. bool "Enable ECDHE-RSA based ciphersuite modes"
  210. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  211. default y
  212. help
  213. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  214. config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA
  215. bool "Enable ECDHE-ECDSA based ciphersuite modes"
  216. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  217. default y
  218. help
  219. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  220. config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA
  221. bool "Enable ECDH-ECDSA based ciphersuite modes"
  222. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  223. default y
  224. help
  225. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  226. config MBEDTLS_KEY_EXCHANGE_ECDH_RSA
  227. bool "Enable ECDH-RSA based ciphersuite modes"
  228. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  229. default y
  230. help
  231. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  232. endmenu # TLS key exchange modes
  233. config MBEDTLS_SSL_RENEGOTIATION
  234. bool "Support TLS renegotiation"
  235. depends on MBEDTLS_TLS_ENABLED
  236. default y
  237. help
  238. The two main uses of renegotiation are (1) refresh keys on long-lived
  239. connections and (2) client authentication after the initial handshake.
  240. If you don't need renegotiation, disabling it will save code size and
  241. reduce the possibility of abuse/vulnerability.
  242. config MBEDTLS_SSL_PROTO_SSL3
  243. bool "Legacy SSL 3.0 support"
  244. depends on MBEDTLS_TLS_ENABLED
  245. default n
  246. help
  247. Support the legacy SSL 3.0 protocol. Most servers will speak a newer
  248. TLS protocol these days.
  249. config MBEDTLS_SSL_PROTO_TLS1
  250. bool "Support TLS 1.0 protocol"
  251. depends on MBEDTLS_TLS_ENABLED
  252. default y
  253. config MBEDTLS_SSL_PROTO_TLS1_1
  254. bool "Support TLS 1.1 protocol"
  255. depends on MBEDTLS_TLS_ENABLED
  256. default y
  257. config MBEDTLS_SSL_PROTO_TLS1_2
  258. bool "Support TLS 1.2 protocol"
  259. depends on MBEDTLS_TLS_ENABLED
  260. default y
  261. config MBEDTLS_SSL_PROTO_DTLS
  262. bool "Support DTLS protocol (all versions)"
  263. default n
  264. depends on MBEDTLS_SSL_PROTO_TLS1_1 || MBEDTLS_SSL_PROTO_TLS1_2
  265. help
  266. Requires TLS 1.1 to be enabled for DTLS 1.0
  267. Requires TLS 1.2 to be enabled for DTLS 1.2
  268. config MBEDTLS_SSL_ALPN
  269. bool "Support ALPN (Application Layer Protocol Negotiation)"
  270. depends on MBEDTLS_TLS_ENABLED
  271. default y
  272. help
  273. Disabling this option will save some code size if it is not needed.
  274. config MBEDTLS_SSL_SESSION_TICKETS
  275. bool "TLS: Support RFC 5077 SSL session tickets"
  276. default y
  277. depends on MBEDTLS_TLS_ENABLED
  278. help
  279. Support RFC 5077 session tickets. See mbedTLS documentation for more details.
  280. Disabling this option will save some code size.
  281. menu "Symmetric Ciphers"
  282. config MBEDTLS_AES_C
  283. bool "AES block cipher"
  284. default y
  285. config MBEDTLS_CAMELLIA_C
  286. bool "Camellia block cipher"
  287. default n
  288. config MBEDTLS_DES_C
  289. bool "DES block cipher (legacy, insecure)"
  290. default n
  291. help
  292. Enables the DES block cipher to support 3DES-based TLS ciphersuites.
  293. 3DES is vulnerable to the Sweet32 attack and should only be enabled
  294. if absolutely necessary.
  295. choice MBEDTLS_RC4_MODE
  296. prompt "RC4 Stream Cipher (legacy, insecure)"
  297. default MBEDTLS_RC4_DISABLED
  298. help
  299. ARCFOUR (RC4) stream cipher can be disabled entirely, enabled but not
  300. added to default ciphersuites, or enabled completely.
  301. Please consider the security implications before enabling RC4.
  302. config MBEDTLS_RC4_DISABLED
  303. bool "Disabled"
  304. config MBEDTLS_RC4_ENABLED_NO_DEFAULT
  305. bool "Enabled, not in default ciphersuites"
  306. config MBEDTLS_RC4_ENABLED
  307. bool "Enabled"
  308. endchoice
  309. config MBEDTLS_BLOWFISH_C
  310. bool "Blowfish block cipher (read help)"
  311. default n
  312. help
  313. Enables the Blowfish block cipher (not used for TLS sessions.)
  314. The Blowfish cipher is not used for mbedTLS TLS sessions but can be
  315. used for other purposes. Read up on the limitations of Blowfish (including
  316. Sweet32) before enabling.
  317. config MBEDTLS_XTEA_C
  318. bool "XTEA block cipher"
  319. default n
  320. help
  321. Enables the XTEA block cipher.
  322. config MBEDTLS_CCM_C
  323. bool "CCM (Counter with CBC-MAC) block cipher modes"
  324. default y
  325. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  326. help
  327. Enable Counter with CBC-MAC (CCM) modes for AES and/or Camellia ciphers.
  328. Disabling this option saves some code size.
  329. config MBEDTLS_GCM_C
  330. bool "GCM (Galois/Counter) block cipher modes"
  331. default y
  332. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  333. help
  334. Enable Galois/Counter Mode for AES and/or Camellia ciphers.
  335. This option is generally faster than CCM.
  336. endmenu # Symmetric Ciphers
  337. config MBEDTLS_RIPEMD160_C
  338. bool "Enable RIPEMD-160 hash algorithm"
  339. default n
  340. help
  341. Enable the RIPEMD-160 hash algorithm.
  342. menu "Certificates"
  343. config MBEDTLS_PEM_PARSE_C
  344. bool "Read & Parse PEM formatted certificates"
  345. default y
  346. help
  347. Enable decoding/parsing of PEM formatted certificates.
  348. If your certificates are all in the simpler DER format, disabling
  349. this option will save some code size.
  350. config MBEDTLS_PEM_WRITE_C
  351. bool "Write PEM formatted certificates"
  352. default y
  353. help
  354. Enable writing of PEM formatted certificates.
  355. If writing certificate data only in DER format, disabling this
  356. option will save some code size.
  357. config MBEDTLS_X509_CRL_PARSE_C
  358. bool "X.509 CRL parsing"
  359. default y
  360. help
  361. Support for parsing X.509 Certifificate Revocation Lists.
  362. config MBEDTLS_X509_CSR_PARSE_C
  363. bool "X.509 CSR parsing"
  364. default y
  365. help
  366. Support for parsing X.509 Certifificate Signing Requests
  367. endmenu # Certificates
  368. menuconfig MBEDTLS_ECP_C
  369. bool "Elliptic Curve Ciphers"
  370. default y
  371. config MBEDTLS_ECDH_C
  372. bool "Elliptic Curve Diffie-Hellman (ECDH)"
  373. depends on MBEDTLS_ECP_C
  374. default y
  375. help
  376. Enable ECDH. Needed to use ECDHE-xxx TLS ciphersuites.
  377. config MBEDTLS_ECDSA_C
  378. bool "Elliptic Curve DSA"
  379. depends on MBEDTLS_ECDH_C
  380. default y
  381. help
  382. Enable ECDSA. Needed to use ECDSA-xxx TLS ciphersuites.
  383. config MBEDTLS_ECP_DP_SECP192R1_ENABLED
  384. bool "Enable SECP192R1 curve"
  385. depends on MBEDTLS_ECP_C
  386. default y
  387. help
  388. Enable support for SECP192R1 Elliptic Curve.
  389. config MBEDTLS_ECP_DP_SECP224R1_ENABLED
  390. bool "Enable SECP224R1 curve"
  391. depends on MBEDTLS_ECP_C
  392. default y
  393. help
  394. Enable support for SECP224R1 Elliptic Curve.
  395. config MBEDTLS_ECP_DP_SECP256R1_ENABLED
  396. bool "Enable SECP256R1 curve"
  397. depends on MBEDTLS_ECP_C
  398. default y
  399. help
  400. Enable support for SECP256R1 Elliptic Curve.
  401. config MBEDTLS_ECP_DP_SECP384R1_ENABLED
  402. bool "Enable SECP384R1 curve"
  403. depends on MBEDTLS_ECP_C
  404. default y
  405. help
  406. Enable support for SECP384R1 Elliptic Curve.
  407. config MBEDTLS_ECP_DP_SECP521R1_ENABLED
  408. bool "Enable SECP521R1 curve"
  409. depends on MBEDTLS_ECP_C
  410. default y
  411. help
  412. Enable support for SECP521R1 Elliptic Curve.
  413. config MBEDTLS_ECP_DP_SECP192K1_ENABLED
  414. bool "Enable SECP192K1 curve"
  415. depends on MBEDTLS_ECP_C
  416. default y
  417. help
  418. Enable support for SECP192K1 Elliptic Curve.
  419. config MBEDTLS_ECP_DP_SECP224K1_ENABLED
  420. bool "Enable SECP224K1 curve"
  421. depends on MBEDTLS_ECP_C
  422. default y
  423. help
  424. Enable support for SECP224K1 Elliptic Curve.
  425. config MBEDTLS_ECP_DP_SECP256K1_ENABLED
  426. bool "Enable SECP256K1 curve"
  427. depends on MBEDTLS_ECP_C
  428. default y
  429. help
  430. Enable support for SECP256K1 Elliptic Curve.
  431. config MBEDTLS_ECP_DP_BP256R1_ENABLED
  432. bool "Enable BP256R1 curve"
  433. depends on MBEDTLS_ECP_C
  434. default y
  435. help
  436. support for DP Elliptic Curve.
  437. config MBEDTLS_ECP_DP_BP384R1_ENABLED
  438. bool "Enable BP384R1 curve"
  439. depends on MBEDTLS_ECP_C
  440. default y
  441. help
  442. support for DP Elliptic Curve.
  443. config MBEDTLS_ECP_DP_BP512R1_ENABLED
  444. bool "Enable BP512R1 curve"
  445. depends on MBEDTLS_ECP_C
  446. default y
  447. help
  448. support for DP Elliptic Curve.
  449. config MBEDTLS_ECP_DP_CURVE25519_ENABLED
  450. bool "Enable CURVE25519 curve"
  451. depends on MBEDTLS_ECP_C
  452. default y
  453. help
  454. Enable support for CURVE25519 Elliptic Curve.
  455. config MBEDTLS_ECP_NIST_OPTIM
  456. bool "NIST 'modulo p' optimisations"
  457. depends on MBEDTLS_ECP_C
  458. default y
  459. help
  460. NIST 'modulo p' optimisations increase Elliptic Curve operation performance.
  461. Disabling this option saves some code size.
  462. # end of Elliptic Curve options
  463. endmenu # mbedTLS