Add missing validation code in CCM
This commit is contained in:
parent
ff8a0989c8
commit
f712534801
1 changed files with 7 additions and 0 deletions
|
@ -397,6 +397,13 @@ int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
|
||||||
const unsigned char *input, unsigned char *output,
|
const unsigned char *input, unsigned char *output,
|
||||||
const unsigned char *tag, size_t tag_len )
|
const unsigned char *tag, size_t tag_len )
|
||||||
{
|
{
|
||||||
|
CCM_VALIDATE_RET( ctx != NULL );
|
||||||
|
CCM_VALIDATE_RET( iv != NULL );
|
||||||
|
CCM_VALIDATE_RET( add_len == 0 || add != NULL );
|
||||||
|
CCM_VALIDATE_RET( length == 0 || input != NULL );
|
||||||
|
CCM_VALIDATE_RET( length == 0 || output != NULL );
|
||||||
|
CCM_VALIDATE_RET( tag != NULL );
|
||||||
|
|
||||||
if( tag_len == 0 )
|
if( tag_len == 0 )
|
||||||
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue