From 6b7301c8722e9fce24f1e17e3b716d15cca618d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 15 Aug 2017 12:08:45 +0200 Subject: [PATCH] Change restart context type. No need to have both x509 and ecdsa, as the former contains the later. --- include/mbedtls/ssl_internal.h | 2 +- library/ssl_cli.c | 4 ++-- library/ssl_tls.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index bc38b8b03..00a8db44e 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -228,7 +228,7 @@ struct mbedtls_ssl_handshake_params #endif /* MBEDTLS_X509_CRT_PARSE_C */ #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) int ecrs_enabled; /*!< Handshake supports EC restart? */ - mbedtls_ecdsa_restart_ctx ecrs_ctx; /*!< ECDSA restart context */ + mbedtls_x509_crt_restart_ctx ecrs_ctx; /*!< restart context */ enum { ssl_ecrs_init = 0, /*!< just getting started */ ssl_ecrs_ske_read, /*!< ServerKeyExchange was read */ diff --git a/library/ssl_cli.c b/library/ssl_cli.c index db57713a6..7ffeb5bb4 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -2615,7 +2615,7 @@ ske_process: #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) if( ssl->handshake->ecrs_enabled ) - rs_ctx = &ssl->handshake->ecrs_ctx; + rs_ctx = &ssl->handshake->ecrs_ctx.ecdsa; #endif if( ( ret = mbedtls_pk_verify_restartable( @@ -3290,7 +3290,7 @@ keys_derived: #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) if( ssl->handshake->ecrs_enabled ) - rs_ctx = &ssl->handshake->ecrs_ctx; + rs_ctx = &ssl->handshake->ecrs_ctx.ecdsa; #endif if( ( ret = mbedtls_pk_sign_restartable( mbedtls_ssl_own_key( ssl ), diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 90331efa1..221071b5e 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5473,7 +5473,7 @@ static void ssl_handshake_params_init( mbedtls_ssl_handshake_params *handshake ) #endif #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) - mbedtls_ecdsa_restart_init( &handshake->ecrs_ctx ); + mbedtls_x509_crt_restart_init( &handshake->ecrs_ctx ); #endif #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) @@ -7309,7 +7309,7 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_handshake_params *handshake ) #endif /* MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_SSL_SERVER_NAME_INDICATION */ #if defined(MBEDTLS_SSL__ECP_RESTARTABLE) - mbedtls_ecdsa_restart_free( &handshake->ecrs_ctx ); + mbedtls_x509_crt_restart_free( &handshake->ecrs_ctx ); #endif #if defined(MBEDTLS_SSL_PROTO_DTLS)