ssl_tls.c: Fix ciphersuite selection regarding protocol version
Use the actual minimum and maximum of the minor
version to be negotiated to filter ciphersuites
to propose rather than the ones from the
configuration.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/ssl_client.c b/library/ssl_client.c
index d9fd375..610e6a4 100644
--- a/library/ssl_client.c
+++ b/library/ssl_client.c
@@ -431,9 +431,11 @@
if( suite_info == NULL )
return( 1 );
- if( ( suite_info->min_minor_ver > ssl->conf->max_minor_ver ) ||
- ( suite_info->max_minor_ver < ssl->conf->min_minor_ver ) )
+ if( ( suite_info->min_minor_ver > ssl->minor_ver ) ||
+ ( suite_info->max_minor_ver < ssl->handshake->min_minor_ver ) )
+ {
return( 1 );
+ }
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)