diff --git a/include/mbedtls/ssl_cookie.h b/include/mbedtls/ssl_cookie.h index 4da392305..c5b80d936 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 8b59da7a7..3be4b45d4 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 ) {