mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 16:44:19 +01:00
Fix ret code in dh_genprime.c
This commit is contained in:
parent
f842345ac3
commit
74c51e6e64
@ -30,9 +30,11 @@
|
|||||||
#else
|
#else
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define mbedtls_printf printf
|
#define mbedtls_printf printf
|
||||||
#define mbedtls_time_t time_t
|
#define mbedtls_time_t time_t
|
||||||
#endif
|
#define MBEDTLS_EXTI_SUCCESS EXIT_SUCCESS
|
||||||
|
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||||
|
#endif /* MBEDTLS_PLATFORM_C */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \
|
#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \
|
||||||
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_CTR_DRBG_C) || \
|
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_CTR_DRBG_C) || \
|
||||||
@ -69,6 +71,7 @@ int main( void )
|
|||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||||
mbedtls_mpi G, P, Q;
|
mbedtls_mpi G, P, Q;
|
||||||
mbedtls_entropy_context entropy;
|
mbedtls_entropy_context entropy;
|
||||||
mbedtls_ctr_drbg_context ctr_drbg;
|
mbedtls_ctr_drbg_context ctr_drbg;
|
||||||
@ -86,7 +89,7 @@ int main( int argc, char **argv )
|
|||||||
{
|
{
|
||||||
usage:
|
usage:
|
||||||
mbedtls_printf( USAGE );
|
mbedtls_printf( USAGE );
|
||||||
return( 1 );
|
return( exit_code );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = 1; i < argc; i++ )
|
for( i = 1; i < argc; i++ )
|
||||||
@ -164,7 +167,6 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
if( ( fout = fopen( "dh_prime.txt", "wb+" ) ) == NULL )
|
if( ( fout = fopen( "dh_prime.txt", "wb+" ) ) == NULL )
|
||||||
{
|
{
|
||||||
ret = 1;
|
|
||||||
mbedtls_printf( " failed\n ! Could not create dh_prime.txt\n\n" );
|
mbedtls_printf( " failed\n ! Could not create dh_prime.txt\n\n" );
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@ -180,6 +182,8 @@ int main( int argc, char **argv )
|
|||||||
mbedtls_printf( " ok\n\n" );
|
mbedtls_printf( " ok\n\n" );
|
||||||
fclose( fout );
|
fclose( fout );
|
||||||
|
|
||||||
|
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
mbedtls_mpi_free( &G ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q );
|
mbedtls_mpi_free( &G ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q );
|
||||||
@ -191,7 +195,7 @@ exit:
|
|||||||
fflush( stdout ); getchar();
|
fflush( stdout ); getchar();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return( ret );
|
return( exit_code );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_FS_IO &&
|
#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_FS_IO &&
|
||||||
MBEDTLS_CTR_DRBG_C && MBEDTLS_GENPRIME */
|
MBEDTLS_CTR_DRBG_C && MBEDTLS_GENPRIME */
|
||||||
|
Loading…
Reference in New Issue
Block a user