mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-26 11:21:03 +00:00
Fix ret code in ssl_client1.c
This commit is contained in:
parent
ac0e3e7b11
commit
bc1af79add
|
@ -30,11 +30,13 @@
|
||||||
#else
|
#else
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define mbedtls_time time
|
#define mbedtls_time time
|
||||||
#define mbedtls_time_t time_t
|
#define mbedtls_time_t time_t
|
||||||
#define mbedtls_fprintf fprintf
|
#define mbedtls_fprintf fprintf
|
||||||
#define mbedtls_printf printf
|
#define mbedtls_printf printf
|
||||||
#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_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \
|
!defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \
|
||||||
|
@ -80,7 +82,8 @@ static void my_debug( void *ctx, int level,
|
||||||
|
|
||||||
int main( void )
|
int main( void )
|
||||||
{
|
{
|
||||||
int ret, len;
|
int ret = 1, len;
|
||||||
|
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||||
mbedtls_net_context server_fd;
|
mbedtls_net_context server_fd;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
unsigned char buf[1024];
|
unsigned char buf[1024];
|
||||||
|
@ -281,10 +284,12 @@ int main( void )
|
||||||
|
|
||||||
mbedtls_ssl_close_notify( &ssl );
|
mbedtls_ssl_close_notify( &ssl );
|
||||||
|
|
||||||
|
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
#ifdef MBEDTLS_ERROR_C
|
#ifdef MBEDTLS_ERROR_C
|
||||||
if( ret != 0 )
|
if( exit_code != MBEDTLS_EXIT_SUCCESS )
|
||||||
{
|
{
|
||||||
char error_buf[100];
|
char error_buf[100];
|
||||||
mbedtls_strerror( ret, error_buf, 100 );
|
mbedtls_strerror( ret, error_buf, 100 );
|
||||||
|
@ -305,7 +310,7 @@ exit:
|
||||||
fflush( stdout ); getchar();
|
fflush( stdout ); getchar();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return( ret );
|
return( exit_code );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C &&
|
#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C &&
|
||||||
MBEDTLS_SSL_CLI_C && MBEDTLS_NET_C && MBEDTLS_RSA_C &&
|
MBEDTLS_SSL_CLI_C && MBEDTLS_NET_C && MBEDTLS_RSA_C &&
|
||||||
|
|
Loading…
Reference in a new issue