mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08: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:
parent
8b50733a73
commit
e8a2499d4e
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user