1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Replace BAD_SEQUENCE error with BAD_INPUT

Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
Mateusz Starzyk
2021-09-01 13:26:44 +02:00
parent e40ae6bbed
commit 7251eda6ff
3 changed files with 7 additions and 9 deletions

View File

@ -270,7 +270,7 @@ int mbedtls_ccm_update_ad( mbedtls_ccm_context *ctx,
{
if( ctx->state & CCM_STATE__AUTH_DATA_FINISHED )
{
return MBEDTLS_ERR_CCM_BAD_SEQUENCE;
return MBEDTLS_ERR_CCM_BAD_INPUT;
}
if( !(ctx->state & CCM_STATE__AUTH_DATA_STARTED) )
@ -444,12 +444,12 @@ int mbedtls_ccm_finish( mbedtls_ccm_context *ctx,
if( ctx->add_len > 0 && !( ctx->state & CCM_STATE__AUTH_DATA_FINISHED ) )
{
return MBEDTLS_ERR_CCM_BAD_SEQUENCE;
return MBEDTLS_ERR_CCM_BAD_INPUT;
}
if( ctx->plaintext_len > 0 && ctx->processed != ctx->plaintext_len )
{
return MBEDTLS_ERR_CCM_BAD_SEQUENCE;
return MBEDTLS_ERR_CCM_BAD_INPUT;
}
/*