mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-05 22:19:11 +01:00
Add code for testing server-initiated renegotiation
This commit is contained in:
parent
53b3e0603b
commit
f3dc2f6a1d
4 changed files with 59 additions and 2 deletions
|
|
@ -335,6 +335,30 @@ static int ssl_parse_ticket( ssl_context *ssl,
|
|||
}
|
||||
#endif /* POLARSSL_SSL_SESSION_TICKETS */
|
||||
|
||||
/*
|
||||
* Write HelloRequest to request renegotiation
|
||||
*/
|
||||
int ssl_write_hello_request( ssl_context *ssl )
|
||||
{
|
||||
int ret;
|
||||
|
||||
SSL_DEBUG_MSG( 2, ( "=> write hello request" ) );
|
||||
|
||||
ssl->out_msglen = 4;
|
||||
ssl->out_msgtype = SSL_MSG_HANDSHAKE;
|
||||
ssl->out_msg[0] = SSL_HS_HELLO_REQUEST;
|
||||
|
||||
if( ( ret = ssl_write_record( ssl ) ) != 0 )
|
||||
{
|
||||
SSL_DEBUG_RET( 1, "ssl_write_record", ret );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
SSL_DEBUG_MSG( 2, ( "<= write hello request" ) );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
|
||||
/*
|
||||
* Wrapper around f_sni, allowing use of ssl_set_own_cert() but
|
||||
|
|
|
|||
|
|
@ -1930,7 +1930,8 @@ int ssl_write_record( ssl_context *ssl )
|
|||
ssl->out_msg[2] = (unsigned char)( ( len - 4 ) >> 8 );
|
||||
ssl->out_msg[3] = (unsigned char)( ( len - 4 ) );
|
||||
|
||||
ssl->handshake->update_checksum( ssl, ssl->out_msg, len );
|
||||
if( ssl->out_msg[0] != SSL_HS_HELLO_REQUEST )
|
||||
ssl->handshake->update_checksum( ssl, ssl->out_msg, len );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_ZLIB_SUPPORT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue