mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-06 20:46:32 +02:00
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 <minos.galanakis@arm.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user