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()
428 const unsigned char *buf, in ssl_parse_ecjpake_kkpp() argument
440 buf, len ) ) != 0 ) in ssl_parse_ecjpake_kkpp()
457 const unsigned char *buf, in ssl_parse_max_fragment_length_ext() argument
460 if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID ) in ssl_parse_max_fragment_length_ext()
468 ssl->session_negotiate->mfl_code = buf[0]; in ssl_parse_max_fragment_length_ext()
476 const unsigned char *buf, in ssl_parse_cid_ext() argument
507 peer_cid_len = *buf++; in ssl_parse_cid_ext()
537 memcpy( ssl->handshake->peer_cid, buf, peer_cid_len ); in ssl_parse_cid_ext()
540 MBEDTLS_SSL_DEBUG_BUF( 3, "Client CID", buf, peer_cid_len ); in ssl_parse_cid_ext()
548 const unsigned char *buf, in ssl_parse_encrypt_then_mac_ext() argument
559 ((void) buf); in ssl_parse_encrypt_then_mac_ext()
572 const unsigned char *buf, in ssl_parse_extended_ms_ext() argument
583 ((void) buf); in ssl_parse_extended_ms_ext()
596 unsigned char *buf, in ssl_parse_session_ticket_ext() argument
630 buf, len ) ) != 0 ) in ssl_parse_session_ticket_ext()
670 const unsigned char *buf, size_t len ) in ssl_parse_alpn_ext() argument
696 list_len = ( buf[0] << 8 ) | buf[1]; in ssl_parse_alpn_ext()
707 start = buf + 2; in ssl_parse_alpn_ext()
708 end = buf + len; in ssl_parse_alpn_ext()
758 const unsigned char *buf, in ssl_parse_use_srtp_ext() argument
803 profile_length = ( buf[0] << 8 ) | buf[1]; in ssl_parse_use_srtp_ext()
804 buf += 2; in ssl_parse_use_srtp_ext()
820 uint16_t protection_profile_value = buf[j] << 8 | buf[j + 1]; in ssl_parse_use_srtp_ext()
848 buf += profile_length; /* buf points to the mki length */ in ssl_parse_use_srtp_ext()
849 mki_length = *buf; in ssl_parse_use_srtp_ext()
850 buf++; in ssl_parse_use_srtp_ext()
866 memcpy( ssl->dtls_srtp_info.mki_value, buf, mki_length ); in ssl_parse_use_srtp_ext()
1127 unsigned char *buf, *p, *ext; in ssl_parse_client_hello() local
1167 buf = ssl->in_hdr; in ssl_parse_client_hello()
1169 MBEDTLS_SSL_DEBUG_BUF( 4, "record header", buf, mbedtls_ssl_in_hdr_len( ssl ) ); in ssl_parse_client_hello()
1181 buf[0] ) ); in ssl_parse_client_hello()
1183 if( buf[0] != MBEDTLS_SSL_MSG_HANDSHAKE ) in ssl_parse_client_hello()
1193 buf[1], buf[2] ) ); in ssl_parse_client_hello()
1195 mbedtls_ssl_read_version( &major, &minor, ssl->conf->transport, buf + 1 ); in ssl_parse_client_hello()
1274 buf = ssl->in_msg; in ssl_parse_client_hello()
1276 MBEDTLS_SSL_DEBUG_BUF( 4, "record contents", buf, msg_len ); in ssl_parse_client_hello()
1278 ssl->handshake->update_checksum( ssl, buf, msg_len ); in ssl_parse_client_hello()
1294 MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello v3, handshake type: %d", buf[0] ) ); in ssl_parse_client_hello()
1296 if( buf[0] != MBEDTLS_SSL_HS_CLIENT_HELLO ) in ssl_parse_client_hello()
1303 ( buf[1] << 16 ) | ( buf[2] << 8 ) | buf[3] ) ); in ssl_parse_client_hello()
1306 if( buf[1] != 0 || in ssl_parse_client_hello()
1307 msg_len != mbedtls_ssl_hs_hdr_len( ssl ) + ( ( buf[2] << 8 ) | buf[3] ) ) in ssl_parse_client_hello()
1359 buf += mbedtls_ssl_hs_hdr_len( ssl ); in ssl_parse_client_hello()
1392 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, version", buf, 2 ); in ssl_parse_client_hello()
1395 ssl->conf->transport, buf ); in ssl_parse_client_hello()
1424 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes", buf + 2, 32 ); in ssl_parse_client_hello()
1426 memcpy( ssl->handshake->randbytes, buf + 2, 32 ); in ssl_parse_client_hello()
1431 sess_len = buf[34]; in ssl_parse_client_hello()
1442 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, session id", buf + 35, sess_len ); in ssl_parse_client_hello()
1447 memcpy( ssl->session_negotiate->id, buf + 35, in ssl_parse_client_hello()
1457 cookie_len = buf[cookie_offset]; in ssl_parse_client_hello()
1468 buf + cookie_offset + 1, cookie_len ); in ssl_parse_client_hello()
1478 buf + cookie_offset + 1, cookie_len, in ssl_parse_client_hello()
1513 ciph_len = ( buf[ciph_offset + 0] << 8 ) in ssl_parse_client_hello()
1514 | ( buf[ciph_offset + 1] ); in ssl_parse_client_hello()
1527 buf + ciph_offset + 2, ciph_len ); in ssl_parse_client_hello()
1534 comp_len = buf[comp_offset]; in ssl_parse_client_hello()
1547 buf + comp_offset + 1, comp_len ); in ssl_parse_client_hello()
1569 ext_len = ( buf[ext_offset + 0] << 8 ) in ssl_parse_client_hello()
1570 | ( buf[ext_offset + 1] ); in ssl_parse_client_hello()
1583 ext = buf + ext_offset + 2; in ssl_parse_client_hello()
1778 for( i = 0, p = buf + ciph_offset + 2; i < ciph_len; i += 2, p += 2 ) in ssl_parse_client_hello()
1849 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 ) in ssl_parse_client_hello()
1866 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 ) in ssl_parse_client_hello()
1940 unsigned char *buf, in ssl_write_cid_ext() argument
1943 unsigned char *p = buf; in ssl_write_cid_ext()
1987 unsigned char *buf, in ssl_write_encrypt_then_mac_ext() argument
1990 unsigned char *p = buf; in ssl_write_encrypt_then_mac_ext()
2029 unsigned char *buf, in ssl_write_extended_ms_ext() argument
2032 unsigned char *p = buf; in ssl_write_extended_ms_ext()
2055 unsigned char *buf, in ssl_write_session_ticket_ext() argument
2058 unsigned char *p = buf; in ssl_write_session_ticket_ext()
2079 unsigned char *buf, in ssl_write_renegotiation_ext() argument
2082 unsigned char *p = buf; in ssl_write_renegotiation_ext()
2115 *olen = p - buf; in ssl_write_renegotiation_ext()
2120 unsigned char *buf, in ssl_write_max_fragment_length_ext() argument
2123 unsigned char *p = buf; in ssl_write_max_fragment_length_ext()
2148 unsigned char *buf, in ssl_write_supported_point_formats_ext() argument
2151 unsigned char *p = buf; in ssl_write_supported_point_formats_ext()
2178 unsigned char *buf, in ssl_write_ecjpake_kkpp_ext() argument
2182 unsigned char *p = buf; in ssl_write_ecjpake_kkpp_ext()
2222 unsigned char *buf, size_t *olen ) in ssl_write_alpn_ext() argument
2239 MBEDTLS_PUT_UINT16_BE( MBEDTLS_TLS_EXT_ALPN, buf, 0); in ssl_write_alpn_ext()
2243 MBEDTLS_PUT_UINT16_BE( *olen - 4, buf, 2 ); in ssl_write_alpn_ext()
2245 MBEDTLS_PUT_UINT16_BE( *olen - 6, buf, 4 ); in ssl_write_alpn_ext()
2247 buf[6] = MBEDTLS_BYTE_0( *olen - 7 ); in ssl_write_alpn_ext()
2249 memcpy( buf + 7, ssl->alpn_chosen, *olen - 7 ); in ssl_write_alpn_ext()
2255 unsigned char *buf, in ssl_write_use_srtp_ext() argument
2285 if( (size_t)( end - buf ) < mki_len + 9 ) in ssl_write_use_srtp_ext()
2292 MBEDTLS_PUT_UINT16_BE(MBEDTLS_TLS_EXT_USE_SRTP, buf, 0 ); in ssl_write_use_srtp_ext()
2298 MBEDTLS_PUT_UINT16_BE( ext_len, buf, 2 ); in ssl_write_use_srtp_ext()
2301 buf[4] = 0x00; in ssl_write_use_srtp_ext()
2302 buf[5] = 0x02; in ssl_write_use_srtp_ext()
2307 MBEDTLS_PUT_UINT16_BE( profile_value, buf, 6 ); in ssl_write_use_srtp_ext()
2315 buf[8] = mki_len & 0xFF; in ssl_write_use_srtp_ext()
2316 memcpy( &buf[9], ssl->dtls_srtp_info.mki_value, mki_len ); in ssl_write_use_srtp_ext()
2449 unsigned char *buf, *p; in ssl_write_server_hello() local
2477 buf = ssl->out_msg; in ssl_write_server_hello()
2478 p = buf + 4; in ssl_write_server_hello()
2485 buf[4], buf[5] ) ); in ssl_write_server_hello()
2506 memcpy( ssl->handshake->randbytes + 32, buf + 6, 32 ); in ssl_write_server_hello()
2508 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, random bytes", buf + 6, 32 ); in ssl_write_server_hello()
2567 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, session id", buf + 39, n ); in ssl_write_server_hello()
2645 ssl->out_msglen = p - buf; in ssl_write_server_hello()
2682 unsigned char *buf, *p; in ssl_write_certificate_request() local
2717 buf = ssl->out_msg; in ssl_write_certificate_request()
2718 p = buf + 4; in ssl_write_certificate_request()
2829 ssl->out_msglen = p - buf; in ssl_write_certificate_request()