1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Adapt programs to the new NET API

This commit is contained in:
Manuel Pégourié-Gonnard
2015-06-30 15:40:39 +02:00
parent 91895853ac
commit 5db64328ab
14 changed files with 141 additions and 132 deletions

View File

@ -78,7 +78,8 @@ static void my_debug( void *ctx, int level,
int main( void )
{
int ret, len, server_fd = -1;
int ret, len;
mbedtls_net_context server_fd;
uint32_t flags;
unsigned char buf[1024];
const char *pers = "ssl_client1";
@ -96,6 +97,7 @@ int main( void )
/*
* 0. Initialize the RNG and the session data
*/
mbedtls_net_init( &server_fd );
mbedtls_ssl_init( &ssl );
mbedtls_ssl_config_init( &conf );
mbedtls_x509_crt_init( &cacert );
@ -288,8 +290,7 @@ exit:
}
#endif
if( server_fd != -1 )
mbedtls_net_close( server_fd );
mbedtls_net_close( &server_fd );
mbedtls_x509_crt_free( &cacert );
mbedtls_ssl_free( &ssl );