Kconfig 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  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. - Internal IRAM memory wherever applicable else internal DRAM
  15. Recommended mode here is always internal, since that is most preferred
  16. from security perspective. But if application requirement does not
  17. allow sufficient free internal memory then alternate mode can be
  18. selected.
  19. config MBEDTLS_INTERNAL_MEM_ALLOC
  20. bool "Internal memory"
  21. config MBEDTLS_EXTERNAL_MEM_ALLOC
  22. bool "External SPIRAM"
  23. depends on ESP32_SPIRAM_SUPPORT
  24. config MBEDTLS_DEFAULT_MEM_ALLOC
  25. bool "Default alloc mode"
  26. config MBEDTLS_CUSTOM_MEM_ALLOC
  27. bool "Custom alloc mode"
  28. config MBEDTLS_IRAM_8BIT_MEM_ALLOC
  29. bool "Internal IRAM"
  30. depends on ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
  31. help
  32. Allows to use IRAM memory region as 8bit accessible region.
  33. TLS input and output buffers will be allocated in IRAM section which is 32bit aligned
  34. memory. Every unaligned (8bit or 16bit) access will result in an exception
  35. and incur penalty of certain clock cycles per unaligned read/write.
  36. endchoice #MBEDTLS_MEM_ALLOC_MODE
  37. config MBEDTLS_SSL_MAX_CONTENT_LEN
  38. int "TLS maximum message content length"
  39. default 16384
  40. range 512 16384
  41. depends on !MBEDTLS_ASYMMETRIC_CONTENT_LEN
  42. help
  43. Maximum TLS message length (in bytes) supported by mbedTLS.
  44. 16384 is the default and this value is required to comply
  45. fully with TLS standards.
  46. However you can set a lower value in order to save RAM. This
  47. is safe if the other end of the connection supports Maximum
  48. Fragment Length Negotiation Extension (max_fragment_length,
  49. see RFC6066) or you know for certain that it will never send a
  50. message longer than a certain number of bytes.
  51. If the value is set too low, symptoms are a failed TLS
  52. handshake or a return value of MBEDTLS_ERR_SSL_INVALID_RECORD
  53. (-0x7200).
  54. config MBEDTLS_ASYMMETRIC_CONTENT_LEN
  55. bool "Asymmetric in/out fragment length"
  56. default y
  57. help
  58. If enabled, this option allows customizing TLS in/out fragment length
  59. in asymmetric way. Please note that enabling this with default values
  60. saves 12KB of dynamic memory per TLS connection.
  61. config MBEDTLS_SSL_IN_CONTENT_LEN
  62. int "TLS maximum incoming fragment length"
  63. default 16384
  64. range 512 16384
  65. depends on MBEDTLS_ASYMMETRIC_CONTENT_LEN
  66. help
  67. This defines maximum incoming fragment length, overriding default
  68. maximum content length (MBEDTLS_SSL_MAX_CONTENT_LEN).
  69. config MBEDTLS_SSL_OUT_CONTENT_LEN
  70. int "TLS maximum outgoing fragment length"
  71. default 4096
  72. range 512 16384
  73. depends on MBEDTLS_ASYMMETRIC_CONTENT_LEN
  74. help
  75. This defines maximum outgoing fragment length, overriding default
  76. maximum content length (MBEDTLS_SSL_MAX_CONTENT_LEN).
  77. config MBEDTLS_DYNAMIC_BUFFER
  78. bool "Using dynamic TX/RX buffer"
  79. default n
  80. select MBEDTLS_ASYMMETRIC_CONTENT_LEN
  81. help
  82. Using dynamic TX/RX buffer. After enabling this option, mbedTLS will
  83. allocate TX buffer when need to send data and then free it if all data
  84. is sent, allocate RX buffer when need to receive data and then free it
  85. when all data is used or read by upper layer.
  86. By default, when SSL is initialized, mbedTLS also allocate TX and
  87. RX buffer with the default value of "MBEDTLS_SSL_OUT_CONTENT_LEN" or
  88. "MBEDTLS_SSL_IN_CONTENT_LEN", so to save more heap, users can set
  89. the options to be an appropriate value.
  90. config MBEDTLS_DYNAMIC_FREE_PEER_CERT
  91. bool "Free SSL peer certificate after its usage"
  92. default n
  93. depends on MBEDTLS_DYNAMIC_BUFFER
  94. help
  95. Free peer certificate after its usage in handshake process.
  96. config MBEDTLS_DYNAMIC_FREE_CONFIG_DATA
  97. bool "Free private key and DHM data after its usage"
  98. default n
  99. depends on MBEDTLS_DYNAMIC_BUFFER
  100. help
  101. Free private key and DHM data after its usage in handshake process.
  102. The option will decrease heap cost when handshake, but also lead to problem:
  103. Becasue all certificate, private key and DHM data are freed so users should register
  104. certificate and private key to ssl config object again.
  105. config MBEDTLS_DYNAMIC_FREE_CA_CERT
  106. bool "Free SSL ca certificate after its usage"
  107. default y
  108. depends on MBEDTLS_DYNAMIC_FREE_CONFIG_DATA
  109. help
  110. Free ca certificate after its usage in the handshake process.
  111. This option will decrease the heap footprint for the TLS handshake, but may lead to a problem:
  112. If the respective ssl object needs to perform the TLS handshake again,
  113. the ca certificate should once again be registered to the ssl object.
  114. config MBEDTLS_DEBUG
  115. bool "Enable mbedTLS debugging"
  116. default n
  117. help
  118. Enable mbedTLS debugging functions at compile time.
  119. If this option is enabled, you can include
  120. "mbedtls/esp_debug.h" and call mbedtls_esp_enable_debug_log()
  121. at runtime in order to enable mbedTLS debug output via the ESP
  122. log mechanism.
  123. choice MBEDTLS_DEBUG_LEVEL
  124. bool "Set mbedTLS debugging level"
  125. depends on MBEDTLS_DEBUG
  126. default MBEDTLS_DEBUG_LEVEL_VERBOSE
  127. help
  128. Set mbedTLS debugging level
  129. config MBEDTLS_DEBUG_LEVEL_WARN
  130. bool "Warning"
  131. config MBEDTLS_DEBUG_LEVEL_INFO
  132. bool "Info"
  133. config MBEDTLS_DEBUG_LEVEL_DEBUG
  134. bool "Debug"
  135. config MBEDTLS_DEBUG_LEVEL_VERBOSE
  136. bool "Verbose"
  137. endchoice
  138. config MBEDTLS_DEBUG_LEVEL
  139. int
  140. default 1 if MBEDTLS_DEBUG_LEVEL_WARN
  141. default 2 if MBEDTLS_DEBUG_LEVEL_INFO
  142. default 3 if MBEDTLS_DEBUG_LEVEL_DEBUG
  143. default 4 if MBEDTLS_DEBUG_LEVEL_VERBOSE
  144. menu "Certificate Bundle"
  145. config MBEDTLS_CERTIFICATE_BUNDLE
  146. bool "Enable trusted root certificate bundle"
  147. default y
  148. help
  149. Enable support for large number of default root certificates
  150. When enabled this option allows user to store default as well
  151. as customer specific root certificates in compressed format rather
  152. than storing full certificate. For the root certificates the public key and the subject name
  153. will be stored.
  154. choice MBEDTLS_DEFAULT_CERTIFICATE_BUNDLE
  155. bool "Default certificate bundle options"
  156. depends on MBEDTLS_CERTIFICATE_BUNDLE
  157. default MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL
  158. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL
  159. bool "Use the full default certificate bundle"
  160. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN
  161. bool "Use only the most common certificates from the default bundles"
  162. help
  163. Use only the most common certificates from the default bundles, reducing the size with 50%,
  164. while still having around 99% coverage.
  165. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE
  166. bool "Do not use the default certificate bundle"
  167. endchoice
  168. config MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE
  169. depends on MBEDTLS_CERTIFICATE_BUNDLE
  170. default n
  171. bool "Add custom certificates to the default bundle"
  172. config MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH
  173. depends on MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE
  174. string "Custom certificate bundle path"
  175. help
  176. Name of the custom certificate directory or file. This path is evaluated
  177. relative to the project root directory.
  178. endmenu
  179. config MBEDTLS_ECP_RESTARTABLE
  180. bool "Enable mbedTLS ecp restartable"
  181. default n
  182. help
  183. Enable "non-blocking" ECC operations that can return early and be resumed.
  184. config MBEDTLS_CMAC_C
  185. bool "Enable CMAC mode for block ciphers"
  186. default n
  187. help
  188. Enable the CMAC (Cipher-based Message Authentication Code) mode for
  189. block ciphers.
  190. config MBEDTLS_HARDWARE_AES
  191. bool "Enable hardware AES acceleration"
  192. default n if IDF_TARGET_ESP32S3
  193. default y
  194. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  195. help
  196. Enable hardware accelerated AES encryption & decryption.
  197. Note that if the ESP32 CPU is running at 240MHz, hardware AES does not
  198. offer any speed boost over software AES.
  199. config MBEDTLS_AES_USE_INTERRUPT
  200. bool "Use interrupt for long AES operations"
  201. depends on IDF_TARGET_ESP32S2 && MBEDTLS_HARDWARE_AES
  202. default y
  203. help
  204. Use an interrupt to coordinate long AES operations.
  205. This allows other code to run on the CPU while an AES operation is pending.
  206. Otherwise the CPU busy-waits.
  207. config MBEDTLS_HARDWARE_GCM
  208. bool "Enable partially hardware accelerated GCM"
  209. depends on IDF_TARGET_ESP32S2 && MBEDTLS_HARDWARE_AES
  210. default y
  211. help
  212. Enable partially hardware accelerated GCM. GHASH calculation is still done
  213. in software.
  214. If MBEDTLS_HARDWARE_GCM is disabled and MBEDTLS_HARDWARE_AES is enabled then
  215. mbedTLS will still use the hardware accelerated AES block operation, but
  216. on a single block at a time.
  217. config MBEDTLS_HARDWARE_MPI
  218. bool "Enable hardware MPI (bignum) acceleration"
  219. default n if IDF_TARGET_ESP32S3
  220. default y
  221. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  222. help
  223. Enable hardware accelerated multiple precision integer operations.
  224. Hardware accelerated multiplication, modulo multiplication,
  225. and modular exponentiation for up to 4096 bit results.
  226. These operations are used by RSA.
  227. config MBEDTLS_HARDWARE_SHA
  228. bool "Enable hardware SHA acceleration"
  229. default n if IDF_TARGET_ESP32S3
  230. default y
  231. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  232. help
  233. Enable hardware accelerated SHA1, SHA256, SHA384 & SHA512 in mbedTLS.
  234. Due to a hardware limitation, on the ESP32 hardware acceleration is only
  235. guaranteed if SHA digests are calculated one at a time. If more
  236. than one SHA digest is calculated at the same time, one will
  237. be calculated fully in hardware and the rest will be calculated
  238. (at least partially calculated) in software. This happens automatically.
  239. SHA hardware acceleration is faster than software in some situations but
  240. slower in others. You should benchmark to find the best setting for you.
  241. config MBEDTLS_ROM_MD5
  242. bool "Use MD5 implementation in ROM"
  243. default y
  244. help
  245. Use ROM MD5 in mbedTLS.
  246. config MBEDTLS_ATCA_HW_ECDSA_SIGN
  247. bool "Enable hardware ECDSA sign acceleration when using ATECC608A"
  248. default n
  249. help
  250. This option enables hardware acceleration for ECDSA sign function, only
  251. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  252. config MBEDTLS_ATCA_HW_ECDSA_VERIFY
  253. bool "Enable hardware ECDSA verify acceleration when using ATECC608A"
  254. default n
  255. help
  256. This option enables hardware acceleration for ECDSA sign function, only
  257. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  258. config MBEDTLS_HAVE_TIME
  259. bool "Enable mbedtls time support"
  260. depends on !ESP_TIME_FUNCS_USE_NONE
  261. default y
  262. help
  263. Enable use of time.h functions (time() and gmtime()) by mbedTLS.
  264. This option doesn't require the system time to be correct, but enables
  265. functionality that requires relative timekeeping - for example periodic
  266. expiry of TLS session tickets or session cache entries.
  267. Disabling this option will save some firmware size, particularly if
  268. the rest of the firmware doesn't call any standard timekeeeping
  269. functions.
  270. config MBEDTLS_HAVE_TIME_DATE
  271. bool "Enable mbedtls certificate expiry check"
  272. depends on MBEDTLS_HAVE_TIME
  273. default n
  274. help
  275. Enables X.509 certificate expiry checks in mbedTLS.
  276. If this option is disabled (default) then X.509 certificate
  277. "valid from" and "valid to" timestamp fields are ignored.
  278. If this option is enabled, these fields are compared with the
  279. current system date and time. The time is retrieved using the
  280. standard time() and gmtime() functions. If the certificate is not
  281. valid for the current system time then verification will fail with
  282. code MBEDTLS_X509_BADCERT_FUTURE or MBEDTLS_X509_BADCERT_EXPIRED.
  283. Enabling this option requires adding functionality in the firmware
  284. to set the system clock to a valid timestamp before using TLS. The
  285. recommended way to do this is via ESP-IDF's SNTP functionality, but
  286. any method can be used.
  287. In the case where only a small number of certificates are trusted by
  288. the device, please carefully consider the tradeoffs of enabling this
  289. option. There may be undesired consequences, for example if all
  290. trusted certificates expire while the device is offline and a TLS
  291. connection is required to update. Or if an issue with the SNTP
  292. server means that the system time is invalid for an extended period
  293. after a reset.
  294. config MBEDTLS_ECDSA_DETERMINISTIC
  295. bool "Enable deterministic ECDSA"
  296. default y
  297. help
  298. Standard ECDSA is "fragile" in the sense that lack of entropy when signing
  299. may result in a compromise of the long-term signing key.
  300. config MBEDTLS_SHA512_C
  301. bool "Enable the SHA-384 and SHA-512 cryptographic hash algorithms"
  302. default y
  303. help
  304. Enable MBEDTLS_SHA512_C adds support for SHA-384 and SHA-512.
  305. choice MBEDTLS_TLS_MODE
  306. bool "TLS Protocol Role"
  307. default MBEDTLS_TLS_SERVER_AND_CLIENT
  308. help
  309. mbedTLS can be compiled with protocol support for the TLS
  310. server, TLS client, or both server and client.
  311. Reducing the number of TLS roles supported saves code size.
  312. config MBEDTLS_TLS_SERVER_AND_CLIENT
  313. bool "Server & Client"
  314. select MBEDTLS_TLS_SERVER
  315. select MBEDTLS_TLS_CLIENT
  316. config MBEDTLS_TLS_SERVER_ONLY
  317. bool "Server"
  318. select MBEDTLS_TLS_SERVER
  319. config MBEDTLS_TLS_CLIENT_ONLY
  320. bool "Client"
  321. select MBEDTLS_TLS_CLIENT
  322. config MBEDTLS_TLS_DISABLED
  323. bool "None"
  324. endchoice
  325. config MBEDTLS_TLS_SERVER
  326. bool
  327. select MBEDTLS_TLS_ENABLED
  328. config MBEDTLS_TLS_CLIENT
  329. bool
  330. select MBEDTLS_TLS_ENABLED
  331. config MBEDTLS_TLS_ENABLED
  332. bool
  333. menu "TLS Key Exchange Methods"
  334. depends on MBEDTLS_TLS_ENABLED
  335. config MBEDTLS_PSK_MODES
  336. bool "Enable pre-shared-key ciphersuites"
  337. default n
  338. help
  339. Enable to show configuration for different types of pre-shared-key TLS authentatication methods.
  340. Leaving this options disabled will save code size if they are not used.
  341. config MBEDTLS_KEY_EXCHANGE_PSK
  342. bool "Enable PSK based ciphersuite modes"
  343. depends on MBEDTLS_PSK_MODES
  344. default n
  345. help
  346. Enable to support symmetric key PSK (pre-shared-key) TLS key exchange modes.
  347. config MBEDTLS_KEY_EXCHANGE_DHE_PSK
  348. bool "Enable DHE-PSK based ciphersuite modes"
  349. depends on MBEDTLS_PSK_MODES
  350. default y
  351. help
  352. Enable to support Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  353. config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
  354. bool "Enable ECDHE-PSK based ciphersuite modes"
  355. depends on MBEDTLS_PSK_MODES && MBEDTLS_ECDH_C
  356. default y
  357. help
  358. Enable to support Elliptic-Curve-Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  359. config MBEDTLS_KEY_EXCHANGE_RSA_PSK
  360. bool "Enable RSA-PSK based ciphersuite modes"
  361. depends on MBEDTLS_PSK_MODES
  362. default y
  363. help
  364. Enable to support RSA PSK (pre-shared-key) TLS authentication modes.
  365. config MBEDTLS_KEY_EXCHANGE_RSA
  366. bool "Enable RSA-only based ciphersuite modes"
  367. default y
  368. help
  369. Enable to support ciphersuites with prefix TLS-RSA-WITH-
  370. config MBEDTLS_KEY_EXCHANGE_DHE_RSA
  371. bool "Enable DHE-RSA based ciphersuite modes"
  372. default y
  373. help
  374. Enable to support ciphersuites with prefix TLS-DHE-RSA-WITH-
  375. config MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE
  376. bool "Support Elliptic Curve based ciphersuites"
  377. depends on MBEDTLS_ECP_C
  378. default y
  379. help
  380. Enable to show Elliptic Curve based ciphersuite mode options.
  381. Disabling all Elliptic Curve ciphersuites saves code size and
  382. can give slightly faster TLS handshakes, provided the server supports
  383. RSA-only ciphersuite modes.
  384. config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA
  385. bool "Enable ECDHE-RSA based ciphersuite modes"
  386. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  387. default y
  388. help
  389. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  390. config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA
  391. bool "Enable ECDHE-ECDSA based ciphersuite modes"
  392. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  393. default y
  394. help
  395. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  396. config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA
  397. bool "Enable ECDH-ECDSA based ciphersuite modes"
  398. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  399. default y
  400. help
  401. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  402. config MBEDTLS_KEY_EXCHANGE_ECDH_RSA
  403. bool "Enable ECDH-RSA based ciphersuite modes"
  404. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  405. default y
  406. help
  407. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  408. config MBEDTLS_KEY_EXCHANGE_ECJPAKE
  409. bool "Enable ECJPAKE based ciphersuite modes"
  410. depends on MBEDTLS_ECJPAKE_C && MBEDTLS_ECP_DP_SECP256R1_ENABLED
  411. default n
  412. help
  413. Enable to support ciphersuites with prefix TLS-ECJPAKE-WITH-
  414. endmenu # TLS key exchange modes
  415. config MBEDTLS_SSL_RENEGOTIATION
  416. bool "Support TLS renegotiation"
  417. depends on MBEDTLS_TLS_ENABLED
  418. default y
  419. help
  420. The two main uses of renegotiation are (1) refresh keys on long-lived
  421. connections and (2) client authentication after the initial handshake.
  422. If you don't need renegotiation, disabling it will save code size and
  423. reduce the possibility of abuse/vulnerability.
  424. config MBEDTLS_SSL_PROTO_SSL3
  425. bool "Legacy SSL 3.0 support"
  426. depends on MBEDTLS_TLS_ENABLED
  427. default n
  428. help
  429. Support the legacy SSL 3.0 protocol. Most servers will speak a newer
  430. TLS protocol these days.
  431. config MBEDTLS_SSL_PROTO_TLS1
  432. bool "Support TLS 1.0 protocol"
  433. depends on MBEDTLS_TLS_ENABLED
  434. default y
  435. config MBEDTLS_SSL_PROTO_TLS1_1
  436. bool "Support TLS 1.1 protocol"
  437. depends on MBEDTLS_TLS_ENABLED
  438. default y
  439. config MBEDTLS_SSL_PROTO_TLS1_2
  440. bool "Support TLS 1.2 protocol"
  441. depends on MBEDTLS_TLS_ENABLED
  442. default y
  443. config MBEDTLS_SSL_PROTO_DTLS
  444. bool "Support DTLS protocol (all versions)"
  445. default n
  446. depends on MBEDTLS_SSL_PROTO_TLS1_1 || MBEDTLS_SSL_PROTO_TLS1_2
  447. help
  448. Requires TLS 1.1 to be enabled for DTLS 1.0
  449. Requires TLS 1.2 to be enabled for DTLS 1.2
  450. config MBEDTLS_SSL_ALPN
  451. bool "Support ALPN (Application Layer Protocol Negotiation)"
  452. depends on MBEDTLS_TLS_ENABLED
  453. default y
  454. help
  455. Disabling this option will save some code size if it is not needed.
  456. config MBEDTLS_CLIENT_SSL_SESSION_TICKETS
  457. bool "TLS: Client Support for RFC 5077 SSL session tickets"
  458. default y
  459. depends on MBEDTLS_TLS_ENABLED
  460. help
  461. Client support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  462. Disabling this option will save some code size.
  463. config MBEDTLS_SERVER_SSL_SESSION_TICKETS
  464. bool "TLS: Server Support for RFC 5077 SSL session tickets"
  465. default y
  466. depends on MBEDTLS_TLS_ENABLED
  467. help
  468. Server support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  469. Disabling this option will save some code size.
  470. menu "Symmetric Ciphers"
  471. config MBEDTLS_AES_C
  472. bool "AES block cipher"
  473. default y
  474. config MBEDTLS_CAMELLIA_C
  475. bool "Camellia block cipher"
  476. default n
  477. config MBEDTLS_DES_C
  478. bool "DES block cipher (legacy, insecure)"
  479. default n
  480. help
  481. Enables the DES block cipher to support 3DES-based TLS ciphersuites.
  482. 3DES is vulnerable to the Sweet32 attack and should only be enabled
  483. if absolutely necessary.
  484. choice MBEDTLS_RC4_MODE
  485. prompt "RC4 Stream Cipher (legacy, insecure)"
  486. default MBEDTLS_RC4_DISABLED
  487. help
  488. ARCFOUR (RC4) stream cipher can be disabled entirely, enabled but not
  489. added to default ciphersuites, or enabled completely.
  490. Please consider the security implications before enabling RC4.
  491. config MBEDTLS_RC4_DISABLED
  492. bool "Disabled"
  493. config MBEDTLS_RC4_ENABLED_NO_DEFAULT
  494. bool "Enabled, not in default ciphersuites"
  495. config MBEDTLS_RC4_ENABLED
  496. bool "Enabled"
  497. endchoice
  498. config MBEDTLS_BLOWFISH_C
  499. bool "Blowfish block cipher (read help)"
  500. default n
  501. help
  502. Enables the Blowfish block cipher (not used for TLS sessions.)
  503. The Blowfish cipher is not used for mbedTLS TLS sessions but can be
  504. used for other purposes. Read up on the limitations of Blowfish (including
  505. Sweet32) before enabling.
  506. config MBEDTLS_XTEA_C
  507. bool "XTEA block cipher"
  508. default n
  509. help
  510. Enables the XTEA block cipher.
  511. config MBEDTLS_CCM_C
  512. bool "CCM (Counter with CBC-MAC) block cipher modes"
  513. default y
  514. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  515. help
  516. Enable Counter with CBC-MAC (CCM) modes for AES and/or Camellia ciphers.
  517. Disabling this option saves some code size.
  518. config MBEDTLS_GCM_C
  519. bool "GCM (Galois/Counter) block cipher modes"
  520. default y
  521. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  522. help
  523. Enable Galois/Counter Mode for AES and/or Camellia ciphers.
  524. This option is generally faster than CCM.
  525. endmenu # Symmetric Ciphers
  526. config MBEDTLS_RIPEMD160_C
  527. bool "Enable RIPEMD-160 hash algorithm"
  528. default n
  529. help
  530. Enable the RIPEMD-160 hash algorithm.
  531. menu "Certificates"
  532. config MBEDTLS_PEM_PARSE_C
  533. bool "Read & Parse PEM formatted certificates"
  534. default y
  535. help
  536. Enable decoding/parsing of PEM formatted certificates.
  537. If your certificates are all in the simpler DER format, disabling
  538. this option will save some code size.
  539. config MBEDTLS_PEM_WRITE_C
  540. bool "Write PEM formatted certificates"
  541. default y
  542. help
  543. Enable writing of PEM formatted certificates.
  544. If writing certificate data only in DER format, disabling this
  545. option will save some code size.
  546. config MBEDTLS_X509_CRL_PARSE_C
  547. bool "X.509 CRL parsing"
  548. default y
  549. help
  550. Support for parsing X.509 Certifificate Revocation Lists.
  551. config MBEDTLS_X509_CSR_PARSE_C
  552. bool "X.509 CSR parsing"
  553. default y
  554. help
  555. Support for parsing X.509 Certifificate Signing Requests
  556. endmenu # Certificates
  557. menuconfig MBEDTLS_ECP_C
  558. bool "Elliptic Curve Ciphers"
  559. default y
  560. config MBEDTLS_ECDH_C
  561. bool "Elliptic Curve Diffie-Hellman (ECDH)"
  562. depends on MBEDTLS_ECP_C
  563. default y
  564. help
  565. Enable ECDH. Needed to use ECDHE-xxx TLS ciphersuites.
  566. config MBEDTLS_ECDSA_C
  567. bool "Elliptic Curve DSA"
  568. depends on MBEDTLS_ECDH_C
  569. default y
  570. help
  571. Enable ECDSA. Needed to use ECDSA-xxx TLS ciphersuites.
  572. config MBEDTLS_ECJPAKE_C
  573. bool "Elliptic curve J-PAKE"
  574. depends on MBEDTLS_ECP_C
  575. default n
  576. help
  577. Enable ECJPAKE. Needed to use ECJPAKE-xxx TLS ciphersuites.
  578. config MBEDTLS_ECP_DP_SECP192R1_ENABLED
  579. bool "Enable SECP192R1 curve"
  580. depends on MBEDTLS_ECP_C
  581. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  582. help
  583. Enable support for SECP192R1 Elliptic Curve.
  584. config MBEDTLS_ECP_DP_SECP224R1_ENABLED
  585. bool "Enable SECP224R1 curve"
  586. depends on MBEDTLS_ECP_C
  587. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  588. help
  589. Enable support for SECP224R1 Elliptic Curve.
  590. config MBEDTLS_ECP_DP_SECP256R1_ENABLED
  591. bool "Enable SECP256R1 curve"
  592. depends on MBEDTLS_ECP_C
  593. default y
  594. help
  595. Enable support for SECP256R1 Elliptic Curve.
  596. config MBEDTLS_ECP_DP_SECP384R1_ENABLED
  597. bool "Enable SECP384R1 curve"
  598. depends on MBEDTLS_ECP_C
  599. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  600. help
  601. Enable support for SECP384R1 Elliptic Curve.
  602. config MBEDTLS_ECP_DP_SECP521R1_ENABLED
  603. bool "Enable SECP521R1 curve"
  604. depends on MBEDTLS_ECP_C
  605. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  606. help
  607. Enable support for SECP521R1 Elliptic Curve.
  608. config MBEDTLS_ECP_DP_SECP192K1_ENABLED
  609. bool "Enable SECP192K1 curve"
  610. depends on MBEDTLS_ECP_C
  611. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  612. help
  613. Enable support for SECP192K1 Elliptic Curve.
  614. config MBEDTLS_ECP_DP_SECP224K1_ENABLED
  615. bool "Enable SECP224K1 curve"
  616. depends on MBEDTLS_ECP_C
  617. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  618. help
  619. Enable support for SECP224K1 Elliptic Curve.
  620. config MBEDTLS_ECP_DP_SECP256K1_ENABLED
  621. bool "Enable SECP256K1 curve"
  622. depends on MBEDTLS_ECP_C
  623. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  624. help
  625. Enable support for SECP256K1 Elliptic Curve.
  626. config MBEDTLS_ECP_DP_BP256R1_ENABLED
  627. bool "Enable BP256R1 curve"
  628. depends on MBEDTLS_ECP_C
  629. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  630. help
  631. support for DP Elliptic Curve.
  632. config MBEDTLS_ECP_DP_BP384R1_ENABLED
  633. bool "Enable BP384R1 curve"
  634. depends on MBEDTLS_ECP_C
  635. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  636. help
  637. support for DP Elliptic Curve.
  638. config MBEDTLS_ECP_DP_BP512R1_ENABLED
  639. bool "Enable BP512R1 curve"
  640. depends on MBEDTLS_ECP_C
  641. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  642. help
  643. support for DP Elliptic Curve.
  644. config MBEDTLS_ECP_DP_CURVE25519_ENABLED
  645. bool "Enable CURVE25519 curve"
  646. depends on MBEDTLS_ECP_C
  647. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  648. help
  649. Enable support for CURVE25519 Elliptic Curve.
  650. config MBEDTLS_ECP_NIST_OPTIM
  651. bool "NIST 'modulo p' optimisations"
  652. depends on MBEDTLS_ECP_C
  653. default y
  654. help
  655. NIST 'modulo p' optimisations increase Elliptic Curve operation performance.
  656. Disabling this option saves some code size.
  657. # end of Elliptic Curve options
  658. config MBEDTLS_POLY1305_C
  659. bool "Poly1305 MAC algorithm"
  660. default n
  661. help
  662. Enable support for Poly1305 MAC algorithm.
  663. config MBEDTLS_CHACHA20_C
  664. bool "Chacha20 stream cipher"
  665. default n
  666. help
  667. Enable support for Chacha20 stream cipher.
  668. config MBEDTLS_CHACHAPOLY_C
  669. bool "ChaCha20-Poly1305 AEAD algorithm"
  670. default n
  671. depends on MBEDTLS_CHACHA20_C && MBEDTLS_POLY1305_C
  672. help
  673. Enable support for ChaCha20-Poly1305 AEAD algorithm.
  674. config MBEDTLS_HKDF_C
  675. bool "HKDF algorithm (RFC 5869)"
  676. default n
  677. help
  678. Enable support for the Hashed Message Authentication Code
  679. (HMAC)-based key derivation function (HKDF).
  680. config MBEDTLS_THREADING_C
  681. bool "Enable the threading abstraction layer"
  682. default n
  683. help
  684. If you do intend to use contexts between threads, you will need to enable
  685. this layer to prevent race conditions.
  686. config MBEDTLS_THREADING_ALT
  687. bool "Enable threading alternate implementation"
  688. depends on MBEDTLS_THREADING_C
  689. default y
  690. help
  691. Enable threading alt to allow your own alternate threading implementation.
  692. config MBEDTLS_THREADING_PTHREAD
  693. bool "Enable threading pthread implementation"
  694. depends on MBEDTLS_THREADING_C
  695. default n
  696. help
  697. Enable the pthread wrapper layer for the threading layer.
  698. config MBEDTLS_LARGE_KEY_SOFTWARE_MPI
  699. bool "Fallback to software implementation for larger MPI values"
  700. depends on MBEDTLS_HARDWARE_MPI
  701. default y if IDF_TARGET_ESP32C3 # HW max 3072 bits
  702. default n
  703. help
  704. Fallback to software implementation for RSA key lengths
  705. larger than SOC_RSA_MAX_BIT_LEN. If this is not active
  706. then the ESP will be unable to process keys greater
  707. than SOC_RSA_MAX_BIT_LEN.
  708. menuconfig MBEDTLS_SECURITY_RISKS
  709. bool "Show configurations with potential security risks"
  710. default n
  711. config MBEDTLS_ALLOW_UNSUPPORTED_CRITICAL_EXT
  712. bool "X.509 CRT parsing with unsupported critical extensions"
  713. depends on MBEDTLS_SECURITY_RISKS
  714. default n
  715. help
  716. Allow the X.509 certificate parser to load certificates
  717. with unsupported critical extensions
  718. endmenu # mbedTLS