/mbedtls-3.5.0/library/ |
D | ssl_tls12_server.c | 52 int mbedtls_ssl_set_client_transport_id(mbedtls_ssl_context *ssl, in mbedtls_ssl_set_client_transport_id() argument 56 if (ssl->conf->endpoint != MBEDTLS_SSL_IS_SERVER) { in mbedtls_ssl_set_client_transport_id() 60 mbedtls_free(ssl->cli_id); in mbedtls_ssl_set_client_transport_id() 62 if ((ssl->cli_id = mbedtls_calloc(1, ilen)) == NULL) { in mbedtls_ssl_set_client_transport_id() 66 memcpy(ssl->cli_id, info, ilen); in mbedtls_ssl_set_client_transport_id() 67 ssl->cli_id_len = ilen; in mbedtls_ssl_set_client_transport_id() 111 static int ssl_parse_renegotiation_info(mbedtls_ssl_context *ssl, in ssl_parse_renegotiation_info() argument 116 if (ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE) { in ssl_parse_renegotiation_info() 118 if (len != 1 + ssl->verify_data_len || in ssl_parse_renegotiation_info() 119 buf[0] != ssl->verify_data_len || in ssl_parse_renegotiation_info() [all …]
|
D | ssl_tls12_client.c | 57 static int ssl_write_renegotiation_ext(mbedtls_ssl_context *ssl, in ssl_write_renegotiation_ext() argument 69 if (ssl->renego_status != MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS) { in ssl_write_renegotiation_ext() 76 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 5 + ssl->verify_data_len); in ssl_write_renegotiation_ext() 85 *p++ = MBEDTLS_BYTE_0(ssl->verify_data_len + 1); in ssl_write_renegotiation_ext() 86 *p++ = MBEDTLS_BYTE_0(ssl->verify_data_len); in ssl_write_renegotiation_ext() 88 memcpy(p, ssl->own_verify_data, ssl->verify_data_len); in ssl_write_renegotiation_ext() 90 *olen = 5 + ssl->verify_data_len; in ssl_write_renegotiation_ext() 100 static int ssl_write_supported_point_formats_ext(mbedtls_ssl_context *ssl, in ssl_write_supported_point_formats_ext() argument 106 (void) ssl; /* ssl used for debugging only */ in ssl_write_supported_point_formats_ext() 132 static int ssl_write_ecjpake_kkpp_ext(mbedtls_ssl_context *ssl, in ssl_write_ecjpake_kkpp_ext() argument [all …]
|
D | ssl_msg.c | 57 static uint32_t ssl_get_hs_total_len(mbedtls_ssl_context const *ssl); 63 void mbedtls_ssl_set_timer(mbedtls_ssl_context *ssl, uint32_t millisecs) in mbedtls_ssl_set_timer() argument 65 if (ssl->f_set_timer == NULL) { in mbedtls_ssl_set_timer() 70 ssl->f_set_timer(ssl->p_timer, millisecs / 4, millisecs); in mbedtls_ssl_set_timer() 76 int mbedtls_ssl_check_timer(mbedtls_ssl_context *ssl) in mbedtls_ssl_check_timer() argument 78 if (ssl->f_get_timer == NULL) { in mbedtls_ssl_check_timer() 82 if (ssl->f_get_timer(ssl->p_timer) == 2) { in mbedtls_ssl_check_timer() 91 static int ssl_parse_record_header(mbedtls_ssl_context const *ssl, 96 int mbedtls_ssl_check_record(mbedtls_ssl_context const *ssl, in mbedtls_ssl_check_record() argument 107 if (ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_STREAM) { in mbedtls_ssl_check_record() [all …]
|
D | ssl_tls13_server.c | 35 mbedtls_ssl_context *ssl, in ssl_tls13_validate_peer_ciphersuite() argument 39 if (!mbedtls_ssl_tls13_cipher_suite_is_offered(ssl, cipher_suite)) { in ssl_tls13_validate_peer_ciphersuite() 44 if ((mbedtls_ssl_validate_ciphersuite(ssl, ciphersuite_info, in ssl_tls13_validate_peer_ciphersuite() 45 ssl->tls_version, in ssl_tls13_validate_peer_ciphersuite() 46 ssl->tls_version) != 0)) { in ssl_tls13_validate_peer_ciphersuite() 61 static int ssl_tls13_parse_key_exchange_modes_ext(mbedtls_ssl_context *ssl, in ssl_tls13_parse_key_exchange_modes_ext() argument 99 ssl->handshake->tls13_kex_modes = ke_modes; in ssl_tls13_parse_key_exchange_modes_ext() 110 mbedtls_ssl_context *ssl, in ssl_tls13_offered_psks_check_identity_match_ticket() argument 129 if (ssl->conf->f_ticket_parse == NULL || identity_len == 0) { in ssl_tls13_offered_psks_check_identity_match_ticket() 145 if ((ret = ssl->conf->f_ticket_parse(ssl->conf->p_ticket, in ssl_tls13_offered_psks_check_identity_match_ticket() [all …]
|
D | ssl_tls13_client.c | 51 static int ssl_tls13_write_supported_versions_ext(mbedtls_ssl_context *ssl, in ssl_tls13_write_supported_versions_ext() argument 57 unsigned char versions_len = (ssl->handshake->min_tls_version <= in ssl_tls13_write_supported_versions_ext() 88 if (ssl->handshake->min_tls_version <= MBEDTLS_SSL_VERSION_TLS1_2) { in ssl_tls13_write_supported_versions_ext() 97 ssl, MBEDTLS_TLS_EXT_SUPPORTED_VERSIONS); in ssl_tls13_write_supported_versions_ext() 103 static int ssl_tls13_parse_supported_versions_ext(mbedtls_ssl_context *ssl, in ssl_tls13_parse_supported_versions_ext() argument 107 ((void) ssl); in ssl_tls13_parse_supported_versions_ext() 110 if (mbedtls_ssl_read_version(buf, ssl->conf->transport) != in ssl_tls13_parse_supported_versions_ext() 131 static int ssl_tls13_parse_alpn_ext(mbedtls_ssl_context *ssl, in ssl_tls13_parse_alpn_ext() argument 140 if (ssl->conf->alpn_list == NULL) { in ssl_tls13_parse_alpn_ext() 166 for (const char **alpn = ssl->conf->alpn_list; *alpn != NULL; alpn++) { in ssl_tls13_parse_alpn_ext() [all …]
|
D | ssl_tls.c | 109 int mbedtls_ssl_set_cid(mbedtls_ssl_context *ssl, in mbedtls_ssl_set_cid() argument 114 if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) { in mbedtls_ssl_set_cid() 118 ssl->negotiate_cid = enable; in mbedtls_ssl_set_cid() 126 if (own_cid_len != ssl->conf->cid_len) { in mbedtls_ssl_set_cid() 129 (unsigned) ssl->conf->cid_len)); in mbedtls_ssl_set_cid() 133 memcpy(ssl->own_cid, own_cid, own_cid_len); in mbedtls_ssl_set_cid() 136 ssl->own_cid_len = (uint8_t) own_cid_len; in mbedtls_ssl_set_cid() 141 int mbedtls_ssl_get_own_cid(mbedtls_ssl_context *ssl, in mbedtls_ssl_get_own_cid() argument 148 if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) { in mbedtls_ssl_get_own_cid() 155 if (ssl->own_cid_len == 0 || ssl->negotiate_cid == MBEDTLS_SSL_CID_DISABLED) { in mbedtls_ssl_get_own_cid() [all …]
|
D | ssl_client.c | 40 static int ssl_write_hostname_ext(mbedtls_ssl_context *ssl, in ssl_write_hostname_ext() argument 50 if (ssl->hostname == NULL) { in ssl_write_hostname_ext() 56 ssl->hostname)); in ssl_write_hostname_ext() 58 hostname_len = strlen(ssl->hostname); in ssl_write_hostname_ext() 102 memcpy(p, ssl->hostname, hostname_len); in ssl_write_hostname_ext() 107 mbedtls_ssl_tls13_set_hs_sent_ext_mask(ssl, MBEDTLS_TLS_EXT_SERVERNAME); in ssl_write_hostname_ext() 128 static int ssl_write_alpn_ext(mbedtls_ssl_context *ssl, in ssl_write_alpn_ext() argument 137 if (ssl->conf->alpn_list == NULL) { in ssl_write_alpn_ext() 159 for (const char **cur = ssl->conf->alpn_list; *cur != NULL; cur++) { in ssl_write_alpn_ext() 181 mbedtls_ssl_tls13_set_hs_sent_ext_mask(ssl, MBEDTLS_TLS_EXT_ALPN); in ssl_write_alpn_ext() [all …]
|
D | ssl_tls13_generic.c | 53 int mbedtls_ssl_tls13_fetch_handshake_msg(mbedtls_ssl_context *ssl, in mbedtls_ssl_tls13_fetch_handshake_msg() argument 60 if ((ret = mbedtls_ssl_read_record(ssl, 0)) != 0) { in mbedtls_ssl_tls13_fetch_handshake_msg() 65 if (ssl->in_msgtype != MBEDTLS_SSL_MSG_HANDSHAKE || in mbedtls_ssl_tls13_fetch_handshake_msg() 66 ssl->in_msg[0] != hs_type) { in mbedtls_ssl_tls13_fetch_handshake_msg() 81 *buf = ssl->in_msg + 4; in mbedtls_ssl_tls13_fetch_handshake_msg() 82 *buf_len = ssl->in_hslen - 4; in mbedtls_ssl_tls13_fetch_handshake_msg() 161 static int ssl_tls13_parse_certificate_verify(mbedtls_ssl_context *ssl, in ssl_tls13_parse_certificate_verify() argument 207 if (!mbedtls_ssl_sig_alg_is_offered(ssl, algorithm)) { in ssl_tls13_parse_certificate_verify() 231 if (!mbedtls_pk_can_do(&ssl->session_negotiate->peer_cert->pk, sig_alg)) { in ssl_tls13_parse_certificate_verify() 263 &ssl->session_negotiate->peer_cert->pk, in ssl_tls13_parse_certificate_verify() [all …]
|
D | ssl_misc.h | 435 size_t mbedtls_ssl_get_output_max_frag_len(const mbedtls_ssl_context *ssl); 451 size_t mbedtls_ssl_get_input_max_frag_len(const mbedtls_ssl_context *ssl); 1262 int mbedtls_ssl_tls12_write_client_hello_exts(mbedtls_ssl_context *ssl, 1283 mbedtls_ssl_context *ssl, 1303 void mbedtls_ssl_handshake_free(mbedtls_ssl_context *ssl); 1306 void mbedtls_ssl_set_inbound_transform(mbedtls_ssl_context *ssl, 1310 void mbedtls_ssl_set_outbound_transform(mbedtls_ssl_context *ssl, 1314 int mbedtls_ssl_handshake_client_step(mbedtls_ssl_context *ssl); 1316 int mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl); 1317 void mbedtls_ssl_handshake_wrapup(mbedtls_ssl_context *ssl); [all …]
|
D | debug.c | 45 static inline void debug_send_line(const mbedtls_ssl_context *ssl, int level, in debug_send_line() argument 56 mbedtls_snprintf(idstr, sizeof(idstr), "%p: %s", (void *) ssl, str); in debug_send_line() 57 ssl->conf->f_dbg(ssl->conf->p_dbg, level, file, line, idstr); in debug_send_line() 59 ssl->conf->f_dbg(ssl->conf->p_dbg, level, file, line, str); in debug_send_line() 64 void mbedtls_debug_print_msg(const mbedtls_ssl_context *ssl, int level, in mbedtls_debug_print_msg() argument 72 if (NULL == ssl || in mbedtls_debug_print_msg() 73 NULL == ssl->conf || in mbedtls_debug_print_msg() 74 NULL == ssl->conf->f_dbg || in mbedtls_debug_print_msg() 88 debug_send_line(ssl, level, file, line, str); in mbedtls_debug_print_msg() 91 void mbedtls_debug_print_ret(const mbedtls_ssl_context *ssl, int level, in mbedtls_debug_print_ret() argument [all …]
|
D | ssl_tls13_keys.c | 668 static int ssl_tls13_key_schedule_stage_application(mbedtls_ssl_context *ssl) in ssl_tls13_key_schedule_stage_application() argument 671 mbedtls_ssl_handshake_params *handshake = ssl->handshake; in ssl_tls13_key_schedule_stage_application() 767 int mbedtls_ssl_tls13_calculate_verify_data(mbedtls_ssl_context *ssl, in mbedtls_ssl_tls13_calculate_verify_data() argument 781 &ssl->handshake->tls13_hs_secrets; in mbedtls_ssl_tls13_calculate_verify_data() 783 mbedtls_md_type_t const md_type = ssl->handshake->ciphersuite_info->mac; in mbedtls_ssl_tls13_calculate_verify_data() 786 ssl->handshake->ciphersuite_info->mac); in mbedtls_ssl_tls13_calculate_verify_data() 804 ret = mbedtls_ssl_get_handshake_transcript(ssl, md_type, in mbedtls_ssl_tls13_calculate_verify_data() 828 int mbedtls_ssl_tls13_create_psk_binder(mbedtls_ssl_context *ssl, in mbedtls_ssl_tls13_create_psk_binder() argument 842 ssl = NULL; /* make sure we don't use it except for debug */ in mbedtls_ssl_tls13_create_psk_binder() 843 ((void) ssl); in mbedtls_ssl_tls13_create_psk_binder() [all …]
|
/mbedtls-3.5.0/programs/ssl/ |
D | ssl_context_info.c | 107 if (end - ssl < (int) (LEN)) \ 459 void print_deserialized_ssl_cert(const uint8_t *ssl, uint32_t len) in print_deserialized_ssl_cert() argument 469 ret = mbedtls_x509_crt_parse_der(&crt, ssl, len); in print_deserialized_ssl_cert() 474 print_hex(ssl, len, 25, "\t"); in print_deserialized_ssl_cert() 525 void print_deserialized_ssl_session(const uint8_t *ssl, uint32_t len, in print_deserialized_ssl_session() argument 532 const uint8_t *end = ssl + len; in print_deserialized_ssl_session() 539 start = ((uint64_t) ssl[0] << 56) | in print_deserialized_ssl_session() 540 ((uint64_t) ssl[1] << 48) | in print_deserialized_ssl_session() 541 ((uint64_t) ssl[2] << 40) | in print_deserialized_ssl_session() 542 ((uint64_t) ssl[3] << 32) | in print_deserialized_ssl_session() [all …]
|
D | ssl_mail_client.c | 161 static int do_handshake(mbedtls_ssl_context *ssl) in do_handshake() argument 174 while ((ret = mbedtls_ssl_handshake(ssl)) != 0) { in do_handshake() 185 mbedtls_ssl_get_ciphersuite(ssl)); in do_handshake() 193 if ((flags = mbedtls_ssl_get_verify_result(ssl)) != 0) { in do_handshake() 212 mbedtls_ssl_get_peer_cert(ssl)); in do_handshake() 219 static int write_ssl_data(mbedtls_ssl_context *ssl, unsigned char *buf, size_t len) in write_ssl_data() argument 224 while (len && (ret = mbedtls_ssl_write(ssl, buf, len)) <= 0) { in write_ssl_data() 234 static int write_ssl_and_get_response(mbedtls_ssl_context *ssl, unsigned char *buf, size_t len) in write_ssl_and_get_response() argument 242 while (len && (ret = mbedtls_ssl_write(ssl, buf, len)) <= 0) { in write_ssl_and_get_response() 252 ret = mbedtls_ssl_read(ssl, data, len); in write_ssl_and_get_response() [all …]
|
D | dtls_client.c | 92 mbedtls_ssl_context ssl; in main() local 108 mbedtls_ssl_init(&ssl); in main() 179 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main() 184 if ((ret = mbedtls_ssl_set_hostname(&ssl, SERVER_NAME)) != 0) { in main() 189 mbedtls_ssl_set_bio(&ssl, &server_fd, in main() 192 mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, in main() 204 ret = mbedtls_ssl_handshake(&ssl); in main() 224 if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) { in main() 250 ret = mbedtls_ssl_write(&ssl, (unsigned char *) MESSAGE, len); in main() 272 ret = mbedtls_ssl_read(&ssl, buf, len); in main() [all …]
|
D | ssl_client1.c | 78 mbedtls_ssl_context ssl; in main() local 90 mbedtls_ssl_init(&ssl); in main() 161 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main() 166 if ((ret = mbedtls_ssl_set_hostname(&ssl, SERVER_NAME)) != 0) { in main() 171 mbedtls_ssl_set_bio(&ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL); in main() 179 while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) { in main() 195 if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) { in main() 219 while ((ret = mbedtls_ssl_write(&ssl, buf, len)) <= 0) { in main() 238 ret = mbedtls_ssl_read(&ssl, buf, len); in main() 262 mbedtls_ssl_close_notify(&ssl); in main() [all …]
|
D | mini_client.c | 165 mbedtls_ssl_context ssl; in main() local 173 mbedtls_ssl_init(&ssl); in main() 211 if (mbedtls_ssl_setup(&ssl, &conf) != 0) { in main() 217 if (mbedtls_ssl_set_hostname(&ssl, HOSTNAME) != 0) { in main() 245 mbedtls_ssl_set_bio(&ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL); in main() 247 if (mbedtls_ssl_handshake(&ssl) != 0) { in main() 255 if (mbedtls_ssl_write(&ssl, (const unsigned char *) GET_REQUEST, in main() 261 mbedtls_ssl_close_notify(&ssl); in main() 266 mbedtls_ssl_free(&ssl); in main()
|
D | ssl_server.c | 87 mbedtls_ssl_context ssl; in main() local 97 mbedtls_ssl_init(&ssl); in main() 203 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main() 221 mbedtls_ssl_session_reset(&ssl); in main() 235 mbedtls_ssl_set_bio(&ssl, &client_fd, mbedtls_net_send, mbedtls_net_recv, NULL); in main() 245 while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) { in main() 263 ret = mbedtls_ssl_read(&ssl, buf, len); in main() 302 mbedtls_ssl_get_ciphersuite(&ssl)); in main() 304 while ((ret = mbedtls_ssl_write(&ssl, buf, len)) <= 0) { in main() 321 while ((ret = mbedtls_ssl_close_notify(&ssl)) < 0) { in main() [all …]
|
/mbedtls-3.5.0/include/mbedtls/ |
D | ssl.h | 967 typedef int mbedtls_ssl_async_sign_t(mbedtls_ssl_context *ssl, 1033 typedef int mbedtls_ssl_async_decrypt_t(mbedtls_ssl_context *ssl, 1081 typedef int mbedtls_ssl_async_resume_t(mbedtls_ssl_context *ssl, 1103 typedef void mbedtls_ssl_async_cancel_t(mbedtls_ssl_context *ssl); 1312 typedef int (*mbedtls_ssl_hs_cb_t)(mbedtls_ssl_context *ssl); 1873 void mbedtls_ssl_init(mbedtls_ssl_context *ssl); 1899 int mbedtls_ssl_setup(mbedtls_ssl_context *ssl, 1911 int mbedtls_ssl_session_reset(mbedtls_ssl_context *ssl); 2079 const mbedtls_ssl_context *ssl) in mbedtls_ssl_context_get_config() argument 2081 return ssl->MBEDTLS_PRIVATE(conf); in mbedtls_ssl_context_get_config() [all …]
|
D | debug.h | 38 mbedtls_debug_print_msg(ssl, level, __FILE__, __LINE__, \ 42 mbedtls_debug_print_ret(ssl, level, __FILE__, __LINE__, text, ret) 45 mbedtls_debug_print_buf(ssl, level, __FILE__, __LINE__, text, buf, len) 49 mbedtls_debug_print_mpi(ssl, level, __FILE__, __LINE__, text, X) 54 mbedtls_debug_print_ecp(ssl, level, __FILE__, __LINE__, text, X) 60 mbedtls_debug_print_crt(ssl, level, __FILE__, __LINE__, text, crt) 68 mbedtls_debug_printf_ecdh(ssl, level, __FILE__, __LINE__, ecdh, attr) 170 void mbedtls_debug_print_msg(const mbedtls_ssl_context *ssl, int level, 189 void mbedtls_debug_print_ret(const mbedtls_ssl_context *ssl, int level, 210 void mbedtls_debug_print_buf(const mbedtls_ssl_context *ssl, int level, [all …]
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_debug.function | 58 mbedtls_ssl_context ssl; 62 mbedtls_ssl_init(&ssl); 74 TEST_ASSERT(mbedtls_ssl_setup(&ssl, &conf) == 0); 78 mbedtls_debug_print_msg(&ssl, level, file, line, 84 mbedtls_ssl_free(&ssl); 93 mbedtls_ssl_context ssl; 97 mbedtls_ssl_init(&ssl); 109 TEST_ASSERT(mbedtls_ssl_setup(&ssl, &conf) == 0); 111 mbedtls_debug_print_ret(&ssl, 0, file, line, text, value); 116 mbedtls_ssl_free(&ssl); [all …]
|
/mbedtls-3.5.0/programs/ |
D | Makefile | 114 ssl/dtls_client \ 115 ssl/dtls_server \ 116 ssl/mini_client \ 117 ssl/ssl_client1 \ 118 ssl/ssl_client2 \ 119 ssl/ssl_context_info \ 120 ssl/ssl_fork_server \ 121 ssl/ssl_mail_client \ 122 ssl/ssl_server \ 123 ssl/ssl_server2 \ [all …]
|
D | .gitignore | 50 ssl/dtls_client 51 ssl/dtls_server 52 ssl/mini_client 53 ssl/ssl_client1 54 ssl/ssl_client2 55 ssl/ssl_context_info 56 ssl/ssl_fork_server 57 ssl/ssl_mail_client 58 ssl/ssl_pthread_server 59 ssl/ssl_server [all …]
|
/mbedtls-3.5.0/programs/fuzz/ |
D | fuzz_dtlsserver.c | 43 mbedtls_ssl_context ssl; in LLVMFuzzerTestOneInput() local 82 mbedtls_ssl_init(&ssl); in LLVMFuzzerTestOneInput() 113 if (mbedtls_ssl_setup(&ssl, &conf) != 0) { in LLVMFuzzerTestOneInput() 117 mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, in LLVMFuzzerTestOneInput() 123 mbedtls_ssl_set_bio(&ssl, &biomemfuzz, dummy_send, fuzz_recv, fuzz_recv_timeout); in LLVMFuzzerTestOneInput() 124 if (mbedtls_ssl_set_client_transport_id(&ssl, client_ip, sizeof(client_ip)) != 0) { in LLVMFuzzerTestOneInput() 128 ret = mbedtls_ssl_handshake(&ssl); in LLVMFuzzerTestOneInput() 131 biomemfuzz.Offset = ssl.next_record_offset; in LLVMFuzzerTestOneInput() 132 mbedtls_ssl_session_reset(&ssl); in LLVMFuzzerTestOneInput() 133 mbedtls_ssl_set_bio(&ssl, &biomemfuzz, dummy_send, fuzz_recv, fuzz_recv_timeout); in LLVMFuzzerTestOneInput() [all …]
|
D | fuzz_dtlsclient.c | 38 mbedtls_ssl_context ssl; in LLVMFuzzerTestOneInput() local 59 mbedtls_ssl_init(&ssl); in LLVMFuzzerTestOneInput() 83 if (mbedtls_ssl_setup(&ssl, &conf) != 0) { in LLVMFuzzerTestOneInput() 87 mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, in LLVMFuzzerTestOneInput() 91 if (mbedtls_ssl_set_hostname(&ssl, "localhost") != 0) { in LLVMFuzzerTestOneInput() 99 mbedtls_ssl_set_bio(&ssl, &biomemfuzz, dummy_send, fuzz_recv, fuzz_recv_timeout); in LLVMFuzzerTestOneInput() 101 ret = mbedtls_ssl_handshake(&ssl); in LLVMFuzzerTestOneInput() 106 ret = mbedtls_ssl_read(&ssl, buf, len); in LLVMFuzzerTestOneInput() 121 mbedtls_ssl_free(&ssl); in LLVMFuzzerTestOneInput()
|
/mbedtls-3.5.0/tests/src/test_helpers/ |
D | ssl_helpers.c | 764 mbedtls_ssl_init(&(ep->ssl)); in mbedtls_test_ssl_endpoint_init() 770 TEST_ASSERT(mbedtls_ssl_get_user_data_p(&ep->ssl) == NULL); in mbedtls_test_ssl_endpoint_init() 771 TEST_EQUAL(mbedtls_ssl_get_user_data_n(&ep->ssl), 0); in mbedtls_test_ssl_endpoint_init() 777 mbedtls_ssl_set_user_data_n(&ep->ssl, user_data_n); in mbedtls_test_ssl_endpoint_init() 789 mbedtls_ssl_set_bio(&(ep->ssl), dtls_context, in mbedtls_test_ssl_endpoint_init() 794 mbedtls_ssl_set_bio(&(ep->ssl), &(ep->socket), in mbedtls_test_ssl_endpoint_init() 821 ret = mbedtls_ssl_setup(&(ep->ssl), &(ep->conf)); in mbedtls_test_ssl_endpoint_init() 838 TEST_EQUAL(mbedtls_ssl_get_user_data_n(&ep->ssl), user_data_n); in mbedtls_test_ssl_endpoint_init() 839 mbedtls_ssl_set_user_data_p(&ep->ssl, ep); in mbedtls_test_ssl_endpoint_init() 851 mbedtls_ssl_free(&(ep->ssl)); in mbedtls_test_ssl_endpoint_free() [all …]
|