1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

ssl_server2 and ssl_client2 adapted to support maximum protocol version

This commit is contained in:
Paul Bakker
2013-06-29 16:01:32 +02:00
parent 2fbefde1d8
commit c1516be99d
2 changed files with 75 additions and 1 deletions

View File

@ -391,6 +391,20 @@ int main( int argc, char *argv[] )
goto usage;
}
if( opt.force_ciphersuite[0] > 0 )
{
const ssl_ciphersuite_t *ciphersuite_info;
ciphersuite_info = ssl_ciphersuite_from_id( opt.force_ciphersuite[0] );
if( ciphersuite_info->min_minor_ver > opt.max_version ||
ciphersuite_info->max_minor_ver < opt.min_version )
{
printf("forced ciphersuite not allowed with this protocol version\n");
ret = 2;
goto usage;
}
}
#if defined(POLARSSL_KEY_EXCHANGE_PSK_ENABLED)
/*
* Unhexify the pre-shared key if any is given