mbedtls: support configuration of PSK maximum length via Kconfig
So far maximum PSK length was configured by mbedTLS as 32 bytes. Introduce Kconfig option that will configure it instead of relying on default value from mbedTLS library, so that user can easily adjust that value to application needs. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
parent
c2524a07a6
commit
c32b524d6d
2 changed files with 18 additions and 0 deletions
|
@ -73,6 +73,20 @@ config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
|||
config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
bool "Enable the RSA-PSK based ciphersuite modes"
|
||||
|
||||
config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED
|
||||
bool
|
||||
default y if MBEDTLS_KEY_EXCHANGE_PSK_ENABLED || \
|
||||
MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED || \
|
||||
MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED || \
|
||||
MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
|
||||
config MBEDTLS_PSK_MAX_LEN
|
||||
int "Max size of TLS pre-shared keys"
|
||||
default 32
|
||||
depends on MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED
|
||||
help
|
||||
Max size of TLS pre-shared keys, in bytes.
|
||||
|
||||
config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
||||
bool "Enable the RSA-only based ciphersuite modes"
|
||||
default y if !NET_L2_OPENTHREAD
|
||||
|
|
|
@ -86,6 +86,10 @@
|
|||
#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MBEDTLS_PSK_MAX_LEN)
|
||||
#define MBEDTLS_PSK_MAX_LEN CONFIG_MBEDTLS_PSK_MAX_LEN
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
|
||||
#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue