Lines Matching refs:handshake
205 if( ssl->handshake->retransmit_timeout >= ssl->conf->hs_timeout_max ) in ssl_double_retransmit_timeout()
214 if( ssl->handshake->retransmit_timeout != ssl->conf->hs_timeout_min ) in ssl_double_retransmit_timeout()
216 ssl->handshake->mtu = 508; in ssl_double_retransmit_timeout()
217 MBEDTLS_SSL_DEBUG_MSG( 2, ( "mtu autoreduction to %d bytes", ssl->handshake->mtu ) ); in ssl_double_retransmit_timeout()
220 new_timeout = 2 * ssl->handshake->retransmit_timeout; in ssl_double_retransmit_timeout()
223 if( new_timeout < ssl->handshake->retransmit_timeout || in ssl_double_retransmit_timeout()
229 ssl->handshake->retransmit_timeout = new_timeout; in ssl_double_retransmit_timeout()
231 ssl->handshake->retransmit_timeout ) ); in ssl_double_retransmit_timeout()
238 ssl->handshake->retransmit_timeout = ssl->conf->hs_timeout_min; in ssl_reset_retransmit_timeout()
240 ssl->handshake->retransmit_timeout ) ); in ssl_reset_retransmit_timeout()
626 mbedtls_ssl_handshake_params *handshake = ssl->handshake; in mbedtls_ssl_derive_keys() local
652 handshake->tls_prf = ssl3_prf; in mbedtls_ssl_derive_keys()
653 handshake->calc_verify = ssl_calc_verify_ssl; in mbedtls_ssl_derive_keys()
654 handshake->calc_finished = ssl_calc_finished_ssl; in mbedtls_ssl_derive_keys()
661 handshake->tls_prf = tls1_prf; in mbedtls_ssl_derive_keys()
662 handshake->calc_verify = ssl_calc_verify_tls; in mbedtls_ssl_derive_keys()
663 handshake->calc_finished = ssl_calc_finished_tls; in mbedtls_ssl_derive_keys()
672 handshake->tls_prf = tls_prf_sha384; in mbedtls_ssl_derive_keys()
673 handshake->calc_verify = ssl_calc_verify_tls_sha384; in mbedtls_ssl_derive_keys()
674 handshake->calc_finished = ssl_calc_finished_tls_sha384; in mbedtls_ssl_derive_keys()
681 handshake->tls_prf = tls_prf_sha256; in mbedtls_ssl_derive_keys()
682 handshake->calc_verify = ssl_calc_verify_tls_sha256; in mbedtls_ssl_derive_keys()
683 handshake->calc_finished = ssl_calc_finished_tls_sha256; in mbedtls_ssl_derive_keys()
703 if( handshake->resume == 0 ) in mbedtls_ssl_derive_keys()
705 MBEDTLS_SSL_DEBUG_BUF( 3, "premaster secret", handshake->premaster, in mbedtls_ssl_derive_keys()
706 handshake->pmslen ); in mbedtls_ssl_derive_keys()
709 if( ssl->handshake->extended_ms == MBEDTLS_SSL_EXTENDED_MS_ENABLED ) in mbedtls_ssl_derive_keys()
716 ssl->handshake->calc_verify( ssl, session_hash ); in mbedtls_ssl_derive_keys()
737 ret = handshake->tls_prf( handshake->premaster, handshake->pmslen, in mbedtls_ssl_derive_keys()
750 ret = handshake->tls_prf( handshake->premaster, handshake->pmslen, in mbedtls_ssl_derive_keys()
752 handshake->randbytes, 64, in mbedtls_ssl_derive_keys()
760 mbedtls_platform_zeroize( handshake->premaster, in mbedtls_ssl_derive_keys()
761 sizeof(handshake->premaster) ); in mbedtls_ssl_derive_keys()
769 memcpy( tmp, handshake->randbytes, 64 ); in mbedtls_ssl_derive_keys()
770 memcpy( handshake->randbytes, tmp + 32, 32 ); in mbedtls_ssl_derive_keys()
771 memcpy( handshake->randbytes + 32, tmp, 32 ); in mbedtls_ssl_derive_keys()
786 ret = handshake->tls_prf( session->master, 48, "key expansion", in mbedtls_ssl_derive_keys()
787 handshake->randbytes, 64, keyblk, 256 ); in mbedtls_ssl_derive_keys()
797 MBEDTLS_SSL_DEBUG_BUF( 4, "random bytes", handshake->randbytes, 64 ); in mbedtls_ssl_derive_keys()
800 mbedtls_platform_zeroize( handshake->randbytes, in mbedtls_ssl_derive_keys()
801 sizeof( handshake->randbytes ) ); in mbedtls_ssl_derive_keys()
1134 mbedtls_md5_clone( &md5, &ssl->handshake->fin_md5 ); in ssl_calc_verify_ssl()
1135 mbedtls_sha1_clone( &sha1, &ssl->handshake->fin_sha1 ); in ssl_calc_verify_ssl()
1181 mbedtls_md5_clone( &md5, &ssl->handshake->fin_md5 ); in ssl_calc_verify_tls()
1182 mbedtls_sha1_clone( &sha1, &ssl->handshake->fin_sha1 ); in ssl_calc_verify_tls()
1207 mbedtls_sha256_clone( &sha256, &ssl->handshake->fin_sha256 ); in ssl_calc_verify_tls_sha256()
1228 mbedtls_sha512_clone( &sha512, &ssl->handshake->fin_sha512 ); in ssl_calc_verify_tls_sha384()
1244 unsigned char *p = ssl->handshake->premaster; in mbedtls_ssl_psk_derive_premaster()
1245 unsigned char *end = p + sizeof( ssl->handshake->premaster ); in mbedtls_ssl_psk_derive_premaster()
1250 if( ssl->handshake->psk != NULL ) in mbedtls_ssl_psk_derive_premaster()
1252 psk = ssl->handshake->psk; in mbedtls_ssl_psk_derive_premaster()
1253 psk_len = ssl->handshake->psk_len; in mbedtls_ssl_psk_derive_premaster()
1303 if( ( ret = mbedtls_dhm_calc_secret( &ssl->handshake->dhm_ctx, in mbedtls_ssl_psk_derive_premaster()
1314 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: K ", &ssl->handshake->dhm_ctx.K ); in mbedtls_ssl_psk_derive_premaster()
1324 if( ( ret = mbedtls_ecdh_calc_secret( &ssl->handshake->ecdh_ctx, &zlen, in mbedtls_ssl_psk_derive_premaster()
1336 MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, in mbedtls_ssl_psk_derive_premaster()
1359 ssl->handshake->pmslen = p - ssl->handshake->premaster; in mbedtls_ssl_psk_derive_premaster()
2634 timeout = ssl->handshake->retransmit_timeout; in mbedtls_ssl_fetch_input()
2848 if( ssl->handshake->flight == NULL ) in ssl_flight_append()
2849 ssl->handshake->flight = msg; in ssl_flight_append()
2852 mbedtls_ssl_flight_item *cur = ssl->handshake->flight; in ssl_flight_append()
2893 if( ssl->transform_out == ssl->handshake->alt_transform_out ) in ssl_swap_epochs()
2903 ssl->transform_out = ssl->handshake->alt_transform_out; in ssl_swap_epochs()
2904 ssl->handshake->alt_transform_out = tmp_transform; in ssl_swap_epochs()
2908 memcpy( ssl->cur_out_ctr, ssl->handshake->alt_out_ctr, 8 ); in ssl_swap_epochs()
2909 memcpy( ssl->handshake->alt_out_ctr, tmp_out_ctr, 8 ); in ssl_swap_epochs()
2954 if( ssl->handshake->retransmit_state != MBEDTLS_SSL_RETRANS_SENDING ) in mbedtls_ssl_flight_transmit()
2958 ssl->handshake->cur_msg = ssl->handshake->flight; in mbedtls_ssl_flight_transmit()
2959 ssl->handshake->cur_msg_p = ssl->handshake->flight->p + 12; in mbedtls_ssl_flight_transmit()
2962 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_SENDING; in mbedtls_ssl_flight_transmit()
2965 while( ssl->handshake->cur_msg != NULL ) in mbedtls_ssl_flight_transmit()
2968 const mbedtls_ssl_flight_item * const cur = ssl->handshake->cur_msg; in mbedtls_ssl_flight_transmit()
2980 if( is_finished && ssl->handshake->cur_msg_p == ( cur->p + 12 ) ) in mbedtls_ssl_flight_transmit()
3007 ssl->handshake->cur_msg_p += cur->len; in mbedtls_ssl_flight_transmit()
3011 const unsigned char * const p = ssl->handshake->cur_msg_p; in mbedtls_ssl_flight_transmit()
3060 ssl->handshake->cur_msg_p += cur_hs_frag_len; in mbedtls_ssl_flight_transmit()
3064 if( ssl->handshake->cur_msg_p >= cur->p + cur->len ) in mbedtls_ssl_flight_transmit()
3068 ssl->handshake->cur_msg = cur->next; in mbedtls_ssl_flight_transmit()
3069 ssl->handshake->cur_msg_p = cur->next->p + 12; in mbedtls_ssl_flight_transmit()
3073 ssl->handshake->cur_msg = NULL; in mbedtls_ssl_flight_transmit()
3074 ssl->handshake->cur_msg_p = NULL; in mbedtls_ssl_flight_transmit()
3091 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_FINISHED; in mbedtls_ssl_flight_transmit()
3094 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_WAITING; in mbedtls_ssl_flight_transmit()
3095 ssl_set_timer( ssl, ssl->handshake->retransmit_timeout ); in mbedtls_ssl_flight_transmit()
3109 ssl_flight_free( ssl->handshake->flight ); in mbedtls_ssl_recv_flight_completed()
3110 ssl->handshake->flight = NULL; in mbedtls_ssl_recv_flight_completed()
3111 ssl->handshake->cur_msg = NULL; in mbedtls_ssl_recv_flight_completed()
3114 ssl->handshake->in_flight_start_seq = ssl->handshake->in_msg_seq; in mbedtls_ssl_recv_flight_completed()
3117 ssl->handshake->buffering.seen_ccs = 0; in mbedtls_ssl_recv_flight_completed()
3128 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_FINISHED; in mbedtls_ssl_recv_flight_completed()
3131 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_PREPARING; in mbedtls_ssl_recv_flight_completed()
3140 ssl_set_timer( ssl, ssl->handshake->retransmit_timeout ); in mbedtls_ssl_send_flight_completed()
3145 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_FINISHED; in mbedtls_ssl_send_flight_completed()
3148 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_WAITING; in mbedtls_ssl_send_flight_completed()
3208 ssl->handshake == NULL ) in mbedtls_ssl_write_handshake_msg()
3216 ssl->handshake != NULL && in mbedtls_ssl_write_handshake_msg()
3217 ssl->handshake->retransmit_state == MBEDTLS_SSL_RETRANS_SENDING ) in mbedtls_ssl_write_handshake_msg()
3276 ssl->out_msg[4] = ( ssl->handshake->out_msg_seq >> 8 ) & 0xFF; in mbedtls_ssl_write_handshake_msg()
3277 ssl->out_msg[5] = ( ssl->handshake->out_msg_seq ) & 0xFF; in mbedtls_ssl_write_handshake_msg()
3278 ++( ssl->handshake->out_msg_seq ); in mbedtls_ssl_write_handshake_msg()
3295 ssl->handshake->update_checksum( ssl, ssl->out_msg, ssl->out_msglen ); in mbedtls_ssl_write_handshake_msg()
3640 if( ssl->handshake != NULL && in mbedtls_ssl_prepare_handshake_record()
3642 recv_msg_seq != ssl->handshake->in_msg_seq ) || in mbedtls_ssl_prepare_handshake_record()
3646 if( recv_msg_seq > ssl->handshake->in_msg_seq ) in mbedtls_ssl_prepare_handshake_record()
3650 ssl->handshake->in_msg_seq ) ); in mbedtls_ssl_prepare_handshake_record()
3657 if( recv_msg_seq == ssl->handshake->in_flight_start_seq - 1 && in mbedtls_ssl_prepare_handshake_record()
3663 ssl->handshake->in_flight_start_seq ) ); in mbedtls_ssl_prepare_handshake_record()
3676 ssl->handshake->in_msg_seq ) ); in mbedtls_ssl_prepare_handshake_record()
3707 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in mbedtls_ssl_update_handshake_status()
3711 ssl->handshake->update_checksum( ssl, ssl->in_msg, ssl->in_hslen ); in mbedtls_ssl_update_handshake_status()
3717 ssl->handshake != NULL ) in mbedtls_ssl_update_handshake_status()
4401 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_load_buffered_message()
4500 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_buffer_make_space()
4541 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_buffer_message()
4565 if( recv_msg_seq < ssl->handshake->in_msg_seq ) in ssl_buffer_message()
4571 recv_msg_seq_offset = recv_msg_seq - ssl->handshake->in_msg_seq; in ssl_buffer_message()
4578 recv_msg_seq, ssl->handshake->in_msg_seq, in ssl_buffer_message()
4579 ssl->handshake->in_msg_seq + MBEDTLS_SSL_MAX_BUFFERED_HS - 1 ) ); in ssl_buffer_message()
4830 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_free_buffered_record()
4846 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_load_buffered_record()
4900 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_buffer_future_record()
5147 if( ssl->handshake == NULL ) in mbedtls_ssl_handle_message_type()
5219 ssl->handshake != NULL && in mbedtls_ssl_handle_message_type()
5693 const int authmode = ssl->handshake->sni_authmode != MBEDTLS_SSL_VERIFY_UNSET in mbedtls_ssl_parse_certificate()
5694 ? ssl->handshake->sni_authmode in mbedtls_ssl_parse_certificate()
5734 if( ssl->handshake->ecrs_enabled && in mbedtls_ssl_parse_certificate()
5735 ssl->handshake->ecrs_state == ssl_ecrs_crt_verify ) in mbedtls_ssl_parse_certificate()
5764 if( ssl->handshake->ecrs_enabled) in mbedtls_ssl_parse_certificate()
5765 ssl->handshake->ecrs_state = ssl_ecrs_crt_verify; in mbedtls_ssl_parse_certificate()
5768 if( ssl->handshake->ecrs_enabled) in mbedtls_ssl_parse_certificate()
5769 rs_ctx = &ssl->handshake->ecrs_ctx; in mbedtls_ssl_parse_certificate()
5778 if( ssl->handshake->sni_ca_chain != NULL ) in mbedtls_ssl_parse_certificate()
5780 ca_chain = ssl->handshake->sni_ca_chain; in mbedtls_ssl_parse_certificate()
5781 ca_crl = ssl->handshake->sni_ca_crl; in mbedtls_ssl_parse_certificate()
6042 ssl->handshake->update_checksum = ssl_update_checksum_md5sha1; in mbedtls_ssl_optimize_checksum()
6048 ssl->handshake->update_checksum = ssl_update_checksum_sha384; in mbedtls_ssl_optimize_checksum()
6053 ssl->handshake->update_checksum = ssl_update_checksum_sha256; in mbedtls_ssl_optimize_checksum()
6067 mbedtls_md5_starts_ret( &ssl->handshake->fin_md5 ); in mbedtls_ssl_reset_checksum()
6068 mbedtls_sha1_starts_ret( &ssl->handshake->fin_sha1 ); in mbedtls_ssl_reset_checksum()
6072 mbedtls_sha256_starts_ret( &ssl->handshake->fin_sha256, 0 ); in mbedtls_ssl_reset_checksum()
6075 mbedtls_sha512_starts_ret( &ssl->handshake->fin_sha512, 1 ); in mbedtls_ssl_reset_checksum()
6085 mbedtls_md5_update_ret( &ssl->handshake->fin_md5 , buf, len ); in ssl_update_checksum_start()
6086 mbedtls_sha1_update_ret( &ssl->handshake->fin_sha1, buf, len ); in ssl_update_checksum_start()
6090 mbedtls_sha256_update_ret( &ssl->handshake->fin_sha256, buf, len ); in ssl_update_checksum_start()
6093 mbedtls_sha512_update_ret( &ssl->handshake->fin_sha512, buf, len ); in ssl_update_checksum_start()
6103 mbedtls_md5_update_ret( &ssl->handshake->fin_md5 , buf, len ); in ssl_update_checksum_md5sha1()
6104 mbedtls_sha1_update_ret( &ssl->handshake->fin_sha1, buf, len ); in ssl_update_checksum_md5sha1()
6113 mbedtls_sha256_update_ret( &ssl->handshake->fin_sha256, buf, len ); in ssl_update_checksum_sha256()
6121 mbedtls_sha512_update_ret( &ssl->handshake->fin_sha512, buf, len ); in ssl_update_checksum_sha384()
6147 mbedtls_md5_clone( &md5, &ssl->handshake->fin_md5 ); in ssl_calc_finished_ssl()
6148 mbedtls_sha1_clone( &sha1, &ssl->handshake->fin_sha1 ); in ssl_calc_finished_ssl()
6230 mbedtls_md5_clone( &md5, &ssl->handshake->fin_md5 ); in ssl_calc_finished_tls()
6231 mbedtls_sha1_clone( &sha1, &ssl->handshake->fin_sha1 ); in ssl_calc_finished_tls()
6256 ssl->handshake->tls_prf( session->master, 48, sender, in ssl_calc_finished_tls()
6288 mbedtls_sha256_clone( &sha256, &ssl->handshake->fin_sha256 ); in ssl_calc_finished_tls_sha256()
6307 ssl->handshake->tls_prf( session->master, 48, sender, in ssl_calc_finished_tls_sha256()
6337 mbedtls_sha512_clone( &sha512, &ssl->handshake->fin_sha512 ); in ssl_calc_finished_tls_sha384()
6356 ssl->handshake->tls_prf( session->master, 48, sender, in ssl_calc_finished_tls_sha384()
6378 mbedtls_free( ssl->handshake ); in ssl_handshake_wrapup_free_hs_transform()
6379 ssl->handshake = NULL; in ssl_handshake_wrapup_free_hs_transform()
6397 int resume = ssl->handshake->resume; in mbedtls_ssl_handshake_wrapup()
6439 ssl->handshake->flight != NULL ) in mbedtls_ssl_handshake_wrapup()
6465 ssl->handshake->calc_finished( ssl, ssl->out_msg + 4, ssl->conf->endpoint ); in mbedtls_ssl_write_finished()
6489 if( ssl->handshake->resume != 0 ) in mbedtls_ssl_write_finished()
6515 ssl->handshake->alt_transform_out = ssl->transform_out; in mbedtls_ssl_write_finished()
6516 memcpy( ssl->handshake->alt_out_ctr, ssl->cur_out_ctr, 8 ); in mbedtls_ssl_write_finished()
6590 ssl->handshake->calc_finished( ssl, buf, ssl->conf->endpoint ^ 1 ); in mbedtls_ssl_parse_finished()
6637 if( ssl->handshake->resume != 0 ) in mbedtls_ssl_parse_finished()
6661 static void ssl_handshake_params_init( mbedtls_ssl_handshake_params *handshake ) in ssl_handshake_params_init() argument
6663 memset( handshake, 0, sizeof( mbedtls_ssl_handshake_params ) ); in ssl_handshake_params_init()
6667 mbedtls_md5_init( &handshake->fin_md5 ); in ssl_handshake_params_init()
6668 mbedtls_sha1_init( &handshake->fin_sha1 ); in ssl_handshake_params_init()
6669 mbedtls_md5_starts_ret( &handshake->fin_md5 ); in ssl_handshake_params_init()
6670 mbedtls_sha1_starts_ret( &handshake->fin_sha1 ); in ssl_handshake_params_init()
6674 mbedtls_sha256_init( &handshake->fin_sha256 ); in ssl_handshake_params_init()
6675 mbedtls_sha256_starts_ret( &handshake->fin_sha256, 0 ); in ssl_handshake_params_init()
6678 mbedtls_sha512_init( &handshake->fin_sha512 ); in ssl_handshake_params_init()
6679 mbedtls_sha512_starts_ret( &handshake->fin_sha512, 1 ); in ssl_handshake_params_init()
6683 handshake->update_checksum = ssl_update_checksum_start; in ssl_handshake_params_init()
6687 mbedtls_ssl_sig_hash_set_init( &handshake->hash_algs ); in ssl_handshake_params_init()
6691 mbedtls_dhm_init( &handshake->dhm_ctx ); in ssl_handshake_params_init()
6694 mbedtls_ecdh_init( &handshake->ecdh_ctx ); in ssl_handshake_params_init()
6697 mbedtls_ecjpake_init( &handshake->ecjpake_ctx ); in ssl_handshake_params_init()
6699 handshake->ecjpake_cache = NULL; in ssl_handshake_params_init()
6700 handshake->ecjpake_cache_len = 0; in ssl_handshake_params_init()
6705 mbedtls_x509_crt_restart_init( &handshake->ecrs_ctx ); in ssl_handshake_params_init()
6709 handshake->sni_authmode = MBEDTLS_SSL_VERIFY_UNSET; in ssl_handshake_params_init()
6736 if( ssl->handshake ) in ssl_handshake_init()
6753 if( ssl->handshake == NULL ) in ssl_handshake_init()
6755 ssl->handshake = mbedtls_calloc( 1, sizeof(mbedtls_ssl_handshake_params) ); in ssl_handshake_init()
6759 if( ssl->handshake == NULL || in ssl_handshake_init()
6765 mbedtls_free( ssl->handshake ); in ssl_handshake_init()
6769 ssl->handshake = NULL; in ssl_handshake_init()
6779 ssl_handshake_params_init( ssl->handshake ); in ssl_handshake_init()
6784 ssl->handshake->alt_transform_out = ssl->transform_out; in ssl_handshake_init()
6787 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_PREPARING; in ssl_handshake_init()
6789 ssl->handshake->retransmit_state = MBEDTLS_SSL_RETRANS_WAITING; in ssl_handshake_init()
7263 ssl->handshake->resume = 1; in mbedtls_ssl_set_session()
7350 return( ssl_append_key_cert( &ssl->handshake->sni_key_cert, in mbedtls_ssl_set_hs_own_cert()
7358 ssl->handshake->sni_ca_chain = ca_chain; in mbedtls_ssl_set_hs_ca_chain()
7359 ssl->handshake->sni_ca_crl = ca_crl; in mbedtls_ssl_set_hs_ca_chain()
7365 ssl->handshake->sni_authmode = authmode; in mbedtls_ssl_set_hs_authmode()
7379 if( ssl->handshake == NULL || ssl->conf == NULL ) in mbedtls_ssl_set_hs_ecjpake_password()
7387 return( mbedtls_ecjpake_setup( &ssl->handshake->ecjpake_ctx, in mbedtls_ssl_set_hs_ecjpake_password()
7450 if( psk == NULL || ssl->handshake == NULL ) in mbedtls_ssl_set_hs_psk()
7456 if( ssl->handshake->psk != NULL ) in mbedtls_ssl_set_hs_psk()
7458 mbedtls_platform_zeroize( ssl->handshake->psk, in mbedtls_ssl_set_hs_psk()
7459 ssl->handshake->psk_len ); in mbedtls_ssl_set_hs_psk()
7460 mbedtls_free( ssl->handshake->psk ); in mbedtls_ssl_set_hs_psk()
7461 ssl->handshake->psk_len = 0; in mbedtls_ssl_set_hs_psk()
7464 if( ( ssl->handshake->psk = mbedtls_calloc( 1, psk_len ) ) == NULL ) in mbedtls_ssl_set_hs_psk()
7467 ssl->handshake->psk_len = psk_len; in mbedtls_ssl_set_hs_psk()
7468 memcpy( ssl->handshake->psk, psk, ssl->handshake->psk_len ); in mbedtls_ssl_set_hs_psk()
7811 if( ssl->handshake == NULL ) in mbedtls_ssl_get_async_operation_data()
7814 return( ssl->handshake->user_async_ctx ); in mbedtls_ssl_get_async_operation_data()
7820 if( ssl->handshake != NULL ) in mbedtls_ssl_set_async_operation_data()
7821 ssl->handshake->user_async_ctx = ctx; in mbedtls_ssl_set_async_operation_data()
8035 if( ssl->handshake == NULL || ssl->handshake->mtu == 0 ) in ssl_get_current_mtu()
8039 return( ssl->handshake->mtu ); in ssl_get_current_mtu()
8041 return( ssl->mtu < ssl->handshake->mtu ? in ssl_get_current_mtu()
8042 ssl->mtu : ssl->handshake->mtu ); in ssl_get_current_mtu()
8215 ssl->handshake->out_msg_seq = 1; in ssl_start_renegotiation()
8217 ssl->handshake->in_msg_seq = 1; in ssl_start_renegotiation()
8342 if( ssl->handshake != NULL && in mbedtls_ssl_read()
8343 ssl->handshake->retransmit_state == MBEDTLS_SSL_RETRANS_SENDING ) in mbedtls_ssl_read()
8848 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_buffering_free()
8862 mbedtls_ssl_handshake_params * const hs = ssl->handshake; in ssl_buffering_free_slot()
8881 mbedtls_ssl_handshake_params *handshake = ssl->handshake; in mbedtls_ssl_handshake_free() local
8883 if( handshake == NULL ) in mbedtls_ssl_handshake_free()
8887 if( ssl->conf->f_async_cancel != NULL && handshake->async_in_progress != 0 ) in mbedtls_ssl_handshake_free()
8890 handshake->async_in_progress = 0; in mbedtls_ssl_handshake_free()
8896 mbedtls_md5_free( &handshake->fin_md5 ); in mbedtls_ssl_handshake_free()
8897 mbedtls_sha1_free( &handshake->fin_sha1 ); in mbedtls_ssl_handshake_free()
8901 mbedtls_sha256_free( &handshake->fin_sha256 ); in mbedtls_ssl_handshake_free()
8904 mbedtls_sha512_free( &handshake->fin_sha512 ); in mbedtls_ssl_handshake_free()
8909 mbedtls_dhm_free( &handshake->dhm_ctx ); in mbedtls_ssl_handshake_free()
8912 mbedtls_ecdh_free( &handshake->ecdh_ctx ); in mbedtls_ssl_handshake_free()
8915 mbedtls_ecjpake_free( &handshake->ecjpake_ctx ); in mbedtls_ssl_handshake_free()
8917 mbedtls_free( handshake->ecjpake_cache ); in mbedtls_ssl_handshake_free()
8918 handshake->ecjpake_cache = NULL; in mbedtls_ssl_handshake_free()
8919 handshake->ecjpake_cache_len = 0; in mbedtls_ssl_handshake_free()
8926 mbedtls_free( (void *) handshake->curves ); in mbedtls_ssl_handshake_free()
8930 if( handshake->psk != NULL ) in mbedtls_ssl_handshake_free()
8932 mbedtls_platform_zeroize( handshake->psk, handshake->psk_len ); in mbedtls_ssl_handshake_free()
8933 mbedtls_free( handshake->psk ); in mbedtls_ssl_handshake_free()
8943 if( handshake->sni_key_cert != NULL ) in mbedtls_ssl_handshake_free()
8945 mbedtls_ssl_key_cert *cur = handshake->sni_key_cert, *next; in mbedtls_ssl_handshake_free()
8957 mbedtls_x509_crt_restart_free( &handshake->ecrs_ctx ); in mbedtls_ssl_handshake_free()
8961 mbedtls_free( handshake->verify_cookie ); in mbedtls_ssl_handshake_free()
8962 ssl_flight_free( handshake->flight ); in mbedtls_ssl_handshake_free()
8966 mbedtls_platform_zeroize( handshake, in mbedtls_ssl_handshake_free()
9026 if( ssl->handshake ) in mbedtls_ssl_free()
9032 mbedtls_free( ssl->handshake ); in mbedtls_ssl_free()
9679 ssl->handshake->calc_verify = ssl_calc_verify_tls; in mbedtls_ssl_set_calc_verify_md()
9685 ssl->handshake->calc_verify = ssl_calc_verify_tls_sha384; in mbedtls_ssl_set_calc_verify_md()
9690 ssl->handshake->calc_verify = ssl_calc_verify_tls_sha256; in mbedtls_ssl_set_calc_verify_md()
9738 ssl->handshake->randbytes, 64 ) ) != 0 ) in mbedtls_ssl_get_key_exchange_md_ssl_tls()
9760 ssl->handshake->randbytes, 64 ) ) != 0 ) in mbedtls_ssl_get_key_exchange_md_ssl_tls()
9823 if( ( ret = mbedtls_md_update( &ctx, ssl->handshake->randbytes, 64 ) ) != 0 ) in mbedtls_ssl_get_key_exchange_md_tls1_2()