mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-03 20:54:00 +00:00
tls: Align set and usage check for PSK
Check that the identity length is not zero in ssl_conf_set_psk_identity() as it is done in mbedtls_ssl_conf_has_static_psk(). Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
fa1e04a7c4
commit
2a87e9bf83
@ -1654,6 +1654,7 @@ static int ssl_conf_set_psk_identity( mbedtls_ssl_config *conf,
|
||||
{
|
||||
/* Identity len will be encoded on two bytes */
|
||||
if( psk_identity == NULL ||
|
||||
psk_identity_len == 0 ||
|
||||
( psk_identity_len >> 16 ) != 0 ||
|
||||
psk_identity_len > MBEDTLS_SSL_OUT_CONTENT_LEN )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user