Clean up existing SSL restartable ECC code

- more consistent naming with ecrs prefix for everything
- always check it enabled before touching the rest
- rm duplicated code in parse_server_hello()
This commit is contained in:
Manuel Pégourié-Gonnard 2017-08-15 11:49:08 +02:00
parent 8b59049407
commit d27d1a5a82
3 changed files with 40 additions and 31 deletions

View file

@ -227,8 +227,8 @@ struct mbedtls_ssl_handshake_params
#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */
#endif /* MBEDTLS_X509_CRT_PARSE_C */
#if defined(MBEDTLS_SSL__ECP_RESTARTABLE)
int ec_restart_enabled; /*!< Handshake supports EC restart? */
mbedtls_ecdsa_restart_ctx rs_ctx; /*!< ECDSA restart context */
int ecrs_enabled; /*!< Handshake supports EC restart? */
mbedtls_ecdsa_restart_ctx ecrs_ctx; /*!< ECDSA restart context */
enum {
ssl_ecrs_init = 0, /*!< just getting started */
ssl_ecrs_ske_read, /*!< ServerKeyExchange was read */