From 030277ab1e535a5f5a55327c35dc02e111d7f1a8 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Tue, 17 Apr 2012 12:24:26 +0000 Subject: [PATCH] - Updated error.c to include GCM errors --- library/error.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/error.c b/library/error.c index 195ae2056..471910d63 100644 --- a/library/error.c +++ b/library/error.c @@ -63,6 +63,10 @@ #include "polarssl/entropy.h" #endif +#if defined(POLARSSL_GCM_C) +#include "polarssl/gcm.h" +#endif + #if defined(POLARSSL_MD_C) #include "polarssl/md.h" #endif @@ -440,6 +444,11 @@ void error_strerror( int ret, char *buf, size_t buflen ) snprintf( buf, buflen, "ENTROPY - No sources have been added to poll" ); #endif /* POLARSSL_ENTROPY_C */ +#if defined(POLARSSL_GCM_C) + if( use_ret == -(POLARSSL_ERR_GCM_AUTH_FAILED) ) + snprintf( buf, buflen, "GCM - Authenticated decryption failed" ); +#endif /* POLARSSL_GCM_C */ + #if defined(POLARSSL_MD2_C) if( use_ret == -(POLARSSL_ERR_MD2_FILE_IO_ERROR) ) snprintf( buf, buflen, "MD2 - Read/write error in file" );