Lines Matching refs:p
31 unsigned char *p = buf; in ssl_write_hostname_ext() local
47 MBEDTLS_SSL_CHK_BUF_PTR(p, end, hostname_len + 9); in ssl_write_hostname_ext()
75 MBEDTLS_PUT_UINT16_BE(MBEDTLS_TLS_EXT_SERVERNAME, p, 0); in ssl_write_hostname_ext()
76 p += 2; in ssl_write_hostname_ext()
78 MBEDTLS_PUT_UINT16_BE(hostname_len + 5, p, 0); in ssl_write_hostname_ext()
79 p += 2; in ssl_write_hostname_ext()
81 MBEDTLS_PUT_UINT16_BE(hostname_len + 3, p, 0); in ssl_write_hostname_ext()
82 p += 2; in ssl_write_hostname_ext()
84 *p++ = MBEDTLS_BYTE_0(MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME); in ssl_write_hostname_ext()
86 MBEDTLS_PUT_UINT16_BE(hostname_len, p, 0); in ssl_write_hostname_ext()
87 p += 2; in ssl_write_hostname_ext()
89 memcpy(p, hostname, hostname_len); in ssl_write_hostname_ext()
120 unsigned char *p = buf; in ssl_write_alpn_ext() local
134 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 6); in ssl_write_alpn_ext()
135 MBEDTLS_PUT_UINT16_BE(MBEDTLS_TLS_EXT_ALPN, p, 0); in ssl_write_alpn_ext()
137 p += 6; in ssl_write_alpn_ext()
153 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 1 + protocol_name_len); in ssl_write_alpn_ext()
154 *p++ = (unsigned char) protocol_name_len; in ssl_write_alpn_ext()
155 memcpy(p, *cur, protocol_name_len); in ssl_write_alpn_ext()
156 p += protocol_name_len; in ssl_write_alpn_ext()
159 *out_len = (size_t) (p - buf); in ssl_write_alpn_ext()
224 unsigned char *p = buf; in ssl_write_supported_groups_ext() local
238 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 6); in ssl_write_supported_groups_ext()
239 p += 6; in ssl_write_supported_groups_ext()
241 named_group_list = p; in ssl_write_supported_groups_ext()
279 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_supported_groups_ext()
280 MBEDTLS_PUT_UINT16_BE(*group_list, p, 0); in ssl_write_supported_groups_ext()
281 p += 2; in ssl_write_supported_groups_ext()
289 named_group_list_len = (size_t) (p - named_group_list); in ssl_write_supported_groups_ext()
305 *out_len = (size_t) (p - buf); in ssl_write_supported_groups_ext()
325 unsigned char *p = buf; in ssl_write_client_hello_cipher_suites() local
344 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_cipher_suites()
345 p += 2; in ssl_write_client_hello_cipher_suites()
350 cipher_suites = p; in ssl_write_client_hello_cipher_suites()
375 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_cipher_suites()
376 MBEDTLS_PUT_UINT16_BE(cipher_suite, p, 0); in ssl_write_client_hello_cipher_suites()
377 p += 2; in ssl_write_client_hello_cipher_suites()
389 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_cipher_suites()
390 MBEDTLS_PUT_UINT16_BE(MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO, p, 0); in ssl_write_client_hello_cipher_suites()
391 p += 2; in ssl_write_client_hello_cipher_suites()
395 cipher_suites_len = (size_t) (p - cipher_suites); in ssl_write_client_hello_cipher_suites()
402 *out_len = (size_t) (p - buf); in ssl_write_client_hello_cipher_suites()
445 unsigned char *p = buf; in ssl_write_client_hello_body() local
472 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_body()
473 mbedtls_ssl_write_version(p, ssl->conf->transport, in ssl_write_client_hello_body()
475 p += 2; in ssl_write_client_hello_body()
485 MBEDTLS_SSL_CHK_BUF_PTR(p, end, MBEDTLS_CLIENT_HELLO_RANDOM_LEN); in ssl_write_client_hello_body()
486 memcpy(p, handshake->randbytes, MBEDTLS_CLIENT_HELLO_RANDOM_LEN); in ssl_write_client_hello_body()
488 p, MBEDTLS_CLIENT_HELLO_RANDOM_LEN); in ssl_write_client_hello_body()
489 p += MBEDTLS_CLIENT_HELLO_RANDOM_LEN; in ssl_write_client_hello_body()
507 MBEDTLS_SSL_CHK_BUF_PTR(p, end, ssl->session_negotiate->id_len + 1); in ssl_write_client_hello_body()
508 *p++ = (unsigned char) ssl->session_negotiate->id_len; in ssl_write_client_hello_body()
509 memcpy(p, ssl->session_negotiate->id, ssl->session_negotiate->id_len); in ssl_write_client_hello_body()
510 p += ssl->session_negotiate->id_len; in ssl_write_client_hello_body()
535 MBEDTLS_SSL_CHK_BUF_PTR(p, end, cookie_len + 1); in ssl_write_client_hello_body()
536 *p++ = (unsigned char) cookie_len; in ssl_write_client_hello_body()
538 memcpy(p, handshake->cookie, cookie_len); in ssl_write_client_hello_body()
539 p += cookie_len; in ssl_write_client_hello_body()
545 ret = ssl_write_client_hello_cipher_suites(ssl, p, end, in ssl_write_client_hello_body()
551 p += output_len; in ssl_write_client_hello_body()
563 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_body()
564 *p++ = 1; in ssl_write_client_hello_body()
565 *p++ = MBEDTLS_SSL_COMPRESS_NULL; in ssl_write_client_hello_body()
575 MBEDTLS_SSL_CHK_BUF_PTR(p, end, 2); in ssl_write_client_hello_body()
576 p_extensions_len = p; in ssl_write_client_hello_body()
577 p += 2; in ssl_write_client_hello_body()
581 ret = ssl_write_hostname_ext(ssl, p, end, &output_len); in ssl_write_client_hello_body()
585 p += output_len; in ssl_write_client_hello_body()
589 ret = ssl_write_alpn_ext(ssl, p, end, &output_len); in ssl_write_client_hello_body()
593 p += output_len; in ssl_write_client_hello_body()
598 ret = mbedtls_ssl_tls13_write_client_hello_exts(ssl, p, end, in ssl_write_client_hello_body()
603 p += output_len; in ssl_write_client_hello_body()
625 ret = ssl_write_supported_groups_ext(ssl, p, end, in ssl_write_client_hello_body()
631 p += output_len; in ssl_write_client_hello_body()
648 ret = mbedtls_ssl_write_sig_alg_ext(ssl, p, end, &output_len); in ssl_write_client_hello_body()
652 p += output_len; in ssl_write_client_hello_body()
658 ret = mbedtls_ssl_tls12_write_client_hello_exts(ssl, p, end, in ssl_write_client_hello_body()
664 p += output_len; in ssl_write_client_hello_body()
674 ssl, p, end, &output_len, binders_len); in ssl_write_client_hello_body()
678 p += output_len; in ssl_write_client_hello_body()
683 extensions_len = (size_t) (p - p_extensions_len) - 2; in ssl_write_client_hello_body()
686 p = p_extensions_len; in ssl_write_client_hello_body()
695 *out_len = (size_t) (p - buf); in ssl_write_client_hello_body()