mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Implement stages except write_partial
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
@ -99,7 +99,6 @@ static int ssl_client_hello_process( mbedtls_ssl_context* ssl )
|
||||
|
||||
MBEDTLS_SSL_PROC_CHK( ssl_client_hello_postprocess, ( ssl ) );
|
||||
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg, ( ssl, buf_len, msg_len ) );
|
||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_HELLO );
|
||||
|
||||
cleanup:
|
||||
|
||||
@ -111,8 +110,31 @@ cleanup:
|
||||
|
||||
static int ssl_client_hello_prepare( mbedtls_ssl_context* ssl )
|
||||
{
|
||||
((void) ssl);
|
||||
return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||
int ret;
|
||||
size_t rand_bytes_len;
|
||||
|
||||
if( ssl->conf->f_rng == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "no RNG provided" ) );
|
||||
return( MBEDTLS_ERR_SSL_NO_RNG );
|
||||
}
|
||||
|
||||
rand_bytes_len = 32;
|
||||
|
||||
if( ( ret = ssl->conf->f_rng( ssl->conf->p_rng, ssl->handshake->randbytes, rand_bytes_len ) ) != 0 )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "ssl_generate_random", ret );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
static int ssl_client_hello_postprocess( mbedtls_ssl_context* ssl )
|
||||
{
|
||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_HELLO );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
static int ssl_client_hello_write_partial( mbedtls_ssl_context* ssl,
|
||||
@ -128,11 +150,7 @@ static int ssl_client_hello_write_partial( mbedtls_ssl_context* ssl,
|
||||
return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||
}
|
||||
|
||||
static int ssl_client_hello_postprocess( mbedtls_ssl_context* ssl )
|
||||
{
|
||||
((void) ssl);
|
||||
return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||
}
|
||||
|
||||
|
||||
#endif /* MBEDTLS_SSL_CLI_C */
|
||||
|
||||
|
Reference in New Issue
Block a user