Kconfig 35 KB

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