From 849a1abfddc06609aa888624413776da96178c47 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 13 Dec 2023 16:34:07 +0100 Subject: [PATCH] block_cipher: remove useless use of psa_cipher_operation_t Signed-off-by: Valerio Setti --- include/mbedtls/block_cipher.h | 3 +-- library/block_cipher.c | 9 +-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/mbedtls/block_cipher.h b/include/mbedtls/block_cipher.h index d76d860eaa..535412a857 100644 --- a/include/mbedtls/block_cipher.h +++ b/include/mbedtls/block_cipher.h @@ -25,7 +25,7 @@ #endif #if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA) -#include "psa/crypto.h" +#include "psa/crypto_types.h" #endif #ifdef __cplusplus @@ -53,7 +53,6 @@ typedef struct { mbedtls_block_cipher_id_t MBEDTLS_PRIVATE(id); #if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA) mbedtls_block_cipher_engine_t engine; - psa_cipher_operation_t psa_operation; psa_key_type_t psa_key_type; mbedtls_svc_key_id_t psa_key_id; #endif diff --git a/library/block_cipher.c b/library/block_cipher.c index 0fd78abdbd..fb09374c83 100644 --- a/library/block_cipher.c +++ b/library/block_cipher.c @@ -12,8 +12,8 @@ #include "common.h" #if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA) -#include "psa_crypto_core.h" #include "psa/crypto.h" +#include "psa_crypto_core.h" #include "psa_util_internal.h" #endif @@ -53,7 +53,6 @@ void mbedtls_block_cipher_free(mbedtls_block_cipher_context_t *ctx) { #if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA) if (ctx->engine == MBEDTLS_BLOCK_CIPHER_ENGINE_PSA) { - psa_cipher_abort(&ctx->psa_operation); psa_destroy_key(ctx->psa_key_id); return; } @@ -138,12 +137,6 @@ int mbedtls_block_cipher_setkey(mbedtls_block_cipher_context_t *ctx, } psa_reset_key_attributes(&key_attr); - status = psa_cipher_encrypt_setup(&ctx->psa_operation, ctx->psa_key_id, - PSA_ALG_ECB_NO_PADDING); - if (status != PSA_SUCCESS) { - return mbedtls_cipher_error_from_psa(status); - } - return 0; } #endif /* MBEDTLS_BLOCK_CIPHER_SOME_PSA */