Skip to content

Commit bbba7c9

Browse files
rluboscarlescufi
authored andcommitted
modules: mbedtls: Extend generic config with SSL cache
Add Kconfig configuration options which allow to configure session caching in mbed TLS. Note, that mbed TLS only takes care of server-side caching, the application (socket layer) needs to implement a session storage for client. Signed-off-by: Robert Lubos <[email protected]>
1 parent 523e5a6 commit bbba7c9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

modules/mbedtls/Kconfig.tls-generic

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,19 @@ config MBEDTLS_PKCS5_C
396396
help
397397
Enable PKCS5 functions
398398

399+
config MBEDTLS_SSL_CACHE_C
400+
bool "SSL session cache support"
401+
help
402+
"This option enables simple SSL cache implementation (server side)."
403+
404+
config MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT
405+
int "Default timeout for SSL cache entires"
406+
depends on MBEDTLS_SSL_CACHE_C
407+
default 86400
408+
409+
config MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES
410+
int "Maximum number of SSL cache entires"
411+
depends on MBEDTLS_SSL_CACHE_C
412+
default 5
413+
399414
endmenu

modules/mbedtls/configs/config-tls-generic.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,12 @@
434434
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
435435
#endif
436436

437+
#if defined(CONFIG_MBEDTLS_SSL_CACHE_C)
438+
#define MBEDTLS_SSL_CACHE_C
439+
#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT CONFIG_MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT
440+
#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES CONFIG_MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES
441+
#endif
442+
437443
/* User config file */
438444

439445
#if defined(CONFIG_MBEDTLS_USER_CONFIG_FILE)

0 commit comments

Comments
 (0)