From f716a700a11598ad70937503dd24ce7f219aa1fc Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 4 Apr 2022 11:23:46 +0200 Subject: [PATCH] Rename mbedtls_ssl_handshake_params variable ecdh_psa_shared_key to ecdh_psa_privkey_is_external Signed-off-by: Neil Armstrong --- library/ssl_misc.h | 2 +- library/ssl_tls.c | 2 +- library/ssl_tls12_server.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/ssl_misc.h b/library/ssl_misc.h index 00f39891b..ea3fe1a32 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -632,7 +632,7 @@ struct mbedtls_ssl_handshake_params psa_key_type_t ecdh_psa_type; size_t ecdh_bits; mbedtls_svc_key_id_t ecdh_psa_privkey; - uint8_t ecdh_psa_shared_key; + uint8_t ecdh_psa_privkey_is_external; unsigned char ecdh_psa_peerkey[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH]; size_t ecdh_psa_peerkey_len; #endif /* MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_SSL_PROTO_TLS1_3 */ diff --git a/library/ssl_tls.c b/library/ssl_tls.c index cc7d7e143..95ef03241 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -3146,7 +3146,7 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl ) #if defined(MBEDTLS_ECDH_C) && \ ( defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) ) - if( handshake->ecdh_psa_shared_key == 0 ) + if( handshake->ecdh_psa_privkey_is_external == 0 ) psa_destroy_key( handshake->ecdh_psa_privkey ); #endif /* MBEDTLS_ECDH_C && MBEDTLS_USE_PSA_CRYPTO */ diff --git a/library/ssl_tls12_server.c b/library/ssl_tls12_server.c index f3e9d1494..e1e4b8a79 100644 --- a/library/ssl_tls12_server.c +++ b/library/ssl_tls12_server.c @@ -2894,7 +2894,7 @@ static int ssl_get_ecdh_params_from_cert( mbedtls_ssl_context *ssl ) psa_reset_key_attributes( &key_attributes ); /* Key should not be destroyed in the TLS library */ - ssl->handshake->ecdh_psa_shared_key = 1; + ssl->handshake->ecdh_psa_privkey_is_external = 1; ret = 0; break; @@ -3974,13 +3974,13 @@ static int ssl_parse_client_key_exchange( mbedtls_ssl_context *ssl ) { ret = psa_ssl_status_to_mbedtls( status ); MBEDTLS_SSL_DEBUG_RET( 1, "psa_raw_key_agreement", ret ); - if( handshake->ecdh_psa_shared_key == 0 ) + if( handshake->ecdh_psa_privkey_is_external == 0 ) (void) psa_destroy_key( handshake->ecdh_psa_privkey ); handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT; return( ret ); } - if( handshake->ecdh_psa_shared_key == 0 ) + if( handshake->ecdh_psa_privkey_is_external == 0 ) { status = psa_destroy_key( handshake->ecdh_psa_privkey );