Lines Matching refs:buf

80                                      const unsigned char *buf,  in ssl_parse_servername_ext()  argument
96 servername_list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_servername_ext()
105 p = buf + 2; in ssl_parse_servername_ext()
190 const unsigned char *buf, in ssl_parse_renegotiation_info() argument
198 buf[0] != ssl->verify_data_len || in ssl_parse_renegotiation_info()
199 mbedtls_ssl_safer_memcmp( buf + 1, ssl->peer_verify_data, in ssl_parse_renegotiation_info()
211 if( len != 1 || buf[0] != 0x0 ) in ssl_parse_renegotiation_info()
241 const unsigned char *buf, in ssl_parse_signature_algorithms_ext() argument
247 const unsigned char *end = buf + len; in ssl_parse_signature_algorithms_ext()
258 sig_alg_list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_signature_algorithms_ext()
277 for( p = buf + 2; p < end; p += 2 ) in ssl_parse_signature_algorithms_ext()
319 const unsigned char *buf, in ssl_parse_supported_elliptic_curves() argument
332 list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_supported_elliptic_curves()
366 p = buf + 2; in ssl_parse_supported_elliptic_curves()
385 const unsigned char *buf, in ssl_parse_supported_point_formats() argument
391 if( len == 0 || (size_t)( buf[0] + 1 ) != len ) in ssl_parse_supported_point_formats()
398 list_size = buf[0]; in ssl_parse_supported_point_formats()
400 p = buf + 1; in ssl_parse_supported_point_formats()
427 const unsigned char *buf, in ssl_parse_ecjpake_kkpp() argument
439 buf, len ) ) != 0 ) in ssl_parse_ecjpake_kkpp()
456 const unsigned char *buf, in ssl_parse_max_fragment_length_ext() argument
459 if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID ) in ssl_parse_max_fragment_length_ext()
467 ssl->session_negotiate->mfl_code = buf[0]; in ssl_parse_max_fragment_length_ext()
475 const unsigned char *buf, in ssl_parse_cid_ext() argument
506 peer_cid_len = *buf++; in ssl_parse_cid_ext()
536 memcpy( ssl->handshake->peer_cid, buf, peer_cid_len ); in ssl_parse_cid_ext()
539 MBEDTLS_SSL_DEBUG_BUF( 3, "Client CID", buf, peer_cid_len ); in ssl_parse_cid_ext()
547 const unsigned char *buf, in ssl_parse_truncated_hmac_ext() argument
558 ((void) buf); in ssl_parse_truncated_hmac_ext()
569 const unsigned char *buf, in ssl_parse_encrypt_then_mac_ext() argument
580 ((void) buf); in ssl_parse_encrypt_then_mac_ext()
594 const unsigned char *buf, in ssl_parse_extended_ms_ext() argument
605 ((void) buf); in ssl_parse_extended_ms_ext()
619 unsigned char *buf, in ssl_parse_session_ticket_ext() argument
653 buf, len ) ) != 0 ) in ssl_parse_session_ticket_ext()
693 const unsigned char *buf, size_t len ) in ssl_parse_alpn_ext() argument
719 list_len = ( buf[0] << 8 ) | buf[1]; in ssl_parse_alpn_ext()
730 start = buf + 2; in ssl_parse_alpn_ext()
731 end = buf + len; in ssl_parse_alpn_ext()
781 const unsigned char *buf, in ssl_parse_use_srtp_ext() argument
826 profile_length = ( buf[0] << 8 ) | buf[1]; in ssl_parse_use_srtp_ext()
827 buf += 2; in ssl_parse_use_srtp_ext()
843 uint16_t protection_profile_value = buf[j] << 8 | buf[j + 1]; in ssl_parse_use_srtp_ext()
871 buf += profile_length; /* buf points to the mki length */ in ssl_parse_use_srtp_ext()
872 mki_length = *buf; in ssl_parse_use_srtp_ext()
873 buf++; in ssl_parse_use_srtp_ext()
889 memcpy( ssl->dtls_srtp_info.mki_value, buf, mki_length ); in ssl_parse_use_srtp_ext()
1154 unsigned char *buf, *p; in ssl_parse_client_hello_v2() local
1170 buf = ssl->in_hdr; in ssl_parse_client_hello_v2()
1172 MBEDTLS_SSL_DEBUG_BUF( 4, "record header", buf, 5 ); in ssl_parse_client_hello_v2()
1175 buf[2] ) ); in ssl_parse_client_hello_v2()
1177 ( ( buf[0] & 0x7F ) << 8 ) | buf[1] ) ); in ssl_parse_client_hello_v2()
1179 buf[3], buf[4] ) ); in ssl_parse_client_hello_v2()
1191 if( buf[2] != MBEDTLS_SSL_HS_CLIENT_HELLO || in ssl_parse_client_hello_v2()
1192 buf[3] != MBEDTLS_SSL_MAJOR_VERSION_3 ) in ssl_parse_client_hello_v2()
1198 n = ( ( buf[0] << 8 ) | buf[1] ) & 0x7FFF; in ssl_parse_client_hello_v2()
1207 ssl->minor_ver = ( buf[4] <= ssl->conf->max_minor_ver ) in ssl_parse_client_hello_v2()
1208 ? buf[4] : ssl->conf->max_minor_ver; in ssl_parse_client_hello_v2()
1222 ssl->handshake->max_major_ver = buf[3]; in ssl_parse_client_hello_v2()
1223 ssl->handshake->max_minor_ver = buf[4]; in ssl_parse_client_hello_v2()
1231 ssl->handshake->update_checksum( ssl, buf + 2, n ); in ssl_parse_client_hello_v2()
1233 buf = ssl->in_msg; in ssl_parse_client_hello_v2()
1244 MBEDTLS_SSL_DEBUG_BUF( 4, "record contents", buf, n ); in ssl_parse_client_hello_v2()
1246 ciph_len = ( buf[0] << 8 ) | buf[1]; in ssl_parse_client_hello_v2()
1247 sess_len = ( buf[2] << 8 ) | buf[3]; in ssl_parse_client_hello_v2()
1248 chal_len = ( buf[4] << 8 ) | buf[5]; in ssl_parse_client_hello_v2()
1281 buf + 6, ciph_len ); in ssl_parse_client_hello_v2()
1283 buf + 6 + ciph_len, sess_len ); in ssl_parse_client_hello_v2()
1285 buf + 6 + ciph_len + sess_len, chal_len ); in ssl_parse_client_hello_v2()
1287 p = buf + 6 + ciph_len; in ssl_parse_client_hello_v2()
1300 for( i = 0, p = buf + 6; i < ciph_len; i += 3, p += 3 ) in ssl_parse_client_hello_v2()
1322 for( i = 0, p = buf + 6; i < ciph_len; i += 3, p += 3 ) in ssl_parse_client_hello_v2()
1349 for( j = 0, p = buf + 6; j < ciph_len; j += 3, p += 3 ) in ssl_parse_client_hello_v2()
1353 for( j = 0, p = buf + 6; j < ciph_len; j += 3, p += 3 ) in ssl_parse_client_hello_v2()
1422 unsigned char *buf, *p, *ext; in ssl_parse_client_hello() local
1462 buf = ssl->in_hdr; in ssl_parse_client_hello()
1468 if( ( buf[0] & 0x80 ) != 0 ) in ssl_parse_client_hello()
1472 MBEDTLS_SSL_DEBUG_BUF( 4, "record header", buf, mbedtls_ssl_in_hdr_len( ssl ) ); in ssl_parse_client_hello()
1484 buf[0] ) ); in ssl_parse_client_hello()
1486 if( buf[0] != MBEDTLS_SSL_MSG_HANDSHAKE ) in ssl_parse_client_hello()
1496 buf[1], buf[2] ) ); in ssl_parse_client_hello()
1498 mbedtls_ssl_read_version( &major, &minor, ssl->conf->transport, buf + 1 ); in ssl_parse_client_hello()
1576 buf = ssl->in_msg; in ssl_parse_client_hello()
1578 MBEDTLS_SSL_DEBUG_BUF( 4, "record contents", buf, msg_len ); in ssl_parse_client_hello()
1580 ssl->handshake->update_checksum( ssl, buf, msg_len ); in ssl_parse_client_hello()
1596 MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello v3, handshake type: %d", buf[0] ) ); in ssl_parse_client_hello()
1598 if( buf[0] != MBEDTLS_SSL_HS_CLIENT_HELLO ) in ssl_parse_client_hello()
1605 ( buf[1] << 16 ) | ( buf[2] << 8 ) | buf[3] ) ); in ssl_parse_client_hello()
1608 if( buf[1] != 0 || in ssl_parse_client_hello()
1609 msg_len != mbedtls_ssl_hs_hdr_len( ssl ) + ( ( buf[2] << 8 ) | buf[3] ) ) in ssl_parse_client_hello()
1661 buf += mbedtls_ssl_hs_hdr_len( ssl ); in ssl_parse_client_hello()
1694 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, version", buf, 2 ); in ssl_parse_client_hello()
1697 ssl->conf->transport, buf ); in ssl_parse_client_hello()
1725 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes", buf + 2, 32 ); in ssl_parse_client_hello()
1727 memcpy( ssl->handshake->randbytes, buf + 2, 32 ); in ssl_parse_client_hello()
1732 sess_len = buf[34]; in ssl_parse_client_hello()
1743 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, session id", buf + 35, sess_len ); in ssl_parse_client_hello()
1748 memcpy( ssl->session_negotiate->id, buf + 35, in ssl_parse_client_hello()
1758 cookie_len = buf[cookie_offset]; in ssl_parse_client_hello()
1769 buf + cookie_offset + 1, cookie_len ); in ssl_parse_client_hello()
1779 buf + cookie_offset + 1, cookie_len, in ssl_parse_client_hello()
1814 ciph_len = ( buf[ciph_offset + 0] << 8 ) in ssl_parse_client_hello()
1815 | ( buf[ciph_offset + 1] ); in ssl_parse_client_hello()
1828 buf + ciph_offset + 2, ciph_len ); in ssl_parse_client_hello()
1835 comp_len = buf[comp_offset]; in ssl_parse_client_hello()
1848 buf + comp_offset + 1, comp_len ); in ssl_parse_client_hello()
1854 if( buf[comp_offset + 1 + i] == MBEDTLS_SSL_COMPRESS_DEFLATE ) in ssl_parse_client_hello()
1887 ext_len = ( buf[ext_offset + 0] << 8 ) in ssl_parse_client_hello()
1888 | ( buf[ext_offset + 1] ); in ssl_parse_client_hello()
1901 ext = buf + ext_offset + 2; in ssl_parse_client_hello()
2087 for( i = 0, p = buf + ciph_offset + 2; i < ciph_len; i += 2, p += 2 ) in ssl_parse_client_hello()
2132 for( i = 0, p = buf + ciph_offset + 2; i < ciph_len; i += 2, p += 2 ) in ssl_parse_client_hello()
2201 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 ) in ssl_parse_client_hello()
2205 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 ) in ssl_parse_client_hello()
2280 unsigned char *buf, in ssl_write_truncated_hmac_ext() argument
2283 unsigned char *p = buf; in ssl_write_truncated_hmac_ext()
2305 unsigned char *buf, in ssl_write_cid_ext() argument
2308 unsigned char *p = buf; in ssl_write_cid_ext()
2353 unsigned char *buf, in ssl_write_encrypt_then_mac_ext() argument
2356 unsigned char *p = buf; in ssl_write_encrypt_then_mac_ext()
2396 unsigned char *buf, in ssl_write_extended_ms_ext() argument
2399 unsigned char *p = buf; in ssl_write_extended_ms_ext()
2423 unsigned char *buf, in ssl_write_session_ticket_ext() argument
2426 unsigned char *p = buf; in ssl_write_session_ticket_ext()
2447 unsigned char *buf, in ssl_write_renegotiation_ext() argument
2450 unsigned char *p = buf; in ssl_write_renegotiation_ext()
2483 *olen = p - buf; in ssl_write_renegotiation_ext()
2488 unsigned char *buf, in ssl_write_max_fragment_length_ext() argument
2491 unsigned char *p = buf; in ssl_write_max_fragment_length_ext()
2516 unsigned char *buf, in ssl_write_supported_point_formats_ext() argument
2519 unsigned char *p = buf; in ssl_write_supported_point_formats_ext()
2546 unsigned char *buf, in ssl_write_ecjpake_kkpp_ext() argument
2550 unsigned char *p = buf; in ssl_write_ecjpake_kkpp_ext()
2590 unsigned char *buf, size_t *olen ) in ssl_write_alpn_ext() argument
2607 buf[0] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN >> 8 ) & 0xFF ); in ssl_write_alpn_ext()
2608 buf[1] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN ) & 0xFF ); in ssl_write_alpn_ext()
2612 buf[2] = (unsigned char)( ( ( *olen - 4 ) >> 8 ) & 0xFF ); in ssl_write_alpn_ext()
2613 buf[3] = (unsigned char)( ( ( *olen - 4 ) ) & 0xFF ); in ssl_write_alpn_ext()
2615 buf[4] = (unsigned char)( ( ( *olen - 6 ) >> 8 ) & 0xFF ); in ssl_write_alpn_ext()
2616 buf[5] = (unsigned char)( ( ( *olen - 6 ) ) & 0xFF ); in ssl_write_alpn_ext()
2618 buf[6] = (unsigned char)( ( ( *olen - 7 ) ) & 0xFF ); in ssl_write_alpn_ext()
2620 memcpy( buf + 7, ssl->alpn_chosen, *olen - 7 ); in ssl_write_alpn_ext()
2626 unsigned char *buf, in ssl_write_use_srtp_ext() argument
2656 if( (size_t)( end - buf ) < mki_len + 9 ) in ssl_write_use_srtp_ext()
2663 buf[0] = (unsigned char)( ( MBEDTLS_TLS_EXT_USE_SRTP >> 8 ) & 0xFF ); in ssl_write_use_srtp_ext()
2664 buf[1] = (unsigned char)( ( MBEDTLS_TLS_EXT_USE_SRTP ) & 0xFF ); in ssl_write_use_srtp_ext()
2670 buf[2] = (unsigned char)( ( ext_len >> 8 ) & 0xFF ); in ssl_write_use_srtp_ext()
2671 buf[3] = (unsigned char)( ext_len & 0xFF ); in ssl_write_use_srtp_ext()
2674 buf[4] = 0x00; in ssl_write_use_srtp_ext()
2675 buf[5] = 0x02; in ssl_write_use_srtp_ext()
2680 buf[6] = (unsigned char)( ( profile_value >> 8 ) & 0xFF ); in ssl_write_use_srtp_ext()
2681 buf[7] = (unsigned char)( profile_value & 0xFF ); in ssl_write_use_srtp_ext()
2689 buf[8] = mki_len & 0xFF; in ssl_write_use_srtp_ext()
2690 memcpy( &buf[9], ssl->dtls_srtp_info.mki_value, mki_len ); in ssl_write_use_srtp_ext()
2824 unsigned char *buf, *p; in ssl_write_server_hello() local
2852 buf = ssl->out_msg; in ssl_write_server_hello()
2853 p = buf + 4; in ssl_write_server_hello()
2860 buf[4], buf[5] ) ); in ssl_write_server_hello()
2883 memcpy( ssl->handshake->randbytes + 32, buf + 6, 32 ); in ssl_write_server_hello()
2885 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, random bytes", buf + 6, 32 ); in ssl_write_server_hello()
2944 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, session id", buf + 39, n ); in ssl_write_server_hello()
3038 ssl->out_msglen = p - buf; in ssl_write_server_hello()
3075 unsigned char *buf, *p; in ssl_write_certificate_request() local
3110 buf = ssl->out_msg; in ssl_write_certificate_request()
3111 p = buf + 4; in ssl_write_certificate_request()
3223 ssl->out_msglen = p - buf; in ssl_write_certificate_request()