Kconfig 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  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 && !MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
  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_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 "mbedTLS v3.x related"
  145. # NOTE: MBEDTLS_DYNAMIC_BUFFER feature is not supported with TLS 1.3 yet. Ref: IDF-4762
  146. config MBEDTLS_SSL_PROTO_TLS1_3
  147. bool "Support TLS 1.3 protocol"
  148. depends on MBEDTLS_TLS_ENABLED && MBEDTLS_SSL_KEEP_PEER_CERTIFICATE && !MBEDTLS_DYNAMIC_BUFFER
  149. select MBEDTLS_HKDF_C
  150. default n
  151. config MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
  152. bool "Enable TLS 1.3 middlebox compatibility mode"
  153. depends on MBEDTLS_SSL_PROTO_TLS1_3
  154. default y
  155. config MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
  156. bool "Variable SSL buffer length"
  157. default n
  158. help
  159. This enables the SSL buffer to be resized automatically
  160. based on the negotiated maximum fragment length in each direction.
  161. config MBEDTLS_ECDH_LEGACY_CONTEXT
  162. bool "Use a backward compatible ECDH context (Experimental)"
  163. default n
  164. depends on MBEDTLS_ECDH_C && MBEDTLS_ECP_RESTARTABLE
  165. help
  166. Use the legacy ECDH context format.
  167. Define this option only if you enable MBEDTLS_ECP_RESTARTABLE or if you
  168. want to access ECDH context fields directly.
  169. config MBEDTLS_X509_TRUSTED_CERT_CALLBACK
  170. bool "Enable trusted certificate callbacks"
  171. default n
  172. help
  173. Enables users to configure the set of trusted certificates
  174. through a callback instead of a linked list.
  175. See mbedTLS documentation for required API and more details.
  176. config MBEDTLS_SSL_CONTEXT_SERIALIZATION
  177. bool "Enable serialization of the TLS context structures"
  178. default n
  179. help
  180. Enable serialization of the TLS context structures
  181. This is a local optimization in handling a single, potentially long-lived connection.
  182. See mbedTLS documentation for required API and more details.
  183. Disabling this option will save some code size.
  184. config MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
  185. bool "Keep peer certificate after handshake completion"
  186. default y
  187. depends on !MBEDTLS_DYNAMIC_FREE_PEER_CERT
  188. help
  189. Keep the peer's certificate after completion of the handshake.
  190. Disabling this option will save about 4kB of heap and some code size.
  191. See mbedTLS documentation for required API and more details.
  192. menu "DTLS-based configurations"
  193. visible if MBEDTLS_SSL_PROTO_DTLS
  194. config MBEDTLS_SSL_DTLS_CONNECTION_ID
  195. bool "Support for the DTLS Connection ID extension"
  196. depends on MBEDTLS_SSL_PROTO_DTLS
  197. default n
  198. help
  199. Enable support for the DTLS Connection ID extension which allows to
  200. identify DTLS connections across changes in the underlying transport.
  201. The Connection ID extension is still in draft state.
  202. Refer: version draft-ietf-tls-dtls-connection-id-05
  203. config MBEDTLS_SSL_CID_IN_LEN_MAX
  204. int "Maximum length of CIDs used for incoming DTLS messages"
  205. default 32
  206. range 0 32
  207. depends on MBEDTLS_SSL_DTLS_CONNECTION_ID
  208. help
  209. Maximum length of CIDs used for incoming DTLS messages
  210. config MBEDTLS_SSL_CID_OUT_LEN_MAX
  211. int "Maximum length of CIDs used for outgoing DTLS messages"
  212. default 32
  213. range 0 32
  214. depends on MBEDTLS_SSL_DTLS_CONNECTION_ID
  215. help
  216. Maximum length of CIDs used for outgoing DTLS messages
  217. config MBEDTLS_SSL_CID_PADDING_GRANULARITY
  218. int "Record plaintext padding (for DTLS 1.2)"
  219. default 16
  220. range 0 32
  221. depends on MBEDTLS_SSL_DTLS_CONNECTION_ID
  222. help
  223. Controls the use of record plaintext padding when
  224. using the Connection ID extension in DTLS 1.2.
  225. The padding will always be chosen so that the length of the
  226. padded plaintext is a multiple of the value of this option.
  227. Notes:
  228. A value of 1 means that no padding will be used for outgoing records.
  229. On systems lacking division instructions, a power of two should be preferred.
  230. config MBEDTLS_SSL_DTLS_SRTP
  231. bool "Enable support for negotiation of DTLS-SRTP (RFC 5764)"
  232. depends on MBEDTLS_SSL_PROTO_DTLS
  233. default n
  234. help
  235. Enable support for negotiation of DTLS-SRTP (RFC 5764) through the use_srtp extension.
  236. See mbedTLS documentation for required API and more details.
  237. Disabling this option will save some code size.
  238. endmenu
  239. endmenu
  240. menu "Certificate Bundle"
  241. config MBEDTLS_CERTIFICATE_BUNDLE
  242. bool "Enable trusted root certificate bundle"
  243. default y
  244. help
  245. Enable support for large number of default root certificates
  246. When enabled this option allows user to store default as well
  247. as customer specific root certificates in compressed format rather
  248. than storing full certificate. For the root certificates the public key and the subject name
  249. will be stored.
  250. choice MBEDTLS_DEFAULT_CERTIFICATE_BUNDLE
  251. bool "Default certificate bundle options"
  252. depends on MBEDTLS_CERTIFICATE_BUNDLE
  253. default MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL
  254. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL
  255. bool "Use the full default certificate bundle"
  256. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN
  257. bool "Use only the most common certificates from the default bundles"
  258. help
  259. Use only the most common certificates from the default bundles, reducing the size with 50%,
  260. while still having around 99% coverage.
  261. config MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE
  262. bool "Do not use the default certificate bundle"
  263. endchoice
  264. config MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE
  265. depends on MBEDTLS_CERTIFICATE_BUNDLE
  266. default n
  267. bool "Add custom certificates to the default bundle"
  268. config MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH
  269. depends on MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE
  270. string "Custom certificate bundle path"
  271. help
  272. Name of the custom certificate directory or file. This path is evaluated
  273. relative to the project root directory.
  274. config MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS
  275. int "Maximum no of certificates allowed in certificate bundle"
  276. default 200
  277. depends on MBEDTLS_CERTIFICATE_BUNDLE
  278. endmenu
  279. config MBEDTLS_ECP_RESTARTABLE
  280. bool "Enable mbedTLS ecp restartable"
  281. select MBEDTLS_ECDH_LEGACY_CONTEXT
  282. default n
  283. help
  284. Enable "non-blocking" ECC operations that can return early and be resumed.
  285. config MBEDTLS_CMAC_C
  286. bool "Enable CMAC mode for block ciphers"
  287. default n
  288. depends on MBEDTLS_AES_C || MBEDTLS_DES_C
  289. help
  290. Enable the CMAC (Cipher-based Message Authentication Code) mode for
  291. block ciphers.
  292. config MBEDTLS_HARDWARE_AES
  293. bool "Enable hardware AES acceleration"
  294. default y
  295. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST && SOC_AES_SUPPORTED
  296. help
  297. Enable hardware accelerated AES encryption & decryption.
  298. Note that if the ESP32 CPU is running at 240MHz, hardware AES does not
  299. offer any speed boost over software AES.
  300. config MBEDTLS_AES_USE_INTERRUPT
  301. bool "Use interrupt for long AES operations"
  302. depends on !IDF_TARGET_ESP32 && MBEDTLS_HARDWARE_AES
  303. default y
  304. help
  305. Use an interrupt to coordinate long AES operations.
  306. This allows other code to run on the CPU while an AES operation is pending.
  307. Otherwise the CPU busy-waits.
  308. config MBEDTLS_HARDWARE_GCM
  309. bool "Enable partially hardware accelerated GCM"
  310. depends on SOC_AES_SUPPORT_GCM && MBEDTLS_HARDWARE_AES
  311. default y
  312. help
  313. Enable partially hardware accelerated GCM. GHASH calculation is still done
  314. in software.
  315. If MBEDTLS_HARDWARE_GCM is disabled and MBEDTLS_HARDWARE_AES is enabled then
  316. mbedTLS will still use the hardware accelerated AES block operation, but
  317. on a single block at a time.
  318. config MBEDTLS_HARDWARE_MPI
  319. bool "Enable hardware MPI (bignum) acceleration"
  320. default y
  321. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST && SOC_MPI_SUPPORTED
  322. help
  323. Enable hardware accelerated multiple precision integer operations.
  324. Hardware accelerated multiplication, modulo multiplication,
  325. and modular exponentiation for up to SOC_RSA_MAX_BIT_LEN bit results.
  326. These operations are used by RSA.
  327. config MBEDTLS_MPI_USE_INTERRUPT
  328. bool "Use interrupt for MPI exp-mod operations"
  329. depends on !IDF_TARGET_ESP32 && MBEDTLS_HARDWARE_MPI
  330. default y
  331. help
  332. Use an interrupt to coordinate long MPI operations.
  333. This allows other code to run on the CPU while an MPI operation is pending.
  334. Otherwise the CPU busy-waits.
  335. config MBEDTLS_HARDWARE_SHA
  336. bool "Enable hardware SHA acceleration"
  337. default y
  338. depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST && SOC_SHA_SUPPORTED
  339. help
  340. Enable hardware accelerated SHA1, SHA256, SHA384 & SHA512 in mbedTLS.
  341. Due to a hardware limitation, on the ESP32 hardware acceleration is only
  342. guaranteed if SHA digests are calculated one at a time. If more
  343. than one SHA digest is calculated at the same time, one will
  344. be calculated fully in hardware and the rest will be calculated
  345. (at least partially calculated) in software. This happens automatically.
  346. SHA hardware acceleration is faster than software in some situations but
  347. slower in others. You should benchmark to find the best setting for you.
  348. config MBEDTLS_HARDWARE_ECC
  349. bool "Enable hardware ECC acceleration"
  350. default y
  351. depends on SOC_ECC_SUPPORTED
  352. help
  353. Enable hardware accelerated ECC point multiplication and point verification for points
  354. on curve SECP192R1 and SECP256R1 in mbedTLS
  355. config MBEDTLS_ECC_OTHER_CURVES_SOFT_FALLBACK
  356. bool "Fallback to software implementation for curves not supported in hardware"
  357. depends on MBEDTLS_HARDWARE_ECC
  358. default y
  359. help
  360. Fallback to software implementation of ECC point multiplication and point verification
  361. for curves not supported in hardware.
  362. config MBEDTLS_ROM_MD5
  363. bool "Use MD5 implementation in ROM"
  364. default y
  365. help
  366. Use ROM MD5 in mbedTLS.
  367. config MBEDTLS_ATCA_HW_ECDSA_SIGN
  368. bool "Enable hardware ECDSA sign acceleration when using ATECC608A"
  369. default n
  370. help
  371. This option enables hardware acceleration for ECDSA sign function, only
  372. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  373. config MBEDTLS_ATCA_HW_ECDSA_VERIFY
  374. bool "Enable hardware ECDSA verify acceleration when using ATECC608A"
  375. default n
  376. help
  377. This option enables hardware acceleration for ECDSA sign function, only
  378. when using ATECC608A cryptoauth chip (integrated with ESP32-WROOM-32SE)
  379. config MBEDTLS_HAVE_TIME
  380. bool "Enable mbedtls time support"
  381. depends on !ESP_TIME_FUNCS_USE_NONE
  382. default y
  383. help
  384. Enable use of time.h functions (time() and gmtime()) by mbedTLS.
  385. This option doesn't require the system time to be correct, but enables
  386. functionality that requires relative timekeeping - for example periodic
  387. expiry of TLS session tickets or session cache entries.
  388. Disabling this option will save some firmware size, particularly if
  389. the rest of the firmware doesn't call any standard timekeeeping
  390. functions.
  391. config MBEDTLS_PLATFORM_TIME_ALT
  392. bool "Enable mbedtls time support: platform-specific"
  393. depends on MBEDTLS_HAVE_TIME
  394. default n
  395. help
  396. Enabling this config will provide users with a function
  397. "mbedtls_platform_set_time()" that allows to set an alternative
  398. time function pointer.
  399. config MBEDTLS_HAVE_TIME_DATE
  400. bool "Enable mbedtls certificate expiry check"
  401. depends on MBEDTLS_HAVE_TIME
  402. default n
  403. help
  404. Enables X.509 certificate expiry checks in mbedTLS.
  405. If this option is disabled (default) then X.509 certificate
  406. "valid from" and "valid to" timestamp fields are ignored.
  407. If this option is enabled, these fields are compared with the
  408. current system date and time. The time is retrieved using the
  409. standard time() and gmtime() functions. If the certificate is not
  410. valid for the current system time then verification will fail with
  411. code MBEDTLS_X509_BADCERT_FUTURE or MBEDTLS_X509_BADCERT_EXPIRED.
  412. Enabling this option requires adding functionality in the firmware
  413. to set the system clock to a valid timestamp before using TLS. The
  414. recommended way to do this is via ESP-IDF's SNTP functionality, but
  415. any method can be used.
  416. In the case where only a small number of certificates are trusted by
  417. the device, please carefully consider the tradeoffs of enabling this
  418. option. There may be undesired consequences, for example if all
  419. trusted certificates expire while the device is offline and a TLS
  420. connection is required to update. Or if an issue with the SNTP
  421. server means that the system time is invalid for an extended period
  422. after a reset.
  423. config MBEDTLS_ECDSA_DETERMINISTIC
  424. bool "Enable deterministic ECDSA"
  425. default y
  426. help
  427. Standard ECDSA is "fragile" in the sense that lack of entropy when signing
  428. may result in a compromise of the long-term signing key.
  429. config MBEDTLS_SHA512_C
  430. bool "Enable the SHA-384 and SHA-512 cryptographic hash algorithms"
  431. default y
  432. help
  433. Enable MBEDTLS_SHA512_C adds support for SHA-384 and SHA-512.
  434. choice MBEDTLS_TLS_MODE
  435. bool "TLS Protocol Role"
  436. default MBEDTLS_TLS_SERVER_AND_CLIENT
  437. help
  438. mbedTLS can be compiled with protocol support for the TLS
  439. server, TLS client, or both server and client.
  440. Reducing the number of TLS roles supported saves code size.
  441. config MBEDTLS_TLS_SERVER_AND_CLIENT
  442. bool "Server & Client"
  443. select MBEDTLS_TLS_SERVER
  444. select MBEDTLS_TLS_CLIENT
  445. config MBEDTLS_TLS_SERVER_ONLY
  446. bool "Server"
  447. select MBEDTLS_TLS_SERVER
  448. config MBEDTLS_TLS_CLIENT_ONLY
  449. bool "Client"
  450. select MBEDTLS_TLS_CLIENT
  451. config MBEDTLS_TLS_DISABLED
  452. bool "None"
  453. endchoice
  454. config MBEDTLS_TLS_SERVER
  455. bool
  456. select MBEDTLS_TLS_ENABLED
  457. config MBEDTLS_TLS_CLIENT
  458. bool
  459. select MBEDTLS_TLS_ENABLED
  460. config MBEDTLS_TLS_ENABLED
  461. bool
  462. menu "TLS Key Exchange Methods"
  463. depends on MBEDTLS_TLS_ENABLED
  464. config MBEDTLS_PSK_MODES
  465. bool "Enable pre-shared-key ciphersuites"
  466. default n
  467. help
  468. Enable to show configuration for different types of pre-shared-key TLS authentatication methods.
  469. Leaving this options disabled will save code size if they are not used.
  470. config MBEDTLS_KEY_EXCHANGE_PSK
  471. bool "Enable PSK based ciphersuite modes"
  472. depends on MBEDTLS_PSK_MODES
  473. default n
  474. help
  475. Enable to support symmetric key PSK (pre-shared-key) TLS key exchange modes.
  476. config MBEDTLS_KEY_EXCHANGE_DHE_PSK
  477. bool "Enable DHE-PSK based ciphersuite modes"
  478. depends on MBEDTLS_PSK_MODES && MBEDTLS_DHM_C
  479. default y
  480. help
  481. Enable to support Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  482. config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK
  483. bool "Enable ECDHE-PSK based ciphersuite modes"
  484. depends on MBEDTLS_PSK_MODES && MBEDTLS_ECDH_C
  485. default y
  486. help
  487. Enable to support Elliptic-Curve-Diffie-Hellman PSK (pre-shared-key) TLS authentication modes.
  488. config MBEDTLS_KEY_EXCHANGE_RSA_PSK
  489. bool "Enable RSA-PSK based ciphersuite modes"
  490. depends on MBEDTLS_PSK_MODES
  491. default y
  492. help
  493. Enable to support RSA PSK (pre-shared-key) TLS authentication modes.
  494. config MBEDTLS_KEY_EXCHANGE_RSA
  495. bool "Enable RSA-only based ciphersuite modes"
  496. default y
  497. help
  498. Enable to support ciphersuites with prefix TLS-RSA-WITH-
  499. config MBEDTLS_KEY_EXCHANGE_DHE_RSA
  500. bool "Enable DHE-RSA based ciphersuite modes"
  501. default y
  502. depends on MBEDTLS_DHM_C
  503. help
  504. Enable to support ciphersuites with prefix TLS-DHE-RSA-WITH-
  505. config MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE
  506. bool "Support Elliptic Curve based ciphersuites"
  507. depends on MBEDTLS_ECP_C
  508. default y
  509. help
  510. Enable to show Elliptic Curve based ciphersuite mode options.
  511. Disabling all Elliptic Curve ciphersuites saves code size and
  512. can give slightly faster TLS handshakes, provided the server supports
  513. RSA-only ciphersuite modes.
  514. config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA
  515. bool "Enable ECDHE-RSA based ciphersuite modes"
  516. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  517. default y
  518. help
  519. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  520. config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA
  521. bool "Enable ECDHE-ECDSA based ciphersuite modes"
  522. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  523. default y
  524. help
  525. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  526. config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA
  527. bool "Enable ECDH-ECDSA based ciphersuite modes"
  528. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
  529. default y
  530. help
  531. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  532. config MBEDTLS_KEY_EXCHANGE_ECDH_RSA
  533. bool "Enable ECDH-RSA based ciphersuite modes"
  534. depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
  535. default y
  536. help
  537. Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
  538. config MBEDTLS_KEY_EXCHANGE_ECJPAKE
  539. bool "Enable ECJPAKE based ciphersuite modes"
  540. depends on MBEDTLS_ECJPAKE_C && MBEDTLS_ECP_DP_SECP256R1_ENABLED
  541. default n
  542. help
  543. Enable to support ciphersuites with prefix TLS-ECJPAKE-WITH-
  544. endmenu # TLS key exchange modes
  545. config MBEDTLS_SSL_RENEGOTIATION
  546. bool "Support TLS renegotiation"
  547. depends on MBEDTLS_TLS_ENABLED
  548. default y
  549. help
  550. The two main uses of renegotiation are (1) refresh keys on long-lived
  551. connections and (2) client authentication after the initial handshake.
  552. If you don't need renegotiation, disabling it will save code size and
  553. reduce the possibility of abuse/vulnerability.
  554. config MBEDTLS_SSL_PROTO_TLS1_2
  555. bool "Support TLS 1.2 protocol"
  556. depends on MBEDTLS_TLS_ENABLED
  557. default y
  558. config MBEDTLS_SSL_PROTO_GMTSSL1_1
  559. bool "Support GM/T SSL 1.1 protocol"
  560. depends on MBEDTLS_TLS_ENABLED
  561. default n
  562. help
  563. Provisions for GM/T SSL 1.1 support
  564. config MBEDTLS_SSL_PROTO_DTLS
  565. bool "Support DTLS protocol (all versions)"
  566. default n
  567. depends on MBEDTLS_SSL_PROTO_TLS1_2
  568. help
  569. Requires TLS 1.2 to be enabled for DTLS 1.2
  570. config MBEDTLS_SSL_ALPN
  571. bool "Support ALPN (Application Layer Protocol Negotiation)"
  572. depends on MBEDTLS_TLS_ENABLED
  573. default y
  574. help
  575. Disabling this option will save some code size if it is not needed.
  576. config MBEDTLS_CLIENT_SSL_SESSION_TICKETS
  577. bool "TLS: Client Support for RFC 5077 SSL session tickets"
  578. default y
  579. depends on MBEDTLS_TLS_ENABLED
  580. help
  581. Client support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  582. Disabling this option will save some code size.
  583. config MBEDTLS_SERVER_SSL_SESSION_TICKETS
  584. bool "TLS: Server Support for RFC 5077 SSL session tickets"
  585. default y
  586. depends on MBEDTLS_TLS_ENABLED
  587. help
  588. Server support for RFC 5077 session tickets. See mbedTLS documentation for more details.
  589. Disabling this option will save some code size.
  590. menu "Symmetric Ciphers"
  591. config MBEDTLS_AES_C
  592. bool "AES block cipher"
  593. default y
  594. config MBEDTLS_CAMELLIA_C
  595. bool "Camellia block cipher"
  596. default n
  597. config MBEDTLS_DES_C
  598. bool "DES block cipher (legacy, insecure)"
  599. default n
  600. help
  601. Enables the DES block cipher to support 3DES-based TLS ciphersuites.
  602. 3DES is vulnerable to the Sweet32 attack and should only be enabled
  603. if absolutely necessary.
  604. config MBEDTLS_BLOWFISH_C
  605. bool "Blowfish block cipher (read help)"
  606. default n
  607. help
  608. Enables the Blowfish block cipher (not used for TLS sessions.)
  609. The Blowfish cipher is not used for mbedTLS TLS sessions but can be
  610. used for other purposes. Read up on the limitations of Blowfish (including
  611. Sweet32) before enabling.
  612. config MBEDTLS_XTEA_C
  613. bool "XTEA block cipher"
  614. default n
  615. help
  616. Enables the XTEA block cipher.
  617. config MBEDTLS_CCM_C
  618. bool "CCM (Counter with CBC-MAC) block cipher modes"
  619. default y
  620. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  621. help
  622. Enable Counter with CBC-MAC (CCM) modes for AES and/or Camellia ciphers.
  623. Disabling this option saves some code size.
  624. config MBEDTLS_GCM_C
  625. bool "GCM (Galois/Counter) block cipher modes"
  626. default y
  627. depends on MBEDTLS_AES_C || MBEDTLS_CAMELLIA_C
  628. help
  629. Enable Galois/Counter Mode for AES and/or Camellia ciphers.
  630. This option is generally faster than CCM.
  631. config MBEDTLS_NIST_KW_C
  632. bool "NIST key wrapping (KW) and KW padding (KWP)"
  633. default n
  634. depends on MBEDTLS_AES_C
  635. help
  636. Enable NIST key wrapping and key wrapping padding.
  637. endmenu # Symmetric Ciphers
  638. config MBEDTLS_RIPEMD160_C
  639. bool "Enable RIPEMD-160 hash algorithm"
  640. default n
  641. help
  642. Enable the RIPEMD-160 hash algorithm.
  643. menu "Certificates"
  644. config MBEDTLS_PEM_PARSE_C
  645. bool "Read & Parse PEM formatted certificates"
  646. default y
  647. help
  648. Enable decoding/parsing of PEM formatted certificates.
  649. If your certificates are all in the simpler DER format, disabling
  650. this option will save some code size.
  651. config MBEDTLS_PEM_WRITE_C
  652. bool "Write PEM formatted certificates"
  653. default y
  654. help
  655. Enable writing of PEM formatted certificates.
  656. If writing certificate data only in DER format, disabling this
  657. option will save some code size.
  658. config MBEDTLS_X509_CRL_PARSE_C
  659. bool "X.509 CRL parsing"
  660. default y
  661. help
  662. Support for parsing X.509 Certifificate Revocation Lists.
  663. config MBEDTLS_X509_CSR_PARSE_C
  664. bool "X.509 CSR parsing"
  665. default y
  666. help
  667. Support for parsing X.509 Certifificate Signing Requests
  668. endmenu # Certificates
  669. menuconfig MBEDTLS_ECP_C
  670. bool "Elliptic Curve Ciphers"
  671. default y
  672. config MBEDTLS_DHM_C
  673. bool "Diffie-Hellman-Merkle key exchange (DHM)"
  674. default n
  675. help
  676. Enable DHM. Needed to use DHE-xxx TLS ciphersuites.
  677. Note that the security of Diffie-Hellman key exchanges depends on
  678. a suitable prime being used for the exchange. Please see detailed
  679. warning text about this in file `mbedtls/dhm.h` file.
  680. config MBEDTLS_ECDH_C
  681. bool "Elliptic Curve Diffie-Hellman (ECDH)"
  682. depends on MBEDTLS_ECP_C
  683. default y
  684. help
  685. Enable ECDH. Needed to use ECDHE-xxx TLS ciphersuites.
  686. config MBEDTLS_ECDSA_C
  687. bool "Elliptic Curve DSA"
  688. depends on MBEDTLS_ECDH_C
  689. default y
  690. help
  691. Enable ECDSA. Needed to use ECDSA-xxx TLS ciphersuites.
  692. config MBEDTLS_ECJPAKE_C
  693. bool "Elliptic curve J-PAKE"
  694. depends on MBEDTLS_ECP_C
  695. default n
  696. help
  697. Enable ECJPAKE. Needed to use ECJPAKE-xxx TLS ciphersuites.
  698. config MBEDTLS_ECP_DP_SECP192R1_ENABLED
  699. bool "Enable SECP192R1 curve"
  700. depends on MBEDTLS_ECP_C
  701. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  702. help
  703. Enable support for SECP192R1 Elliptic Curve.
  704. config MBEDTLS_ECP_DP_SECP224R1_ENABLED
  705. bool "Enable SECP224R1 curve"
  706. depends on MBEDTLS_ECP_C
  707. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  708. help
  709. Enable support for SECP224R1 Elliptic Curve.
  710. config MBEDTLS_ECP_DP_SECP256R1_ENABLED
  711. bool "Enable SECP256R1 curve"
  712. depends on MBEDTLS_ECP_C
  713. default y
  714. help
  715. Enable support for SECP256R1 Elliptic Curve.
  716. config MBEDTLS_ECP_DP_SECP384R1_ENABLED
  717. bool "Enable SECP384R1 curve"
  718. depends on MBEDTLS_ECP_C
  719. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  720. help
  721. Enable support for SECP384R1 Elliptic Curve.
  722. config MBEDTLS_ECP_DP_SECP521R1_ENABLED
  723. bool "Enable SECP521R1 curve"
  724. depends on MBEDTLS_ECP_C
  725. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  726. help
  727. Enable support for SECP521R1 Elliptic Curve.
  728. config MBEDTLS_ECP_DP_SECP192K1_ENABLED
  729. bool "Enable SECP192K1 curve"
  730. depends on MBEDTLS_ECP_C
  731. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  732. help
  733. Enable support for SECP192K1 Elliptic Curve.
  734. config MBEDTLS_ECP_DP_SECP224K1_ENABLED
  735. bool "Enable SECP224K1 curve"
  736. depends on MBEDTLS_ECP_C
  737. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  738. help
  739. Enable support for SECP224K1 Elliptic Curve.
  740. config MBEDTLS_ECP_DP_SECP256K1_ENABLED
  741. bool "Enable SECP256K1 curve"
  742. depends on MBEDTLS_ECP_C
  743. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  744. help
  745. Enable support for SECP256K1 Elliptic Curve.
  746. config MBEDTLS_ECP_DP_BP256R1_ENABLED
  747. bool "Enable BP256R1 curve"
  748. depends on MBEDTLS_ECP_C
  749. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  750. help
  751. support for DP Elliptic Curve.
  752. config MBEDTLS_ECP_DP_BP384R1_ENABLED
  753. bool "Enable BP384R1 curve"
  754. depends on MBEDTLS_ECP_C
  755. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  756. help
  757. support for DP Elliptic Curve.
  758. config MBEDTLS_ECP_DP_BP512R1_ENABLED
  759. bool "Enable BP512R1 curve"
  760. depends on MBEDTLS_ECP_C
  761. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  762. help
  763. support for DP Elliptic Curve.
  764. config MBEDTLS_ECP_DP_CURVE25519_ENABLED
  765. bool "Enable CURVE25519 curve"
  766. depends on MBEDTLS_ECP_C
  767. default y if !(MBEDTLS_ATCA_HW_ECDSA_SIGN || MBEDTLS_ATCA_HW_ECDSA_VERIFY)
  768. help
  769. Enable support for CURVE25519 Elliptic Curve.
  770. config MBEDTLS_ECP_NIST_OPTIM
  771. bool "NIST 'modulo p' optimisations"
  772. depends on MBEDTLS_ECP_C
  773. default y
  774. help
  775. NIST 'modulo p' optimisations increase Elliptic Curve operation performance.
  776. Disabling this option saves some code size.
  777. # end of Elliptic Curve options
  778. config MBEDTLS_POLY1305_C
  779. bool "Poly1305 MAC algorithm"
  780. default n
  781. help
  782. Enable support for Poly1305 MAC algorithm.
  783. config MBEDTLS_CHACHA20_C
  784. bool "Chacha20 stream cipher"
  785. default n
  786. help
  787. Enable support for Chacha20 stream cipher.
  788. config MBEDTLS_CHACHAPOLY_C
  789. bool "ChaCha20-Poly1305 AEAD algorithm"
  790. default n
  791. depends on MBEDTLS_CHACHA20_C && MBEDTLS_POLY1305_C
  792. help
  793. Enable support for ChaCha20-Poly1305 AEAD algorithm.
  794. config MBEDTLS_HKDF_C
  795. bool "HKDF algorithm (RFC 5869)"
  796. default n
  797. help
  798. Enable support for the Hashed Message Authentication Code
  799. (HMAC)-based key derivation function (HKDF).
  800. config MBEDTLS_THREADING_C
  801. bool "Enable the threading abstraction layer"
  802. default n
  803. help
  804. If you do intend to use contexts between threads, you will need to enable
  805. this layer to prevent race conditions.
  806. config MBEDTLS_THREADING_ALT
  807. bool "Enable threading alternate implementation"
  808. depends on MBEDTLS_THREADING_C
  809. default y
  810. help
  811. Enable threading alt to allow your own alternate threading implementation.
  812. config MBEDTLS_THREADING_PTHREAD
  813. bool "Enable threading pthread implementation"
  814. depends on MBEDTLS_THREADING_C
  815. default n
  816. help
  817. Enable the pthread wrapper layer for the threading layer.
  818. config MBEDTLS_LARGE_KEY_SOFTWARE_MPI
  819. bool "Fallback to software implementation for larger MPI values"
  820. depends on MBEDTLS_HARDWARE_MPI
  821. default y if SOC_RSA_MAX_BIT_LEN <= 3072 # HW max 3072 bits
  822. default n
  823. help
  824. Fallback to software implementation for RSA key lengths
  825. larger than SOC_RSA_MAX_BIT_LEN. If this is not active
  826. then the ESP will be unable to process keys greater
  827. than SOC_RSA_MAX_BIT_LEN.
  828. menuconfig MBEDTLS_SECURITY_RISKS
  829. bool "Show configurations with potential security risks"
  830. default n
  831. config MBEDTLS_ALLOW_UNSUPPORTED_CRITICAL_EXT
  832. bool "X.509 CRT parsing with unsupported critical extensions"
  833. depends on MBEDTLS_SECURITY_RISKS
  834. default n
  835. help
  836. Allow the X.509 certificate parser to load certificates
  837. with unsupported critical extensions
  838. endmenu # mbedTLS