Return BAD_INPUT error for CCM context's erroneous state
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
parent
7251eda6ff
commit
64f0b5f454
1 changed files with 2 additions and 2 deletions
|
@ -263,7 +263,7 @@ int mbedtls_ccm_update_ad( mbedtls_ccm_context *ctx,
|
|||
|
||||
if( ctx->state & CCM_STATE__ERROR )
|
||||
{
|
||||
return ret;
|
||||
return MBEDTLS_ERR_CCM_BAD_INPUT;
|
||||
}
|
||||
|
||||
if( ctx->add_len > 0 && add_len > 0 )
|
||||
|
@ -339,7 +339,7 @@ int mbedtls_ccm_update( mbedtls_ccm_context *ctx,
|
|||
|
||||
if( ctx->state & CCM_STATE__ERROR )
|
||||
{
|
||||
return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
return MBEDTLS_ERR_CCM_BAD_INPUT;
|
||||
}
|
||||
|
||||
if( ctx->processed + input_len > ctx->plaintext_len )
|
||||
|
|
Loading…
Reference in a new issue