From e8a2499d4ebcbcf1844c937283772a1a4cc5c20c Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Thu, 12 Mar 2026 09:40:16 +0000 Subject: [PATCH] ccm: Fixed a missing error flag assertion. In ccm_calculate_first_block_if_ready when using ccm tag_len==0 is invalid. When it fails, it will now also assert the CCM_STATE__ERROR in the state machine's context. Signed-off-by: Minos Galanakis --- library/ccm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/library/ccm.c b/library/ccm.c index 11d1051e98..6a4fbb0a0f 100644 --- a/library/ccm.c +++ b/library/ccm.c @@ -177,6 +177,7 @@ static int ccm_calculate_first_block_if_ready(mbedtls_ccm_context *ctx) ctx->plaintext_len = 0; return 0; } else { + ctx->state |= CCM_STATE__ERROR; return MBEDTLS_ERR_CCM_BAD_INPUT; } }