mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 19:58:22 +00:00
Fix missing error checking in gcm
This commit is contained in:
parent
280f95bd00
commit
073f0fa2fb
1 changed files with 7 additions and 1 deletions
|
@ -439,11 +439,17 @@ int gcm_auth_decrypt( gcm_context *ctx,
|
|||
const unsigned char *input,
|
||||
unsigned char *output )
|
||||
{
|
||||
int ret;
|
||||
unsigned char check_tag[16];
|
||||
size_t i;
|
||||
int diff;
|
||||
|
||||
gcm_crypt_and_tag( ctx, GCM_DECRYPT, length, iv, iv_len, add, add_len, input, output, tag_len, check_tag );
|
||||
if( ( ret = gcm_crypt_and_tag( ctx, GCM_DECRYPT, length,
|
||||
iv, iv_len, add, add_len,
|
||||
input, output, tag_len, check_tag ) ) != 0 )
|
||||
{
|
||||
return( ret );
|
||||
}
|
||||
|
||||
/* Check tag in "constant-time" */
|
||||
for( diff = 0, i = 0; i < tag_len; i++ )
|
||||
|
|
Loading…
Reference in a new issue