Kconfig 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  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
  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
  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_HARDWARE_SHA
  233. bool "Enable hardware SHA acceleration"
  234. default y
  235. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  236. help
  237. Enable hardware accelerated SHA1, SHA256, SHA384 & SHA512 in mbedTLS.
  238. Due to a hardware limitation, on the ESP32 hardware acceleration is only
  239. guaranteed if SHA digests are calculated one at a time. If more
  240. than one SHA digest is calculated at the same time, one will
  241. be calculated fully in hardware and the rest will be calculated
  242. (at least partially calculated) in software. This happens automatically.
  243. SHA hardware acceleration is faster than software in some situations but
  244. slower in others. You should benchmark to find the best setting for you.
  245. config MBEDTLS_ROM_MD5
  246. bool "Use MD5 implementation in ROM"
  247. default y
  248. help
  249. Use ROM MD5 in mbedTLS.
  250. config MBEDTLS_ATCA_HW_ECDSA_SIGN
  251. bool "Enable hardware ECDSA sign acceleration when using ATECC608A"
  252. default n
  253. help
  254. This option enables hardware acceleration for ECDSA sign function, only
  255. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  256. config MBEDTLS_ATCA_HW_ECDSA_VERIFY
  257. bool "Enable hardware ECDSA verify acceleration when using ATECC608A"
  258. default n
  259. help
  260. This option enables hardware acceleration for ECDSA sign function, only
  261. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  262. config MBEDTLS_HAVE_TIME
  263. bool "Enable mbedtls time support"
  264. depends on !ESP_TIME_FUNCS_USE_NONE
  265. default y
  266. help
  267. Enable use of time.h functions (time() and gmtime()) by mbedTLS.
  268. This option doesn't require the system time to be correct, but enables
  269. functionality that requires relative timekeeping - for example periodic
  270. expiry of TLS session tickets or session cache entries.
  271. Disabling this option will save some firmware size, particularly if
  272. the rest of the firmware doesn't call any standard timekeeeping
  273. functions.
  274. config MBEDTLS_HAVE_TIME_DATE
  275. bool "Enable mbedtls certificate expiry check"
  276. depends on MBEDTLS_HAVE_TIME
  277. default n
  278. help
  279. Enables X.509 certificate expiry checks in mbedTLS.
  280. If this option is disabled (default) then X.509 certificate
  281. "valid from" and "valid to" timestamp fields are ignored.
  282. If this option is enabled, these fields are compared with the
  283. current system date and time. The time is retrieved using the
  284. standard time() and gmtime() functions. If the certificate is not
  285. valid for the current system time then verification will fail with
  286. code MBEDTLS_X509_BADCERT_FUTURE or MBEDTLS_X509_BADCERT_EXPIRED.
  287. Enabling this option requires adding functionality in the firmware
  288. to set the system clock to a valid timestamp before using TLS. The
  289. recommended way to do this is via ESP-IDF's SNTP functionality, but
  290. any method can be used.
  291. In the case where only a small number of certificates are trusted by
  292. the device, please carefully consider the tradeoffs of enabling this
  293. option. There may be undesired consequences, for example if all
  294. trusted certificates expire while the device is offline and a TLS
  295. connection is required to update. Or if an issue with the SNTP
  296. server means that the system time is invalid for an extended period
  297. after a reset.
  298. config MBEDTLS_ECDSA_DETERMINISTIC
  299. bool "Enable deterministic ECDSA"
  300. default y
  301. help
  302. Standard ECDSA is "fragile" in the sense that lack of entropy when signing
  303. may result in a compromise of the long-term signing key.
  304. config MBEDTLS_SHA512_C
  305. bool "Enable the SHA-384 and SHA-512 cryptographic hash algorithms"
  306. default y
  307. help
  308. Enable MBEDTLS_SHA512_C adds support for SHA-384 and SHA-512.
  309. choice MBEDTLS_TLS_MODE
  310. bool "TLS Protocol Role"
  311. default MBEDTLS_TLS_SERVER_AND_CLIENT
  312. help
  313. mbedTLS can be compiled with protocol support for the TLS
  314. server, TLS client, or both server and client.
  315. Reducing the number of TLS roles supported saves code size.
  316. config MBEDTLS_TLS_SERVER_AND_CLIENT
  317. bool "Server & Client"
  318. select MBEDTLS_TLS_SERVER
  319. select MBEDTLS_TLS_CLIENT
  320. config MBEDTLS_TLS_SERVER_ONLY
  321. bool "Server"
  322. select MBEDTLS_TLS_SERVER
  323. config MBEDTLS_TLS_CLIENT_ONLY
  324. bool "Client"
  325. select MBEDTLS_TLS_CLIENT
  326. config MBEDTLS_TLS_DISABLED
  327. bool "None"
  328. endchoice
  329. config MBEDTLS_TLS_SERVER
  330. bool
  331. select MBEDTLS_TLS_ENABLED
  332. config MBEDTLS_TLS_CLIENT
  333. bool
  334. select MBEDTLS_TLS_ENABLED
  335. config MBEDTLS_TLS_ENABLED
  336. bool
  337. menu "TLS Key Exchange Methods"
  338. depends on MBEDTLS_TLS_ENABLED
  339. config MBEDTLS_PSK_MODES
  340. bool "Enable pre-shared-key ciphersuites"
  341. default n
  342. help
  343. Enable to show configuration for different types of pre-shared-key TLS authentatication methods.
  344. Leaving this options disabled will save code size if they are not used.
  345. config MBEDTLS_KEY_EXCHANGE_PSK
  346. bool "Enable PSK based ciphersuite modes"
  347. depends on MBEDTLS_PSK_MODES
  348. default n
  349. help
  350. Enable to support symmetric key PSK (pre-shared-key) TLS key exchange modes.
  351. config MBEDTLS_KEY_EXCHANGE_DHE_PSK
  352. bool "Enable DHE-PSK based ciphersuite modes"
  353. depends on MBEDTLS_PSK_MODES
  354. default y
  355. help
  356. Enable to support Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  357. config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
  358. bool "Enable ECDHE-PSK based ciphersuite modes"
  359. depends on MBEDTLS_PSK_MODES && MBEDTLS_ECDH_C
  360. default y
  361. help
  362. Enable to support Elliptic-Curve-Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  363. config MBEDTLS_KEY_EXCHANGE_RSA_PSK
  364. bool "Enable RSA-PSK based ciphersuite modes"
  365. depends on MBEDTLS_PSK_MODES
  366. default y
  367. help
  368. Enable to support RSA PSK (pre-shared-key) TLS authentication modes.
  369. config MBEDTLS_KEY_EXCHANGE_RSA
  370. bool "Enable RSA-only based ciphersuite modes"
  371. default y
  372. help
  373. Enable to support ciphersuites with prefix TLS-RSA-WITH-
  374. config MBEDTLS_KEY_EXCHANGE_DHE_RSA
  375. bool "Enable DHE-RSA based ciphersuite modes"
  376. default y
  377. help
  378. Enable to support ciphersuites with prefix TLS-DHE-RSA-WITH-
  379. config MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE
  380. bool "Support Elliptic Curve based ciphersuites"
  381. depends on MBEDTLS_ECP_C
  382. default y
  383. help
  384. Enable to show Elliptic Curve based ciphersuite mode options.
  385. Disabling all Elliptic Curve ciphersuites saves code size and
  386. can give slightly faster TLS handshakes, provided the server supports
  387. RSA-only ciphersuite modes.
  388. config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA
  389. bool "Enable ECDHE-RSA based ciphersuite modes"
  390. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  391. default y
  392. help
  393. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  394. config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA
  395. bool "Enable ECDHE-ECDSA based ciphersuite modes"
  396. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  397. default y
  398. help
  399. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  400. config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA
  401. bool "Enable ECDH-ECDSA based ciphersuite modes"
  402. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  403. default y
  404. help
  405. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  406. config MBEDTLS_KEY_EXCHANGE_ECDH_RSA
  407. bool "Enable ECDH-RSA based ciphersuite modes"
  408. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  409. default y
  410. help
  411. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  412. config MBEDTLS_KEY_EXCHANGE_ECJPAKE
  413. bool "Enable ECJPAKE based ciphersuite modes"
  414. depends on MBEDTLS_ECJPAKE_C && MBEDTLS_ECP_DP_SECP256R1_ENABLED
  415. default n
  416. help
  417. Enable to support ciphersuites with prefix TLS-ECJPAKE-WITH-
  418. endmenu # TLS key exchange modes
  419. config MBEDTLS_SSL_RENEGOTIATION
  420. bool "Support TLS renegotiation"
  421. depends on MBEDTLS_TLS_ENABLED
  422. default y
  423. help
  424. The two main uses of renegotiation are (1) refresh keys on long-lived
  425. connections and (2) client authentication after the initial handshake.
  426. If you don't need renegotiation, disabling it will save code size and
  427. reduce the possibility of abuse/vulnerability.
  428. config MBEDTLS_SSL_PROTO_SSL3
  429. bool "Legacy SSL 3.0 support"
  430. depends on MBEDTLS_TLS_ENABLED
  431. default n
  432. help
  433. Support the legacy SSL 3.0 protocol. Most servers will speak a newer
  434. TLS protocol these days.
  435. config MBEDTLS_SSL_PROTO_TLS1
  436. bool "Support TLS 1.0 protocol"
  437. depends on MBEDTLS_TLS_ENABLED
  438. default y
  439. config MBEDTLS_SSL_PROTO_TLS1_1
  440. bool "Support TLS 1.1 protocol"
  441. depends on MBEDTLS_TLS_ENABLED
  442. default y
  443. config MBEDTLS_SSL_PROTO_TLS1_2
  444. bool "Support TLS 1.2 protocol"
  445. depends on MBEDTLS_TLS_ENABLED
  446. default y
  447. config MBEDTLS_SSL_PROTO_GMTSSL1_1
  448. bool "Support GM/T SSL 1.1 protocol"
  449. depends on MBEDTLS_TLS_ENABLED
  450. default n
  451. help
  452. Provisions for GM/T SSL 1.1 support
  453. config MBEDTLS_SSL_PROTO_DTLS
  454. bool "Support DTLS protocol (all versions)"
  455. default n
  456. depends on MBEDTLS_SSL_PROTO_TLS1_1 || MBEDTLS_SSL_PROTO_TLS1_2
  457. help
  458. Requires TLS 1.1 to be enabled for DTLS 1.0
  459. Requires TLS 1.2 to be enabled for DTLS 1.2
  460. config MBEDTLS_SSL_ALPN
  461. bool "Support ALPN (Application Layer Protocol Negotiation)"
  462. depends on MBEDTLS_TLS_ENABLED
  463. default y
  464. help
  465. Disabling this option will save some code size if it is not needed.
  466. config MBEDTLS_CLIENT_SSL_SESSION_TICKETS
  467. bool "TLS: Client Support for RFC 5077 SSL session tickets"
  468. default y
  469. depends on MBEDTLS_TLS_ENABLED
  470. help
  471. Client support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  472. Disabling this option will save some code size.
  473. config MBEDTLS_X509_CHECK_KEY_USAGE
  474. bool "Enable verification of the keyUsage extension"
  475. default y
  476. depends on MBEDTLS_TLS_ENABLED
  477. help
  478. Disabling this avoids problems with mis-issued and/or misused (intermediate) CA and leaf certificates.
  479. Depending on your PKI use, disabling this can be a security risk.
  480. config MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
  481. bool "Enable verification of the extendedKeyUsage extension"
  482. default y
  483. depends on MBEDTLS_TLS_ENABLED
  484. help
  485. Disabling this avoids problems with mis-issued and/or misused certificates.
  486. Depending on your PKI use, disabling this can be a security risk.
  487. config MBEDTLS_SERVER_SSL_SESSION_TICKETS
  488. bool "TLS: Server Support for RFC 5077 SSL session tickets"
  489. default y
  490. depends on MBEDTLS_TLS_ENABLED
  491. help
  492. Server support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  493. Disabling this option will save some code size.
  494. menu "Symmetric Ciphers"
  495. config MBEDTLS_AES_C
  496. bool "AES block cipher"
  497. default y
  498. config MBEDTLS_CAMELLIA_C
  499. bool "Camellia block cipher"
  500. default n
  501. config MBEDTLS_DES_C
  502. bool "DES block cipher (legacy, insecure)"
  503. default n
  504. help
  505. Enables the DES block cipher to support 3DES-based TLS ciphersuites.
  506. 3DES is vulnerable to the Sweet32 attack and should only be enabled
  507. if absolutely necessary.
  508. choice MBEDTLS_RC4_MODE
  509. prompt "RC4 Stream Cipher (legacy, insecure)"
  510. default MBEDTLS_RC4_DISABLED
  511. help
  512. ARCFOUR (RC4) stream cipher can be disabled entirely, enabled but not
  513. added to default ciphersuites, or enabled completely.
  514. Please consider the security implications before enabling RC4.
  515. config MBEDTLS_RC4_DISABLED
  516. bool "Disabled"
  517. config MBEDTLS_RC4_ENABLED_NO_DEFAULT
  518. bool "Enabled, not in default ciphersuites"
  519. config MBEDTLS_RC4_ENABLED
  520. bool "Enabled"
  521. endchoice
  522. config MBEDTLS_BLOWFISH_C
  523. bool "Blowfish block cipher (read help)"
  524. default n
  525. help
  526. Enables the Blowfish block cipher (not used for TLS sessions.)
  527. The Blowfish cipher is not used for mbedTLS TLS sessions but can be
  528. used for other purposes. Read up on the limitations of Blowfish (including
  529. Sweet32) before enabling.
  530. config MBEDTLS_XTEA_C
  531. bool "XTEA block cipher"
  532. default n
  533. help
  534. Enables the XTEA block cipher.
  535. config MBEDTLS_CCM_C
  536. bool "CCM (Counter with CBC-MAC) block cipher modes"
  537. default y
  538. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  539. help
  540. Enable Counter with CBC-MAC (CCM) modes for AES and/or Camellia ciphers.
  541. Disabling this option saves some code size.
  542. config MBEDTLS_GCM_C
  543. bool "GCM (Galois/Counter) block cipher modes"
  544. default y
  545. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  546. help
  547. Enable Galois/Counter Mode for AES and/or Camellia ciphers.
  548. This option is generally faster than CCM.
  549. config MBEDTLS_NIST_KW_C
  550. bool "NIST key wrapping (KW) and KW padding (KWP)"
  551. default n
  552. depends on MBEDTLS_AES_C
  553. help
  554. Enable NIST key wrapping and key wrapping padding.
  555. endmenu # Symmetric Ciphers
  556. config MBEDTLS_RIPEMD160_C
  557. bool "Enable RIPEMD-160 hash algorithm"
  558. default n
  559. help
  560. Enable the RIPEMD-160 hash algorithm.
  561. menu "Certificates"
  562. config MBEDTLS_PEM_PARSE_C
  563. bool "Read & Parse PEM formatted certificates"
  564. default y
  565. help
  566. Enable decoding/parsing of PEM formatted certificates.
  567. If your certificates are all in the simpler DER format, disabling
  568. this option will save some code size.
  569. config MBEDTLS_PEM_WRITE_C
  570. bool "Write PEM formatted certificates"
  571. default y
  572. help
  573. Enable writing of PEM formatted certificates.
  574. If writing certificate data only in DER format, disabling this
  575. option will save some code size.
  576. config MBEDTLS_X509_CRL_PARSE_C
  577. bool "X.509 CRL parsing"
  578. default y
  579. help
  580. Support for parsing X.509 Certifificate Revocation Lists.
  581. config MBEDTLS_X509_CSR_PARSE_C
  582. bool "X.509 CSR parsing"
  583. default y
  584. help
  585. Support for parsing X.509 Certifificate Signing Requests
  586. endmenu # Certificates
  587. menuconfig MBEDTLS_ECP_C
  588. bool "Elliptic Curve Ciphers"
  589. default y
  590. config MBEDTLS_ECDH_C
  591. bool "Elliptic Curve Diffie-Hellman (ECDH)"
  592. depends on MBEDTLS_ECP_C
  593. default y
  594. help
  595. Enable ECDH. Needed to use ECDHE-xxx TLS ciphersuites.
  596. config MBEDTLS_ECDSA_C
  597. bool "Elliptic Curve DSA"
  598. depends on MBEDTLS_ECDH_C
  599. default y
  600. help
  601. Enable ECDSA. Needed to use ECDSA-xxx TLS ciphersuites.
  602. config MBEDTLS_ECJPAKE_C
  603. bool "Elliptic curve J-PAKE"
  604. depends on MBEDTLS_ECP_C
  605. default n
  606. help
  607. Enable ECJPAKE. Needed to use ECJPAKE-xxx TLS ciphersuites.
  608. config MBEDTLS_ECP_DP_SECP192R1_ENABLED
  609. bool "Enable SECP192R1 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 SECP192R1 Elliptic Curve.
  614. config MBEDTLS_ECP_DP_SECP224R1_ENABLED
  615. bool "Enable SECP224R1 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 SECP224R1 Elliptic Curve.
  620. config MBEDTLS_ECP_DP_SECP256R1_ENABLED
  621. bool "Enable SECP256R1 curve"
  622. depends on MBEDTLS_ECP_C
  623. default y
  624. help
  625. Enable support for SECP256R1 Elliptic Curve.
  626. config MBEDTLS_ECP_DP_SECP384R1_ENABLED
  627. bool "Enable SECP384R1 curve"
  628. depends on MBEDTLS_ECP_C
  629. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  630. help
  631. Enable support for SECP384R1 Elliptic Curve.
  632. config MBEDTLS_ECP_DP_SECP521R1_ENABLED
  633. bool "Enable SECP521R1 curve"
  634. depends on MBEDTLS_ECP_C
  635. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  636. help
  637. Enable support for SECP521R1 Elliptic Curve.
  638. config MBEDTLS_ECP_DP_SECP192K1_ENABLED
  639. bool "Enable SECP192K1 curve"
  640. depends on MBEDTLS_ECP_C
  641. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  642. help
  643. Enable support for SECP192K1 Elliptic Curve.
  644. config MBEDTLS_ECP_DP_SECP224K1_ENABLED
  645. bool "Enable SECP224K1 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 SECP224K1 Elliptic Curve.
  650. config MBEDTLS_ECP_DP_SECP256K1_ENABLED
  651. bool "Enable SECP256K1 curve"
  652. depends on MBEDTLS_ECP_C
  653. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  654. help
  655. Enable support for SECP256K1 Elliptic Curve.
  656. config MBEDTLS_ECP_DP_BP256R1_ENABLED
  657. bool "Enable BP256R1 curve"
  658. depends on MBEDTLS_ECP_C
  659. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  660. help
  661. support for DP Elliptic Curve.
  662. config MBEDTLS_ECP_DP_BP384R1_ENABLED
  663. bool "Enable BP384R1 curve"
  664. depends on MBEDTLS_ECP_C
  665. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  666. help
  667. support for DP Elliptic Curve.
  668. config MBEDTLS_ECP_DP_BP512R1_ENABLED
  669. bool "Enable BP512R1 curve"
  670. depends on MBEDTLS_ECP_C
  671. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  672. help
  673. support for DP Elliptic Curve.
  674. config MBEDTLS_ECP_DP_CURVE25519_ENABLED
  675. bool "Enable CURVE25519 curve"
  676. depends on MBEDTLS_ECP_C
  677. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  678. help
  679. Enable support for CURVE25519 Elliptic Curve.
  680. config MBEDTLS_ECP_NIST_OPTIM
  681. bool "NIST 'modulo p' optimisations"
  682. depends on MBEDTLS_ECP_C
  683. default y
  684. help
  685. NIST 'modulo p' optimisations increase Elliptic Curve operation performance.
  686. Disabling this option saves some code size.
  687. # end of Elliptic Curve options
  688. config MBEDTLS_POLY1305_C
  689. bool "Poly1305 MAC algorithm"
  690. default n
  691. help
  692. Enable support for Poly1305 MAC algorithm.
  693. config MBEDTLS_CHACHA20_C
  694. bool "Chacha20 stream cipher"
  695. default n
  696. help
  697. Enable support for Chacha20 stream cipher.
  698. config MBEDTLS_CHACHAPOLY_C
  699. bool "ChaCha20-Poly1305 AEAD algorithm"
  700. default n
  701. depends on MBEDTLS_CHACHA20_C && MBEDTLS_POLY1305_C
  702. help
  703. Enable support for ChaCha20-Poly1305 AEAD algorithm.
  704. config MBEDTLS_HKDF_C
  705. bool "HKDF algorithm (RFC 5869)"
  706. default n
  707. help
  708. Enable support for the Hashed Message Authentication Code
  709. (HMAC)-based key derivation function (HKDF).
  710. config MBEDTLS_THREADING_C
  711. bool "Enable the threading abstraction layer"
  712. default n
  713. help
  714. If you do intend to use contexts between threads, you will need to enable
  715. this layer to prevent race conditions.
  716. config MBEDTLS_THREADING_ALT
  717. bool "Enable threading alternate implementation"
  718. depends on MBEDTLS_THREADING_C
  719. default y
  720. help
  721. Enable threading alt to allow your own alternate threading implementation.
  722. config MBEDTLS_THREADING_PTHREAD
  723. bool "Enable threading pthread implementation"
  724. depends on MBEDTLS_THREADING_C
  725. default n
  726. help
  727. Enable the pthread wrapper layer for the threading layer.
  728. config MBEDTLS_LARGE_KEY_SOFTWARE_MPI
  729. bool "Fallback to software implementation for larger MPI values"
  730. depends on MBEDTLS_HARDWARE_MPI
  731. default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 # HW max 3072 bits
  732. default n
  733. help
  734. Fallback to software implementation for RSA key lengths
  735. larger than SOC_RSA_MAX_BIT_LEN. If this is not active
  736. then the ESP will be unable to process keys greater
  737. than SOC_RSA_MAX_BIT_LEN.
  738. menuconfig MBEDTLS_SECURITY_RISKS
  739. bool "Show configurations with potential security risks"
  740. default n
  741. config MBEDTLS_ALLOW_UNSUPPORTED_CRITICAL_EXT
  742. bool "X.509 CRT parsing with unsupported critical extensions"
  743. depends on MBEDTLS_SECURITY_RISKS
  744. default n
  745. help
  746. Allow the X.509 certificate parser to load certificates
  747. with unsupported critical extensions
  748. endmenu # mbedTLS