Lines Matching refs:ssl
167 static int do_handshake( mbedtls_ssl_context *ssl ) in do_handshake() argument
180 while( ( ret = mbedtls_ssl_handshake( ssl ) ) != 0 ) in do_handshake()
193 mbedtls_ssl_get_ciphersuite( ssl ) ); in do_handshake()
201 if( ( flags = mbedtls_ssl_get_verify_result( ssl ) ) != 0 ) in do_handshake()
216 mbedtls_ssl_get_peer_cert( ssl ) ); in do_handshake()
222 static int write_ssl_data( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_data() argument
227 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_data()
239 static int write_ssl_and_get_response( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_and_get_response() argument
247 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_and_get_response()
260 ret = mbedtls_ssl_read( ssl, data, len ); in write_ssl_and_get_response()
360 mbedtls_ssl_context ssl; in main() local
374 mbedtls_ssl_init( &ssl ); in main()
612 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main()
618 if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) in main()
624 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main()
630 if( do_handshake( &ssl ) != 0 ) in main()
636 ret = write_ssl_and_get_response( &ssl, buf, 0 ); in main()
650 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
699 if( do_handshake( &ssl ) != 0 ) in main()
710 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
730 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
750 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
765 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
778 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
791 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
808 ret = write_ssl_data( &ssl, buf, len ); in main()
811 ret = write_ssl_and_get_response( &ssl, buf, len ); in main()
820 mbedtls_ssl_close_notify( &ssl ); in main()
828 mbedtls_ssl_free( &ssl ); in main()