Lines Matching refs:p

52     unsigned char *p = buf;  in ssl_tls13_write_supported_versions_ext()  local
64 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 7 ); in ssl_tls13_write_supported_versions_ext()
67 MBEDTLS_PUT_UINT16_BE( MBEDTLS_TLS_EXT_SUPPORTED_VERSIONS, p, 0 ); in ssl_tls13_write_supported_versions_ext()
70 MBEDTLS_PUT_UINT16_BE( 3, p, 2 ); in ssl_tls13_write_supported_versions_ext()
71 p += 4; in ssl_tls13_write_supported_versions_ext()
74 *p++ = 0x2; in ssl_tls13_write_supported_versions_ext()
84 ssl->conf->transport, p ); in ssl_tls13_write_supported_versions_ext()
144 unsigned char *p = buf; in ssl_tls13_write_named_group_list_ecdhe() local
163 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2); in ssl_tls13_write_named_group_list_ecdhe()
164 MBEDTLS_PUT_UINT16_BE( *group_list, p, 0 ); in ssl_tls13_write_named_group_list_ecdhe()
165 p += 2; in ssl_tls13_write_named_group_list_ecdhe()
171 *olen = p - buf; in ssl_tls13_write_named_group_list_ecdhe()
207 unsigned char *p = buf ; in ssl_tls13_write_supported_groups_ext() local
225 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 6 ); in ssl_tls13_write_supported_groups_ext()
226 p += 6; in ssl_tls13_write_supported_groups_ext()
228 named_group_list_ptr = p; in ssl_tls13_write_supported_groups_ext()
229 ret_ecdhe = ssl_tls13_write_named_group_list_ecdhe( ssl, p, end, &output_len ); in ssl_tls13_write_supported_groups_ext()
234 p += output_len; in ssl_tls13_write_supported_groups_ext()
236 ret_dhe = ssl_tls13_write_named_group_list_dhe( ssl, p, end, &output_len ); in ssl_tls13_write_supported_groups_ext()
241 p += output_len; in ssl_tls13_write_supported_groups_ext()
251 named_group_list_len = p - named_group_list_ptr; in ssl_tls13_write_supported_groups_ext()
267 *olen = p - buf; in ssl_tls13_write_supported_groups_ext()
370 unsigned char *p = buf; in ssl_tls13_write_key_share_ext() local
386 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 6 ); in ssl_tls13_write_key_share_ext()
387 p += 6; in ssl_tls13_write_key_share_ext()
408 client_shares_ptr = p; in ssl_tls13_write_key_share_ext()
413 unsigned char *group_ptr = p; in ssl_tls13_write_key_share_ext()
421 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 4 ); in ssl_tls13_write_key_share_ext()
422 p += 4; in ssl_tls13_write_key_share_ext()
424 p, end, in ssl_tls13_write_key_share_ext()
426 p += key_exchange_len; in ssl_tls13_write_key_share_ext()
445 client_shares_len = p - client_shares_ptr; in ssl_tls13_write_key_share_ext()
462 *olen = p - buf; in ssl_tls13_write_key_share_ext()
550 const unsigned char *p = buf; in ssl_tls13_parse_key_share_ext() local
557 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 ); in ssl_tls13_parse_key_share_ext()
558 group = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_key_share_ext()
559 p += 2; in ssl_tls13_parse_key_share_ext()
577 ret = ssl_tls13_read_public_ecdhe_share( ssl, p, end - p ); in ssl_tls13_parse_key_share_ext()
605 unsigned char *p = buf; in ssl_tls13_write_client_hello_cipher_suites() local
623 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); in ssl_tls13_write_client_hello_cipher_suites()
624 p += 2; in ssl_tls13_write_client_hello_cipher_suites()
627 cipher_suites_ptr = p; in ssl_tls13_write_client_hello_cipher_suites()
645 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); in ssl_tls13_write_client_hello_cipher_suites()
646 MBEDTLS_PUT_UINT16_BE( cipher_suite, p, 0 ); in ssl_tls13_write_client_hello_cipher_suites()
647 p += 2; in ssl_tls13_write_client_hello_cipher_suites()
651 cipher_suites_len = p - cipher_suites_ptr; in ssl_tls13_write_client_hello_cipher_suites()
658 *olen = p - buf; in ssl_tls13_write_client_hello_cipher_suites()
687 unsigned char *p = buf; in ssl_tls13_write_client_hello_body() local
702 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); in ssl_tls13_write_client_hello_body()
703 MBEDTLS_PUT_UINT16_BE( 0x0303, p, 0 ); in ssl_tls13_write_client_hello_body()
704 p += 2; in ssl_tls13_write_client_hello_body()
707 MBEDTLS_SSL_CHK_BUF_PTR( p, end, MBEDTLS_CLIENT_HELLO_RANDOM_LEN ); in ssl_tls13_write_client_hello_body()
708 memcpy( p, ssl->handshake->randbytes, MBEDTLS_CLIENT_HELLO_RANDOM_LEN ); in ssl_tls13_write_client_hello_body()
710 p, MBEDTLS_CLIENT_HELLO_RANDOM_LEN ); in ssl_tls13_write_client_hello_body()
711 p += MBEDTLS_CLIENT_HELLO_RANDOM_LEN; in ssl_tls13_write_client_hello_body()
726 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 1 ); in ssl_tls13_write_client_hello_body()
727 *p++ = 0; /* session id length set to zero */ in ssl_tls13_write_client_hello_body()
730 ret = ssl_tls13_write_client_hello_cipher_suites( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
733 p += output_len; in ssl_tls13_write_client_hello_body()
741 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); in ssl_tls13_write_client_hello_body()
742 *p++ = 1; in ssl_tls13_write_client_hello_body()
743 *p++ = MBEDTLS_SSL_COMPRESS_NULL; in ssl_tls13_write_client_hello_body()
751 MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 ); in ssl_tls13_write_client_hello_body()
752 extensions_len_ptr = p; in ssl_tls13_write_client_hello_body()
753 p += 2; in ssl_tls13_write_client_hello_body()
759 ret = ssl_tls13_write_supported_versions_ext( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
762 p += output_len; in ssl_tls13_write_client_hello_body()
769 ret = ssl_tls13_write_supported_groups_ext( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
772 p += output_len; in ssl_tls13_write_client_hello_body()
785 ret = ssl_tls13_write_key_share_ext( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
788 p += output_len; in ssl_tls13_write_client_hello_body()
794 ret = mbedtls_ssl_tls13_write_sig_alg_ext( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
797 p += output_len; in ssl_tls13_write_client_hello_body()
803 ret = mbedtls_ssl_write_hostname_ext( ssl, p, end, &output_len ); in ssl_tls13_write_client_hello_body()
806 p += output_len; in ssl_tls13_write_client_hello_body()
812 extensions_len = p - extensions_len_ptr - 2; in ssl_tls13_write_client_hello_body()
818 *olen = p - buf; in ssl_tls13_write_client_hello_body()
977 const unsigned char *p = *buf; in ssl_tls13_check_server_hello_session_id_echo() local
980 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 1 ); in ssl_tls13_check_server_hello_session_id_echo()
981 legacy_session_id_echo_len = *p++ ; in ssl_tls13_check_server_hello_session_id_echo()
983 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, legacy_session_id_echo_len ); in ssl_tls13_check_server_hello_session_id_echo()
987 memcmp( ssl->session_negotiate->id, p , legacy_session_id_echo_len ) != 0 ) in ssl_tls13_check_server_hello_session_id_echo()
992 MBEDTLS_SSL_DEBUG_BUF( 3, "Received Session ID", p, in ssl_tls13_check_server_hello_session_id_echo()
1001 p += legacy_session_id_echo_len; in ssl_tls13_check_server_hello_session_id_echo()
1002 *buf = p; in ssl_tls13_check_server_hello_session_id_echo()
1041 const unsigned char *p = buf; in ssl_tls13_parse_server_hello() local
1056 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, MBEDTLS_SERVER_HELLO_RANDOM_LEN + 6 ); in ssl_tls13_parse_server_hello()
1058 MBEDTLS_SSL_DEBUG_BUF( 4, "server hello", p, end - p ); in ssl_tls13_parse_server_hello()
1059 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, version", p, 2 ); in ssl_tls13_parse_server_hello()
1067 if( !( p[0] == MBEDTLS_SSL_MAJOR_VERSION_3 && in ssl_tls13_parse_server_hello()
1068 p[1] == MBEDTLS_SSL_MINOR_VERSION_3 ) ) in ssl_tls13_parse_server_hello()
1075 p += 2; in ssl_tls13_parse_server_hello()
1083 memcpy( &ssl->handshake->randbytes[MBEDTLS_CLIENT_HELLO_RANDOM_LEN], p, in ssl_tls13_parse_server_hello()
1086 p, MBEDTLS_SERVER_HELLO_RANDOM_LEN ); in ssl_tls13_parse_server_hello()
1087 p += MBEDTLS_SERVER_HELLO_RANDOM_LEN; in ssl_tls13_parse_server_hello()
1093 if( ssl_tls13_check_server_hello_session_id_echo( ssl, &p, end ) != 0 ) in ssl_tls13_parse_server_hello()
1106 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 ); in ssl_tls13_parse_server_hello()
1107 cipher_suite = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_server_hello()
1108 p += 2; in ssl_tls13_parse_server_hello()
1146 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 1 ); in ssl_tls13_parse_server_hello()
1147 if( p[0] != 0 ) in ssl_tls13_parse_server_hello()
1154 p++; in ssl_tls13_parse_server_hello()
1164 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 ); in ssl_tls13_parse_server_hello()
1165 extensions_len = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_server_hello()
1166 p += 2; in ssl_tls13_parse_server_hello()
1169 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, extensions_len ); in ssl_tls13_parse_server_hello()
1170 extensions_end = p + extensions_len; in ssl_tls13_parse_server_hello()
1172 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello extensions", p, extensions_len ); in ssl_tls13_parse_server_hello()
1174 while( p < extensions_end ) in ssl_tls13_parse_server_hello()
1179 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, extensions_end, 4 ); in ssl_tls13_parse_server_hello()
1180 extension_type = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_server_hello()
1181 extension_data_len = MBEDTLS_GET_UINT16_BE( p, 2 ); in ssl_tls13_parse_server_hello()
1182 p += 4; in ssl_tls13_parse_server_hello()
1184 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, extensions_end, extension_data_len ); in ssl_tls13_parse_server_hello()
1193 p, in ssl_tls13_parse_server_hello()
1194 p + extension_data_len ); in ssl_tls13_parse_server_hello()
1212 p, p + extension_data_len ) ) != 0 ) in ssl_tls13_parse_server_hello()
1234 p += extension_data_len; in ssl_tls13_parse_server_hello()
1466 const unsigned char *p = buf; in ssl_tls13_parse_encrypted_extensions() local
1469 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 ); in ssl_tls13_parse_encrypted_extensions()
1470 extensions_len = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_encrypted_extensions()
1471 p += 2; in ssl_tls13_parse_encrypted_extensions()
1473 MBEDTLS_SSL_DEBUG_BUF( 3, "encrypted extensions", p, extensions_len ); in ssl_tls13_parse_encrypted_extensions()
1474 extensions_end = p + extensions_len; in ssl_tls13_parse_encrypted_extensions()
1475 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, extensions_len ); in ssl_tls13_parse_encrypted_extensions()
1477 while( p < extensions_end ) in ssl_tls13_parse_encrypted_extensions()
1488 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, extensions_end, 4 ); in ssl_tls13_parse_encrypted_extensions()
1489 extension_type = MBEDTLS_GET_UINT16_BE( p, 0 ); in ssl_tls13_parse_encrypted_extensions()
1490 extension_data_len = MBEDTLS_GET_UINT16_BE( p, 2 ); in ssl_tls13_parse_encrypted_extensions()
1491 p += 4; in ssl_tls13_parse_encrypted_extensions()
1493 MBEDTLS_SSL_CHK_BUF_READ_PTR( p, extensions_end, extension_data_len ); in ssl_tls13_parse_encrypted_extensions()
1515 p += extension_data_len; in ssl_tls13_parse_encrypted_extensions()
1519 if( p != end ) in ssl_tls13_parse_encrypted_extensions()