1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

More ssl_set_XXX() functions can return BAD_INPUT

This commit is contained in:
Manuel Pégourié-Gonnard
2014-02-10 14:25:10 +01:00
committed by Paul Bakker
parent b21ca2a69f
commit 864a81fdc0
4 changed files with 90 additions and 31 deletions

View File

@ -1261,9 +1261,14 @@ int main( int argc, char *argv[] )
}
ssl_set_endpoint( &ssl, SSL_IS_SERVER );
ssl_set_transport( &ssl, opt.transport );
ssl_set_authmode( &ssl, opt.auth_mode );
if( ( ret = ssl_set_transport( &ssl, opt.transport ) ) != 0 )
{
printf( "selected transport is not available\n" );
goto exit;
}
#if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
if( ( ret = ssl_set_max_frag_len( &ssl, opt.mfl_code ) ) != 0 )
{
@ -1392,10 +1397,24 @@ int main( int argc, char *argv[] )
#endif
if( opt.min_version != -1 )
ssl_set_min_version( &ssl, SSL_MAJOR_VERSION_3, opt.min_version );
{
ret = ssl_set_min_version( &ssl, SSL_MAJOR_VERSION_3, opt.min_version );
if( ret != 0 )
{
printf( " selected min_version is not available\n" );
goto exit;
}
}
if( opt.max_version != -1 )
ssl_set_max_version( &ssl, SSL_MAJOR_VERSION_3, opt.max_version );
{
ret = ssl_set_max_version( &ssl, SSL_MAJOR_VERSION_3, opt.max_version );
if( ret != 0 )
{
printf( " selected max_version is not available\n" );
goto exit;
}
}
printf( " ok\n" );