mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-07 13:22:46 +00:00
Rename psa_hmac to psa_hmac_key in mbedtls_ssl_cookie_ctx
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
parent
c0db7623ec
commit
488a40eecb
@ -56,7 +56,7 @@ extern "C" {
|
|||||||
typedef struct mbedtls_ssl_cookie_ctx
|
typedef struct mbedtls_ssl_cookie_ctx
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#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 */
|
psa_algorithm_t MBEDTLS_PRIVATE(psa_hmac_alg); /*!< key algorithm for the HMAC portion */
|
||||||
#else
|
#else
|
||||||
mbedtls_md_context_t MBEDTLS_PRIVATE(hmac_ctx); /*!< context for the HMAC portion */
|
mbedtls_md_context_t MBEDTLS_PRIVATE(hmac_ctx); /*!< context for the HMAC portion */
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx )
|
void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
ctx->psa_hmac = MBEDTLS_SVC_KEY_ID_INIT;
|
ctx->psa_hmac_key = MBEDTLS_SVC_KEY_ID_INIT;
|
||||||
#else
|
#else
|
||||||
mbedtls_md_init( &ctx->hmac_ctx );
|
mbedtls_md_init( &ctx->hmac_ctx );
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#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 )
|
void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
psa_destroy_key( ctx->psa_hmac );
|
psa_destroy_key( ctx->psa_hmac_key );
|
||||||
#else
|
#else
|
||||||
mbedtls_md_free( &ctx->hmac_ctx );
|
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 ) );
|
psa_set_key_bits( &attributes, PSA_BYTES_TO_BITS( COOKIE_MD_OUTLEN ) );
|
||||||
|
|
||||||
if( ( status = psa_generate_key( &attributes,
|
if( ( status = psa_generate_key( &attributes,
|
||||||
&ctx->psa_hmac ) ) != PSA_SUCCESS )
|
&ctx->psa_hmac_key ) ) != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
return psa_ssl_status_to_mbedtls( status );
|
return psa_ssl_status_to_mbedtls( status );
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ int mbedtls_ssl_cookie_write( void *p_ctx,
|
|||||||
*p += 4;
|
*p += 4;
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#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 );
|
ctx->psa_hmac_alg );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
@ -298,7 +298,7 @@ int mbedtls_ssl_cookie_check( void *p_ctx,
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#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 );
|
ctx->psa_hmac_alg );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user