Fix ret code in aescrypt2.c

This commit is contained in:
Andres Amaya Garcia 2018-04-29 19:01:34 +01:00
parent 4ed3880a10
commit 388c1b124e

View file

@ -29,9 +29,12 @@
#include "mbedtls/platform.h"
#else
#include <stdio.h>
#include <stdlib.h>
#define mbedtls_fprintf fprintf
#define mbedtls_printf printf
#endif
#define MBEDTLS_EXTI_SUCCESS EXIT_SUCCESS
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
#endif /* MBEDTLS_PLATFORM_C */
#include "mbedtls/aes.h"
#include "mbedtls/md.h"
@ -71,7 +74,8 @@ int main( void )
#else
int main( int argc, char *argv[] )
{
int ret = 1;
int ret = 0;
int exit_code = MBEDTLS_EXIT_FAILURE;
unsigned int i, n;
int mode, lastn;
@ -429,7 +433,7 @@ int main( int argc, char *argv[] )
}
}
ret = 0;
exit_code = MBEDTLS_EXIT_SUCCESS;
exit:
if( fin )
@ -452,6 +456,6 @@ exit:
mbedtls_aes_free( &aes_ctx );
mbedtls_md_free( &sha_ctx );
return( ret );
return( exit_code );
}
#endif /* MBEDTLS_AES_C && MBEDTLS_SHA256_C && MBEDTLS_FS_IO */