From c37423fa7628dd39d77090fb1fea7cde2408bc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 16 Oct 2018 10:28:17 +0200 Subject: [PATCH] Fix misleading sub-state name and comments The enum constant had 'ske' in its name while this was a sub-state of the "write client key exchange" state; corresponding issue in the comment. --- include/mbedtls/ssl_internal.h | 4 ++-- library/ssl_cli.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index c09fd7007..97abb9f90 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -301,8 +301,8 @@ struct mbedtls_ssl_handshake_params enum { /* this complements ssl->state with info on intra-state operations */ ssl_ecrs_none = 0, /*!< nothing going on (yet) */ ssl_ecrs_crt_verify, /*!< Certificate: crt_verify() */ - ssl_ecrs_ske_start_processing, /*!< ServerKeyExchange: step 1 */ - ssl_ecrs_ske_ecdh_calc_secret, /*!< ServerKeyExchange: ECDH step 2 */ + ssl_ecrs_ske_start_processing, /*!< ServerKeyExchange: pk_verify() */ + ssl_ecrs_cke_ecdh_calc_secret, /*!< ClientKeyExchange: ECDH step 2 */ ssl_ecrs_crt_vrfy_sign, /*!< CertificateVerify: pk_sign() */ } ecrs_state; /*!< current (or last) operation */ size_t ecrs_n; /*!< place for saving a length */ diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 7b88e61e3..5720a4b88 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -2946,7 +2946,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) if( ssl->handshake->ecrs_enabled ) { - if( ssl->handshake->ecrs_state == ssl_ecrs_ske_ecdh_calc_secret ) + if( ssl->handshake->ecrs_state == ssl_ecrs_cke_ecdh_calc_secret ) goto ecdh_calc_secret; mbedtls_ecdh_enable_restart( &ssl->handshake->ecdh_ctx ); @@ -2973,7 +2973,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) if( ssl->handshake->ecrs_enabled ) { ssl->handshake->ecrs_n = n; - ssl->handshake->ecrs_state = ssl_ecrs_ske_ecdh_calc_secret; + ssl->handshake->ecrs_state = ssl_ecrs_cke_ecdh_calc_secret; } ecdh_calc_secret: