Lines Matching refs:handshake
262 mbedtls_ssl_sig_hash_set_add( &ssl->handshake->hash_algs, sig_cur, md_cur ); in ssl_parse_signature_algorithms_ext()
306 if( ssl->handshake->curves != NULL ) in ssl_parse_supported_elliptic_curves()
327 ssl->handshake->curves = curves; in ssl_parse_supported_elliptic_curves()
370 ssl->handshake->ecdh_ctx.point_format = p[0]; in ssl_parse_supported_point_formats()
373 ssl->handshake->ecjpake_ctx.point_format = p[0]; in ssl_parse_supported_point_formats()
395 if( mbedtls_ecjpake_check( &ssl->handshake->ecjpake_ctx ) != 0 ) in ssl_parse_ecjpake_kkpp()
401 if( ( ret = mbedtls_ecjpake_read_round_one( &ssl->handshake->ecjpake_ctx, in ssl_parse_ecjpake_kkpp()
411 ssl->handshake->cli_exts |= MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK; in ssl_parse_ecjpake_kkpp()
501 ssl->handshake->extended_ms = MBEDTLS_SSL_EXTENDED_MS_ENABLED; in ssl_parse_extended_ms_ext()
525 ssl->handshake->new_session_ticket = 1; in ssl_parse_session_ticket_ext()
573 ssl->handshake->resume = 1; in ssl_parse_session_ticket_ext()
576 ssl->handshake->new_session_ticket = 0; in ssl_parse_session_ticket_ext()
709 if( ssl->handshake->sni_key_cert != NULL ) in ssl_pick_cert()
710 list = ssl->handshake->sni_key_cert; in ssl_pick_cert()
755 ssl_check_key_curve( &cur->cert->pk, ssl->handshake->curves ) != 0 ) in ssl_pick_cert()
789 ssl->handshake->key_cert = cur; in ssl_pick_cert()
791 ssl->handshake->key_cert->cert ); in ssl_pick_cert()
846 ( ssl->handshake->cli_exts & MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK ) == 0 ) in ssl_ciphersuite_match()
857 ( ssl->handshake->curves == NULL || in ssl_ciphersuite_match()
858 ssl->handshake->curves[0] == NULL ) ) in ssl_ciphersuite_match()
887 … mbedtls_ssl_sig_hash_set_find( &ssl->handshake->hash_algs, sig_type ) == MBEDTLS_MD_NONE ) in ssl_ciphersuite_match()
993 ssl->handshake->max_major_ver = buf[3]; in ssl_parse_client_hello_v2()
994 ssl->handshake->max_minor_ver = buf[4]; in ssl_parse_client_hello_v2()
1002 ssl->handshake->update_checksum( ssl, buf + 2, n ); in ssl_parse_client_hello_v2()
1065 memset( ssl->handshake->randbytes, 0, 64 ); in ssl_parse_client_hello_v2()
1066 memcpy( ssl->handshake->randbytes + 32 - chal_len, p, chal_len ); in ssl_parse_client_hello_v2()
1351 ssl->handshake->update_checksum( ssl, buf, msg_len ); in ssl_parse_client_hello()
1400 if( cli_msg_seq != ssl->handshake->in_msg_seq ) in ssl_parse_client_hello()
1404 ssl->handshake->in_msg_seq ) ); in ssl_parse_client_hello()
1408 ssl->handshake->in_msg_seq++; in ssl_parse_client_hello()
1415 ssl->handshake->out_msg_seq = cli_msg_seq; in ssl_parse_client_hello()
1416 ssl->handshake->in_msg_seq = cli_msg_seq + 1; in ssl_parse_client_hello()
1470 ssl->handshake->max_major_ver = ssl->major_ver; in ssl_parse_client_hello()
1471 ssl->handshake->max_minor_ver = ssl->minor_ver; in ssl_parse_client_hello()
1498 memcpy( ssl->handshake->randbytes, buf + 2, 32 ); in ssl_parse_client_hello()
1554 ssl->handshake->verify_cookie_len = 1; in ssl_parse_client_hello()
1559 ssl->handshake->verify_cookie_len = 0; in ssl_parse_client_hello()
1747 ssl->handshake->cli_exts |= MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT; in ssl_parse_client_hello()
1883 mbedtls_ssl_sig_hash_set_const_hash( &ssl->handshake->hash_algs, md_default ); in ssl_parse_client_hello()
2020 mbedtls_md_type_t md_alg = mbedtls_ssl_sig_hash_set_find( &ssl->handshake->hash_algs, in ssl_parse_client_hello()
2113 if( ssl->handshake->extended_ms == MBEDTLS_SSL_EXTENDED_MS_DISABLED || in ssl_write_extended_ms_ext()
2140 if( ssl->handshake->new_session_ticket == 0 ) in ssl_write_session_ticket_ext()
2234 if( ( ssl->handshake->cli_exts & in ssl_write_supported_point_formats_ext()
2284 ret = mbedtls_ecjpake_write_round_one( &ssl->handshake->ecjpake_ctx, in ssl_write_ecjpake_kkpp_ext()
2421 ssl->handshake->verify_cookie_len != 0 ) in ssl_write_server_hello()
2473 memcpy( ssl->handshake->randbytes + 32, buf + 6, 32 ); in ssl_write_server_hello()
2482 if( ssl->handshake->resume == 0 && in ssl_write_server_hello()
2491 ssl->handshake->resume = 1; in ssl_write_server_hello()
2494 if( ssl->handshake->resume == 0 ) in ssl_write_server_hello()
2507 if( ssl->handshake->new_session_ticket != 0 ) in ssl_write_server_hello()
2551 ssl->handshake->resume ? "a" : "no" ) ); in ssl_write_server_hello()
2688 if( ssl->handshake->sni_authmode != MBEDTLS_SSL_VERIFY_UNSET ) in ssl_write_certificate_request()
2689 authmode = ssl->handshake->sni_authmode; in ssl_write_certificate_request()
2795 if( ssl->handshake->sni_ca_chain != NULL ) in ssl_write_certificate_request()
2796 crt = ssl->handshake->sni_ca_chain; in ssl_write_certificate_request()
2856 if( ( ret = mbedtls_ecdh_get_params( &ssl->handshake->ecdh_ctx, in ssl_get_ecdh_params_from_cert()
2886 ssl->handshake->async_in_progress = 0; in ssl_resume_server_key_exchange()
2932 &ssl->handshake->ecjpake_ctx, in ssl_prepare_server_key_exchange()
2986 if( ( ret = mbedtls_dhm_set_group( &ssl->handshake->dhm_ctx, in ssl_prepare_server_key_exchange()
2995 &ssl->handshake->dhm_ctx, in ssl_prepare_server_key_exchange()
2996 (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), in ssl_prepare_server_key_exchange()
3010 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: X ", &ssl->handshake->dhm_ctx.X ); in ssl_prepare_server_key_exchange()
3011 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: P ", &ssl->handshake->dhm_ctx.P ); in ssl_prepare_server_key_exchange()
3012 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: G ", &ssl->handshake->dhm_ctx.G ); in ssl_prepare_server_key_exchange()
3013 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: GX", &ssl->handshake->dhm_ctx.GX ); in ssl_prepare_server_key_exchange()
3038 for( curve = ssl->handshake->curves; *curve != NULL; curve++ ) in ssl_prepare_server_key_exchange()
3051 if( ( ret = mbedtls_ecdh_setup( &ssl->handshake->ecdh_ctx, in ssl_prepare_server_key_exchange()
3059 &ssl->handshake->ecdh_ctx, &len, in ssl_prepare_server_key_exchange()
3074 MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, in ssl_prepare_server_key_exchange()
3112 ( md_alg = mbedtls_ssl_sig_hash_set_find( &ssl->handshake->hash_algs, in ssl_prepare_server_key_exchange()
3219 ssl->handshake->async_in_progress = 1; in ssl_prepare_server_key_exchange()
3222 ssl->handshake->async_in_progress = 1; in ssl_prepare_server_key_exchange()
3299 if( ssl->handshake->async_in_progress != 0 ) in ssl_write_server_key_exchange()
3422 if( ( ret = mbedtls_dhm_read_public( &ssl->handshake->dhm_ctx, *p, n ) ) != 0 ) in ssl_parse_client_dh_public()
3430 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: GY", &ssl->handshake->dhm_ctx.GY ); in ssl_parse_client_dh_public()
3450 ssl->handshake->async_in_progress = 0; in ssl_resume_decrypt_pms()
3473 if( ssl->handshake->async_in_progress != 0 ) in ssl_decrypt_encrypted_pms()
3522 ssl->handshake->async_in_progress = 1; in ssl_decrypt_encrypted_pms()
3528 ssl->handshake->async_in_progress = 1; in ssl_decrypt_encrypted_pms()
3555 unsigned char *pms = ssl->handshake->premaster + pms_offset; in ssl_parse_encrypted_pms()
3581 mbedtls_ssl_write_version( ssl->handshake->max_major_ver, in ssl_parse_encrypted_pms()
3582 ssl->handshake->max_minor_ver, in ssl_parse_encrypted_pms()
3627 if( sizeof( ssl->handshake->premaster ) < pms_offset || in ssl_parse_encrypted_pms()
3628 sizeof( ssl->handshake->premaster ) - pms_offset < 48 ) in ssl_parse_encrypted_pms()
3633 ssl->handshake->pmslen = 48; in ssl_parse_encrypted_pms()
3637 for( i = 0; i < ssl->handshake->pmslen; i++ ) in ssl_parse_encrypted_pms()
3723 ( ssl->handshake->async_in_progress != 0 ) ) in ssl_parse_client_key_exchange()
3768 if( ( ret = mbedtls_dhm_calc_secret( &ssl->handshake->dhm_ctx, in ssl_parse_client_key_exchange()
3769 ssl->handshake->premaster, in ssl_parse_client_key_exchange()
3771 &ssl->handshake->pmslen, in ssl_parse_client_key_exchange()
3778 MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: K ", &ssl->handshake->dhm_ctx.K ); in ssl_parse_client_key_exchange()
3791 if( ( ret = mbedtls_ecdh_read_public( &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3798 MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3801 if( ( ret = mbedtls_ecdh_calc_secret( &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3802 &ssl->handshake->pmslen, in ssl_parse_client_key_exchange()
3803 ssl->handshake->premaster, in ssl_parse_client_key_exchange()
3811 MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3847 if ( ssl->handshake->async_in_progress != 0 ) in ssl_parse_client_key_exchange()
3918 if( ( ret = mbedtls_ecdh_read_public( &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3925 MBEDTLS_SSL_DEBUG_ECDH( 3, &ssl->handshake->ecdh_ctx, in ssl_parse_client_key_exchange()
3951 ret = mbedtls_ecjpake_read_round_two( &ssl->handshake->ecjpake_ctx, in ssl_parse_client_key_exchange()
3959 ret = mbedtls_ecjpake_derive_secret( &ssl->handshake->ecjpake_ctx, in ssl_parse_client_key_exchange()
3960 ssl->handshake->premaster, 32, &ssl->handshake->pmslen, in ssl_parse_client_key_exchange()
4165 ssl->handshake->calc_verify( ssl, hash ); in ssl_parse_certificate_verify()
4235 ssl->handshake->new_session_ticket = 0; in ssl_write_new_session_ticket()
4256 if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER || ssl->handshake == NULL ) in mbedtls_ssl_handshake_server_step()
4266 ssl->handshake->retransmit_state == MBEDTLS_SSL_RETRANS_SENDING ) in mbedtls_ssl_handshake_server_step()
4352 if( ssl->handshake->new_session_ticket != 0 ) in mbedtls_ssl_handshake_server_step()