From 488a40eecb22719ff17500ccef3d7fb487144516 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Tue, 22 Mar 2022 10:41:38 +0100 Subject: [PATCH] Rename psa_hmac to psa_hmac_key in mbedtls_ssl_cookie_ctx Signed-off-by: Neil Armstrong --- include/mbedtls/ssl_cookie.h | 2 +- library/ssl_cookie.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/mbedtls/ssl_cookie.h b/include/mbedtls/ssl_cookie.h index 4da3923058..c5b80d936e 100644 --- a/include/mbedtls/ssl_cookie.h +++ b/include/mbedtls/ssl_cookie.h @@ -56,7 +56,7 @@ extern "C" { typedef struct mbedtls_ssl_cookie_ctx { #if defined(MBEDTLS_USE_PSA_CRYPTO) - mbedtls_svc_key_id_t MBEDTLS_PRIVATE(psa_hmac); /*!< key id for the HMAC portion */ + mbedtls_svc_key_id_t MBEDTLS_PRIVATE(psa_hmac_key); /*!< key id for the HMAC portion */ psa_algorithm_t MBEDTLS_PRIVATE(psa_hmac_alg); /*!< key algorithm for the HMAC portion */ #else mbedtls_md_context_t MBEDTLS_PRIVATE(hmac_ctx); /*!< context for the HMAC portion */ diff --git a/library/ssl_cookie.c b/library/ssl_cookie.c index 8b59da7a7d..3be4b45d41 100644 --- a/library/ssl_cookie.c +++ b/library/ssl_cookie.c @@ -69,7 +69,7 @@ void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ) { #if defined(MBEDTLS_USE_PSA_CRYPTO) - ctx->psa_hmac = MBEDTLS_SVC_KEY_ID_INIT; + ctx->psa_hmac_key = MBEDTLS_SVC_KEY_ID_INIT; #else mbedtls_md_init( &ctx->hmac_ctx ); #endif /* MBEDTLS_USE_PSA_CRYPTO */ @@ -93,7 +93,7 @@ void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ) { #if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_destroy_key( ctx->psa_hmac ); + psa_destroy_key( ctx->psa_hmac_key ); #else mbedtls_md_free( &ctx->hmac_ctx ); @@ -131,7 +131,7 @@ int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, psa_set_key_bits( &attributes, PSA_BYTES_TO_BITS( COOKIE_MD_OUTLEN ) ); if( ( status = psa_generate_key( &attributes, - &ctx->psa_hmac ) ) != PSA_SUCCESS ) + &ctx->psa_hmac_key ) ) != PSA_SUCCESS ) { return psa_ssl_status_to_mbedtls( status ); } @@ -215,7 +215,7 @@ int mbedtls_ssl_cookie_write( void *p_ctx, *p += 4; #if defined(MBEDTLS_USE_PSA_CRYPTO) - status = psa_mac_sign_setup( &operation, ctx->psa_hmac, + status = psa_mac_sign_setup( &operation, ctx->psa_hmac_key, ctx->psa_hmac_alg ); if( status != PSA_SUCCESS ) { @@ -298,7 +298,7 @@ int mbedtls_ssl_cookie_check( void *p_ctx, return( -1 ); #if defined(MBEDTLS_USE_PSA_CRYPTO) - status = psa_mac_verify_setup( &operation, ctx->psa_hmac, + status = psa_mac_verify_setup( &operation, ctx->psa_hmac_key, ctx->psa_hmac_alg ); if( status != PSA_SUCCESS ) {