mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-13 04:13:45 +00:00
Merge pull request #6306 from tom-cosgrove-arm/issue-6305-fix
Return an error from mbedtls_ssl_handshake_step() if neither client nor server
This commit is contained in:
commit
ae2635df6f
@ -3376,6 +3376,10 @@ int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl )
|
||||
if( ret != 0 )
|
||||
goto cleanup;
|
||||
|
||||
/* If ssl->conf->endpoint is not one of MBEDTLS_SSL_IS_CLIENT or
|
||||
* MBEDTLS_SSL_IS_SERVER, this is the return code we give */
|
||||
ret = MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
||||
|
||||
#if defined(MBEDTLS_SSL_CLI_C)
|
||||
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT )
|
||||
{
|
||||
@ -3386,6 +3390,7 @@ int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl )
|
||||
{
|
||||
case MBEDTLS_SSL_HELLO_REQUEST:
|
||||
ssl->state = MBEDTLS_SSL_CLIENT_HELLO;
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
case MBEDTLS_SSL_CLIENT_HELLO:
|
||||
|
Loading…
x
Reference in New Issue
Block a user