Skip to content

Commit

Permalink
drivers: crypto: remove assertions on device handlers
Browse files Browse the repository at this point in the history
Remove assertions added by the commit referred below. They are useless
since the handlers are registered only if the related device (stm32_cryp
or stm32_saes) has its driver successfully probed. These assertion also
prevent enabling both CFG_STM32_SAES and CFG_STM32_CRYP for a platform
which is a valid configuration for when we rely on the DT to state
which of both is enabled.

Fixes: 03de2c7 ("drivers: crypto: stm32_saes: fallback to software on 192bit AES keys")
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
  • Loading branch information
etienne-lms authored and jforissier committed May 24, 2024
1 parent ae9b419 commit 899362a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions core/drivers/crypto/stm32/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ static TEE_Result cryp_update(union ip_ctx *ip_ctx, bool last_block,

static void cryp_copy_state(union ip_ctx *dst_ip_ctx, union ip_ctx *src_ip_ctx)
{
assert(IS_ENABLED(CFG_STM32_CRYP));

memcpy(&dst_ip_ctx->cryp, &src_ip_ctx->cryp, sizeof(dst_ip_ctx->cryp));
}

Expand Down Expand Up @@ -167,8 +165,6 @@ static void saes_final(union ip_ctx *ip_ctx)
{
struct crypto_cipher_ctx *ctx = ip_ctx->saes.fallback_ctx;

assert(IS_ENABLED(CFG_STM32_SAES));

if (ip_ctx->saes.use_fallback) {
assert(IS_ENABLED(CFG_STM32_SAES_SW_FALLBACK));
ctx->ops->final(ctx);
Expand All @@ -180,8 +176,6 @@ static void saes_copy_state(union ip_ctx *dst_ip_ctx, union ip_ctx *src_ip_ctx)
struct saes_ctx *src_ctx = &src_ip_ctx->saes;
struct crypto_cipher_ctx *fb_ctx = src_ctx->fallback_ctx;

assert(IS_ENABLED(CFG_STM32_SAES));

memcpy(&dst_ip_ctx->saes.ctx, &src_ctx->ctx, sizeof(src_ctx->ctx));

dst_ip_ctx->saes.algo = src_ctx->algo;
Expand Down

0 comments on commit 899362a

Please sign in to comment.