From b55f5789827e825a05b8df4ba01ee8313321a5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sat, 18 Jan 2014 18:49:32 +0100 Subject: [PATCH] Fix missing error checking in gcm --- library/gcm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/gcm.c b/library/gcm.c index 60dc0cd0a..ba42fd064 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -309,9 +309,15 @@ int gcm_auth_decrypt( gcm_context *ctx, const unsigned char *input, unsigned char *output ) { + int ret; unsigned char check_tag[16]; - 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 ); + } if( memcmp( check_tag, tag, tag_len ) == 0 ) return( 0 );