diff --git a/programs/aes/crypt_and_hash.c b/programs/aes/crypt_and_hash.c index 0e272ebe4..9e234e672 100644 --- a/programs/aes/crypt_and_hash.c +++ b/programs/aes/crypt_and_hash.c @@ -30,9 +30,12 @@ #include "mbedtls/platform.h" #else #include -#define mbedtls_fprintf fprintf -#define mbedtls_printf printf -#endif +#include +#define mbedtls_fprintf fprintf +#define mbedtls_printf printf +#define MBEDTLS_EXTI_SUCCESS EXIT_SUCCESS +#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE +#endif /* MBEDTLS_PLATFORM_C */ #if defined(MBEDTLS_CIPHER_C) && defined(MBEDTLS_MD_C) && \ defined(MBEDTLS_FS_IO) @@ -74,6 +77,7 @@ int main( void ) int main( int argc, char *argv[] ) { int ret = 1, i, n; + int exit_code = MBEDTLS_EXIT_FAILURE; int mode; size_t keylen, ilen, olen; FILE *fkey, *fin = NULL, *fout = NULL; @@ -526,7 +530,7 @@ int main( int argc, char *argv[] ) } } - ret = 0; + exit_code = MBEDTLS_EXIT_SUCCESS; exit: if( fin ) @@ -549,6 +553,6 @@ exit: mbedtls_cipher_free( &cipher_ctx ); mbedtls_md_free( &md_ctx ); - return( ret ); + return( exit_code ); } #endif /* MBEDTLS_CIPHER_C && MBEDTLS_MD_C && MBEDTLS_FS_IO */