/net-tools-3.5.0/mbedtls-2.4.0/library/ |
D | ssl_tls.c | 62 static inline size_t ssl_ep_len( const mbedtls_ssl_context *ssl ) in ssl_ep_len() argument 65 if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) in ssl_ep_len() 68 ((void) ssl); in ssl_ep_len() 77 static void ssl_set_timer( mbedtls_ssl_context *ssl, uint32_t millisecs ) in ssl_set_timer() argument 79 if( ssl->f_set_timer == NULL ) in ssl_set_timer() 83 ssl->f_set_timer( ssl->p_timer, millisecs / 4, millisecs ); in ssl_set_timer() 89 static int ssl_check_timer( mbedtls_ssl_context *ssl ) in ssl_check_timer() argument 91 if( ssl->f_get_timer == NULL ) in ssl_check_timer() 94 if( ssl->f_get_timer( ssl->p_timer ) == 2 ) in ssl_check_timer() 108 static int ssl_double_retransmit_timeout( mbedtls_ssl_context *ssl ) in ssl_double_retransmit_timeout() argument [all …]
|
D | ssl_cli.c | 58 static void ssl_write_hostname_ext( mbedtls_ssl_context *ssl, in ssl_write_hostname_ext() argument 63 const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_MAX_CONTENT_LEN; in ssl_write_hostname_ext() 68 if( ssl->hostname == NULL ) in ssl_write_hostname_ext() 72 ssl->hostname ) ); in ssl_write_hostname_ext() 74 hostname_len = strlen( ssl->hostname ); in ssl_write_hostname_ext() 113 memcpy( p, ssl->hostname, hostname_len ); in ssl_write_hostname_ext() 120 static void ssl_write_renegotiation_ext( mbedtls_ssl_context *ssl, in ssl_write_renegotiation_ext() argument 125 const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_MAX_CONTENT_LEN; in ssl_write_renegotiation_ext() 129 if( ssl->renego_status != MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS ) in ssl_write_renegotiation_ext() 134 if( end < p || (size_t)( end - p ) < 5 + ssl->verify_data_len ) in ssl_write_renegotiation_ext() [all …]
|
D | ssl_srv.c | 60 int mbedtls_ssl_set_client_transport_id( mbedtls_ssl_context *ssl, in mbedtls_ssl_set_client_transport_id() argument 64 if( ssl->conf->endpoint != MBEDTLS_SSL_IS_SERVER ) in mbedtls_ssl_set_client_transport_id() 67 mbedtls_free( ssl->cli_id ); in mbedtls_ssl_set_client_transport_id() 69 if( ( ssl->cli_id = mbedtls_calloc( 1, ilen ) ) == NULL ) in mbedtls_ssl_set_client_transport_id() 72 memcpy( ssl->cli_id, info, ilen ); in mbedtls_ssl_set_client_transport_id() 73 ssl->cli_id_len = ilen; in mbedtls_ssl_set_client_transport_id() 90 static int ssl_parse_servername_ext( mbedtls_ssl_context *ssl, in ssl_parse_servername_ext() argument 119 ret = ssl->conf->f_sni( ssl->conf->p_sni, in ssl_parse_servername_ext() 120 ssl, p + 3, hostname_len ); in ssl_parse_servername_ext() 124 mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, in ssl_parse_servername_ext() [all …]
|
D | debug.c | 63 static inline void debug_send_line( const mbedtls_ssl_context *ssl, int level, in debug_send_line() argument 74 mbedtls_snprintf( idstr, sizeof( idstr ), "%p: %s", ssl, str ); in debug_send_line() 75 ssl->conf->f_dbg( ssl->conf->p_dbg, level, file, line, idstr ); in debug_send_line() 77 ssl->conf->f_dbg( ssl->conf->p_dbg, level, file, line, str ); in debug_send_line() 81 void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level, in mbedtls_debug_print_msg() argument 89 if( NULL == ssl || NULL == ssl->conf || NULL == ssl->conf->f_dbg || level > debug_threshold ) in mbedtls_debug_print_msg() 115 debug_send_line( ssl, level, file, line, str ); in mbedtls_debug_print_msg() 118 void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, in mbedtls_debug_print_ret() argument 124 if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || level > debug_threshold ) in mbedtls_debug_print_ret() 138 debug_send_line( ssl, level, file, line, str ); in mbedtls_debug_print_ret() [all …]
|
/net-tools-3.5.0/mbedtls-2.4.0/include/mbedtls/ |
D | ssl_internal.h | 349 int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl ); 350 int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl ); 351 void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl ); 353 int mbedtls_ssl_send_fatal_handshake_failure( mbedtls_ssl_context *ssl ); 355 void mbedtls_ssl_reset_checksum( mbedtls_ssl_context *ssl ); 356 int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl ); 358 int mbedtls_ssl_read_record_layer( mbedtls_ssl_context *ssl ); 359 int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl ); 360 int mbedtls_ssl_prepare_handshake_record( mbedtls_ssl_context *ssl ); 361 void mbedtls_ssl_update_handshake_status( mbedtls_ssl_context *ssl ); [all …]
|
D | debug.h | 43 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \ 47 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret ) 50 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len ) 54 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X ) 59 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X ) 64 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt ) 114 void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level, 133 void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, 154 void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level, 175 void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level, [all …]
|
D | ssl.h | 906 extern int (*mbedtls_ssl_hw_record_init)(mbedtls_ssl_context *ssl, 913 extern int (*mbedtls_ssl_hw_record_activate)(mbedtls_ssl_context *ssl, int direction); 914 extern int (*mbedtls_ssl_hw_record_reset)(mbedtls_ssl_context *ssl); 915 extern int (*mbedtls_ssl_hw_record_write)(mbedtls_ssl_context *ssl); 916 extern int (*mbedtls_ssl_hw_record_read)(mbedtls_ssl_context *ssl); 917 extern int (*mbedtls_ssl_hw_record_finish)(mbedtls_ssl_context *ssl); 955 void mbedtls_ssl_init( mbedtls_ssl_context *ssl ); 972 int mbedtls_ssl_setup( mbedtls_ssl_context *ssl, 985 int mbedtls_ssl_session_reset( mbedtls_ssl_context *ssl ); 1115 void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl, [all …]
|
/net-tools-3.5.0/mbedtls-2.4.0/tests/suites/ |
D | test_suite_debug.function | 53 mbedtls_ssl_context ssl; 57 mbedtls_ssl_init( &ssl ); 62 TEST_ASSERT( mbedtls_ssl_setup( &ssl, &conf ) == 0 ); 67 mbedtls_debug_print_msg( &ssl, level, file, line, 73 mbedtls_ssl_free( &ssl ); 82 mbedtls_ssl_context ssl; 86 mbedtls_ssl_init( &ssl ); 91 TEST_ASSERT( mbedtls_ssl_setup( &ssl, &conf ) == 0 ); 95 mbedtls_debug_print_ret( &ssl, 0, file, line, text, value); 100 mbedtls_ssl_free( &ssl ); [all …]
|
D | test_suite_ssl.function | 2 #include <mbedtls/ssl.h> 14 mbedtls_ssl_context ssl; 18 mbedtls_ssl_init( &ssl ); 25 TEST_ASSERT( mbedtls_ssl_setup( &ssl, &conf ) == 0 ); 31 unhexify( ssl.in_ctr + 2, prevs ); 32 mbedtls_ssl_dtls_replay_update( &ssl ); 36 unhexify( ssl.in_ctr + 2, new ); 37 TEST_ASSERT( mbedtls_ssl_dtls_replay_check( &ssl ) == ret ); 39 mbedtls_ssl_free( &ssl );
|
/net-tools-3.5.0/mbedtls-2.4.0/programs/ |
D | .gitignore | 35 ssl/dtls_client 36 ssl/dtls_server 37 ssl/ssl_client1 38 ssl/ssl_client2 39 ssl/ssl_fork_server 40 ssl/ssl_mail_client 41 ssl/ssl_pthread_server 42 ssl/ssl_server 43 ssl/ssl_server2 44 ssl/mini_client
|
D | Makefile | 61 ssl/dtls_client$(EXEXT) ssl/dtls_server$(EXEXT) \ 62 ssl/ssl_client1$(EXEXT) ssl/ssl_client2$(EXEXT) \ 63 ssl/ssl_server$(EXEXT) ssl/ssl_server2$(EXEXT) \ 64 ssl/ssl_fork_server$(EXEXT) ssl/mini_client$(EXEXT) \ 65 ssl/ssl_mail_client$(EXEXT) random/gen_entropy$(EXEXT) \ 76 APPS += ssl/ssl_pthread_server$(EXEXT) 196 ssl/dtls_client$(EXEXT): ssl/dtls_client.c $(DEP) 198 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ 200 ssl/dtls_server$(EXEXT): ssl/dtls_server.c $(DEP) 202 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ [all …]
|
/net-tools-3.5.0/mbedtls-2.4.0/programs/ssl/ |
D | dtls_client.c | 94 mbedtls_ssl_context ssl; in main() local 110 mbedtls_ssl_init( &ssl ); in main() 183 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 189 if( ( ret = mbedtls_ssl_set_hostname( &ssl, SERVER_NAME ) ) != 0 ) in main() 195 mbedtls_ssl_set_bio( &ssl, &server_fd, in main() 198 mbedtls_ssl_set_timer_cb( &ssl, &timer, mbedtls_timing_set_delay, in main() 209 do ret = mbedtls_ssl_handshake( &ssl ); in main() 229 if( ( flags = mbedtls_ssl_get_verify_result( &ssl ) ) != 0 ) in main() 251 do ret = mbedtls_ssl_write( &ssl, (unsigned char *) MESSAGE, len ); in main() 273 do ret = mbedtls_ssl_read( &ssl, buf, len ); in main() [all …]
|
D | ssl_mail_client.c | 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() [all …]
|
D | ssl_client1.c | 91 mbedtls_ssl_context ssl; in main() local 103 mbedtls_ssl_init( &ssl ); in main() 177 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 183 if( ( ret = mbedtls_ssl_set_hostname( &ssl, "mbed TLS Server 1" ) ) != 0 ) in main() 189 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main() 197 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in main() 214 if( ( flags = mbedtls_ssl_get_verify_result( &ssl ) ) != 0 ) in main() 235 while( ( ret = mbedtls_ssl_write( &ssl, buf, len ) ) <= 0 ) in main() 257 ret = mbedtls_ssl_read( &ssl, buf, len ); in main() 282 mbedtls_ssl_close_notify( &ssl ); in main() [all …]
|
D | mini_client.c | 182 mbedtls_ssl_context ssl; in main() local 190 mbedtls_ssl_init( &ssl ); in main() 231 if( mbedtls_ssl_setup( &ssl, &conf ) != 0 ) in main() 238 if( mbedtls_ssl_set_hostname( &ssl, HOSTNAME ) != 0 ) in main() 269 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main() 271 if( mbedtls_ssl_handshake( &ssl ) != 0 ) in main() 280 if( mbedtls_ssl_write( &ssl, (const unsigned char *) GET_REQUEST, in main() 287 mbedtls_ssl_close_notify( &ssl ); in main() 292 mbedtls_ssl_free( &ssl ); in main()
|
D | dtls_server.c | 104 mbedtls_ssl_context ssl; in main() local 115 mbedtls_ssl_init( &ssl ); in main() 238 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 244 mbedtls_ssl_set_timer_cb( &ssl, &timer, mbedtls_timing_set_delay, in main() 261 mbedtls_ssl_session_reset( &ssl ); in main() 277 if( ( ret = mbedtls_ssl_set_client_transport_id( &ssl, in main() 285 mbedtls_ssl_set_bio( &ssl, &client_fd, in main() 296 do ret = mbedtls_ssl_handshake( &ssl ); in main() 323 do ret = mbedtls_ssl_read( &ssl, buf, len ); in main() 355 do ret = mbedtls_ssl_write( &ssl, buf, len ); in main() [all …]
|
D | ssl_server.c | 102 mbedtls_ssl_context ssl; in main() local 112 mbedtls_ssl_init( &ssl ); in main() 224 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 244 mbedtls_ssl_session_reset( &ssl ); in main() 259 mbedtls_ssl_set_bio( &ssl, &client_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main() 269 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in main() 290 ret = mbedtls_ssl_read( &ssl, buf, len ); in main() 330 mbedtls_ssl_get_ciphersuite( &ssl ) ); in main() 332 while( ( ret = mbedtls_ssl_write( &ssl, buf, len ) ) <= 0 ) in main() 352 while( ( ret = mbedtls_ssl_close_notify( &ssl ) ) < 0 ) in main() [all …]
|
D | ssl_fork_server.c | 105 mbedtls_ssl_context ssl; in main() local 112 mbedtls_ssl_init( &ssl ); in main() 221 mbedtls_ssl_init( &ssl ); in main() 283 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 291 mbedtls_ssl_set_bio( &ssl, &client_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main() 301 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in main() 324 ret = mbedtls_ssl_read( &ssl, buf, len ); in main() 364 mbedtls_ssl_get_ciphersuite( &ssl ) ); in main() 368 while( ( ret = mbedtls_ssl_write( &ssl, buf, len ) ) <= 0 ) in main() 391 mbedtls_ssl_close_notify( &ssl ); in main() [all …]
|
D | ssl_pthread_server.c | 129 mbedtls_ssl_context ssl; in handle_ssl_connection() local 132 mbedtls_ssl_init( &ssl ); in handle_ssl_connection() 139 if( ( ret = mbedtls_ssl_setup( &ssl, thread_info->config ) ) != 0 ) in handle_ssl_connection() 146 mbedtls_ssl_set_bio( &ssl, client_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in handle_ssl_connection() 153 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in handle_ssl_connection() 174 ret = mbedtls_ssl_read( &ssl, buf, len ); in handle_ssl_connection() 215 mbedtls_ssl_get_ciphersuite( &ssl ) ); in handle_ssl_connection() 217 while( ( ret = mbedtls_ssl_write( &ssl, buf, len ) ) <= 0 ) in handle_ssl_connection() 240 while( ( ret = mbedtls_ssl_close_notify( &ssl ) ) < 0 ) in handle_ssl_connection() 268 mbedtls_ssl_free( &ssl ); in handle_ssl_connection()
|
D | ssl_client2.c | 416 mbedtls_ssl_context ssl; in main() local 435 mbedtls_ssl_init( &ssl ); in main() 1209 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 1216 if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) in main() 1226 if( ( ret = mbedtls_ssl_set_hs_ecjpake_password( &ssl, in main() 1237 mbedtls_ssl_set_bio( &ssl, &server_fd, my_send, my_recv, NULL ); in main() 1239 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, in main() 1243 mbedtls_ssl_set_timer_cb( &ssl, &timer, mbedtls_timing_set_delay, in main() 1255 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in main() 1274 mbedtls_ssl_get_version( &ssl ), mbedtls_ssl_get_ciphersuite( &ssl ) ); in main() [all …]
|
D | ssl_server2.c | 609 int sni_callback( void *p_info, mbedtls_ssl_context *ssl, in sni_callback() argument 620 mbedtls_ssl_set_hs_ca_chain( ssl, cur->ca, cur->crl ); in sni_callback() 623 mbedtls_ssl_set_hs_authmode( ssl, cur->authmode ); in sni_callback() 625 return( mbedtls_ssl_set_hs_own_cert( ssl, cur->cert, cur->key ) ); in sni_callback() 746 int psk_callback( void *p_info, mbedtls_ssl_context *ssl, in psk_callback() argument 756 return( mbedtls_ssl_set_hs_psk( ssl, cur->key, cur->key_len ) ); in psk_callback() 799 mbedtls_ssl_context ssl; in main() local 848 mbedtls_ssl_init( &ssl ); in main() 1828 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 1835 mbedtls_ssl_set_bio( &ssl, &client_fd, my_send, my_recv, NULL ); in main() [all …]
|
/net-tools-3.5.0/mbedtls-2.4.0/scripts/ |
D | memory.sh | 62 CFLAGS=$CFLAGS_EXEC make OFLAGS=-Os ssl/$CLIENT >/dev/null 63 strip ssl/$CLIENT 64 stat -c '%s' ssl/$CLIENT 72 CFLAGS=$CFLAGS_MEM make OFLAGS=-Os ssl/$CLIENT >/dev/null 79 if valgrind --tool=massif --stacks=yes programs/ssl/$CLIENT >/dev/null 2>&1 105 (cd programs && make ssl/ssl_server2) >/dev/null 106 cp programs/ssl/ssl_server2 .
|
/net-tools-3.5.0/ |
D | dtls-client.c | 345 mbedtls_ssl_context ssl; in main() local 404 mbedtls_ssl_init(&ssl); in main() 472 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main() 477 if ((ret = mbedtls_ssl_set_hostname(&ssl, HOSTNAME)) != 0) { in main() 482 mbedtls_ssl_set_bio(&ssl, &server_fd, in main() 486 mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, in main() 497 do ret = mbedtls_ssl_handshake(&ssl); in main() 516 if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) { in main() 550 do ret = mbedtls_ssl_write(&ssl, data[idx].buf, len); in main() 569 do ret = mbedtls_ssl_read(&ssl, buf, len); in main() [all …]
|
D | dtls-server.c | 115 mbedtls_ssl_context ssl; in main() local 167 mbedtls_ssl_init(&ssl); in main() 276 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main() 281 mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, in main() 297 mbedtls_ssl_session_reset(&ssl); in main() 313 if ((ret = mbedtls_ssl_set_client_transport_id(&ssl, in main() 322 mbedtls_ssl_set_bio(&ssl, &client_fd, in main() 334 do ret = mbedtls_ssl_handshake(&ssl); in main() 362 do ret = mbedtls_ssl_read(&ssl, buf, len); in main() 392 do ret = mbedtls_ssl_write(&ssl, buf, len); in main() [all …]
|
/net-tools-3.5.0/mbedtls-2.4.0/programs/x509/ |
D | cert_app.c | 153 mbedtls_ssl_context ssl; in main() local 168 mbedtls_ssl_init( &ssl ); in main() 422 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) in main() 428 if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) in main() 434 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); in main() 439 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) in main() 455 ssl.session->peer_cert ); in main() 464 mbedtls_ssl_close_notify( &ssl ); in main() 467 mbedtls_ssl_free( &ssl ); in main()
|