mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
tls: pake: add check for empty passwords in mbedtls_ssl_set_hs_ecjpake_password()
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
@@ -1991,6 +1991,10 @@ int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl,
|
|||||||
else
|
else
|
||||||
role = MBEDTLS_ECJPAKE_CLIENT;
|
role = MBEDTLS_ECJPAKE_CLIENT;
|
||||||
|
|
||||||
|
/* Empty password is not valid */
|
||||||
|
if( ( pw == NULL) || ( pw_len == 0 ) )
|
||||||
|
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||||
|
|
||||||
return( mbedtls_ecjpake_setup( &ssl->handshake->ecjpake_ctx,
|
return( mbedtls_ecjpake_setup( &ssl->handshake->ecjpake_ctx,
|
||||||
role,
|
role,
|
||||||
MBEDTLS_MD_SHA256,
|
MBEDTLS_MD_SHA256,
|
||||||
|
Reference in New Issue
Block a user