Lines Matching refs:buf

91                                      const unsigned char *buf,  in ssl_parse_servername_ext()  argument
100 servername_list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_servername_ext()
107 p = buf + 2; in ssl_parse_servername_ext()
146 const unsigned char *buf, in ssl_parse_renegotiation_info() argument
156 buf[0] != ssl->verify_data_len || in ssl_parse_renegotiation_info()
157 mbedtls_ssl_safer_memcmp( buf + 1, ssl->peer_verify_data, in ssl_parse_renegotiation_info()
171 if( len != 1 || buf[0] != 0x0 ) in ssl_parse_renegotiation_info()
190 const unsigned char *buf, in ssl_parse_signature_algorithms_ext() argument
195 const unsigned char *end = buf + len; in ssl_parse_signature_algorithms_ext()
199 sig_alg_list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_signature_algorithms_ext()
214 for( p = buf + 2; p < end; p += 2 ) { in ssl_parse_signature_algorithms_ext()
238 const unsigned char *buf, in ssl_parse_supported_elliptic_curves() argument
245 list_size = ( ( buf[0] << 8 ) | ( buf[1] ) ); in ssl_parse_supported_elliptic_curves()
271 p = buf + 2; in ssl_parse_supported_elliptic_curves()
290 const unsigned char *buf, in ssl_parse_supported_point_formats() argument
296 list_size = buf[0]; in ssl_parse_supported_point_formats()
303 p = buf + 1; in ssl_parse_supported_point_formats()
330 const unsigned char *buf, in ssl_parse_ecjpake_kkpp() argument
342 buf, len ) ) != 0 ) in ssl_parse_ecjpake_kkpp()
357 const unsigned char *buf, in ssl_parse_max_fragment_length_ext() argument
360 if( len != 1 || buf[0] >= MBEDTLS_SSL_MAX_FRAG_LEN_INVALID ) in ssl_parse_max_fragment_length_ext()
366 ssl->session_negotiate->mfl_code = buf[0]; in ssl_parse_max_fragment_length_ext()
374 const unsigned char *buf, in ssl_parse_truncated_hmac_ext() argument
383 ((void) buf); in ssl_parse_truncated_hmac_ext()
394 const unsigned char *buf, in ssl_parse_encrypt_then_mac_ext() argument
403 ((void) buf); in ssl_parse_encrypt_then_mac_ext()
417 const unsigned char *buf, in ssl_parse_extended_ms_ext() argument
426 ((void) buf); in ssl_parse_extended_ms_ext()
440 unsigned char *buf, in ssl_parse_session_ticket_ext() argument
474 buf, len ) ) != 0 ) in ssl_parse_session_ticket_ext()
514 const unsigned char *buf, size_t len ) in ssl_parse_alpn_ext() argument
536 list_len = ( buf[0] << 8 ) | buf[1]; in ssl_parse_alpn_ext()
543 start = buf + 2; in ssl_parse_alpn_ext()
544 end = buf + len; in ssl_parse_alpn_ext()
806 unsigned char *buf, *p; local
824 buf = ssl->in_hdr;
826 MBEDTLS_SSL_DEBUG_BUF( 4, "record header", buf, 5 );
829 buf[2] ) );
831 ( ( buf[0] & 0x7F ) << 8 ) | buf[1] ) );
833 buf[3], buf[4] ) );
845 if( buf[2] != MBEDTLS_SSL_HS_CLIENT_HELLO ||
846 buf[3] != MBEDTLS_SSL_MAJOR_VERSION_3 )
852 n = ( ( buf[0] << 8 ) | buf[1] ) & 0x7FFF;
861 ssl->minor_ver = ( buf[4] <= ssl->conf->max_minor_ver )
862 ? buf[4] : ssl->conf->max_minor_ver;
876 ssl->handshake->max_major_ver = buf[3];
877 ssl->handshake->max_minor_ver = buf[4];
885 ssl->handshake->update_checksum( ssl, buf + 2, n );
887 buf = ssl->in_msg;
898 MBEDTLS_SSL_DEBUG_BUF( 4, "record contents", buf, n );
900 ciph_len = ( buf[0] << 8 ) | buf[1];
901 sess_len = ( buf[2] << 8 ) | buf[3];
902 chal_len = ( buf[4] << 8 ) | buf[5];
935 buf + 6, ciph_len );
937 buf + 6 + ciph_len, sess_len );
939 buf + 6 + ciph_len + sess_len, chal_len );
941 p = buf + 6 + ciph_len;
954 for( i = 0, p = buf + 6; i < ciph_len; i += 3, p += 3 )
977 for( i = 0, p = buf + 6; i < ciph_len; i += 3, p += 3 )
1004 for( j = 0, p = buf + 6; j < ciph_len; j += 3, p += 3 )
1010 for( j = 0, p = buf + 6; j < ciph_len; j += 3, p += 3 )
1079 unsigned char *buf, *p, *ext; local
1109 buf = ssl->in_hdr;
1115 if( ( buf[0] & 0x80 ) != 0 )
1119 MBEDTLS_SSL_DEBUG_BUF( 4, "record header", buf, mbedtls_ssl_hdr_len( ssl ) );
1131 buf[0] ) );
1133 if( buf[0] != MBEDTLS_SSL_MSG_HANDSHAKE )
1143 buf[1], buf[2] ) );
1145 mbedtls_ssl_read_version( &major, &minor, ssl->conf->transport, buf + 1 );
1222 buf = ssl->in_msg;
1224 MBEDTLS_SSL_DEBUG_BUF( 4, "record contents", buf, msg_len );
1226 ssl->handshake->update_checksum( ssl, buf, msg_len );
1242 MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello v3, handshake type: %d", buf[0] ) );
1244 if( buf[0] != MBEDTLS_SSL_HS_CLIENT_HELLO )
1251 ( buf[1] << 16 ) | ( buf[2] << 8 ) | buf[3] ) );
1254 if( buf[1] != 0 ||
1255 msg_len != mbedtls_ssl_hs_hdr_len( ssl ) + ( ( buf[2] << 8 ) | buf[3] ) )
1307 buf += mbedtls_ssl_hs_hdr_len( ssl );
1340 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, version", buf, 2 );
1343 ssl->conf->transport, buf );
1373 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes", buf + 2, 32 );
1375 memcpy( ssl->handshake->randbytes, buf + 2, 32 );
1380 sess_len = buf[34];
1389 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, session id", buf + 35, sess_len );
1394 memcpy( ssl->session_negotiate->id, buf + 35,
1404 cookie_len = buf[cookie_offset];
1413 buf + cookie_offset + 1, cookie_len );
1423 buf + cookie_offset + 1, cookie_len,
1457 ciph_len = ( buf[ciph_offset + 0] << 8 )
1458 | ( buf[ciph_offset + 1] );
1469 buf + ciph_offset + 2, ciph_len );
1476 comp_len = buf[comp_offset];
1487 buf + comp_offset + 1, comp_len );
1493 if( buf[comp_offset + 1 + i] == MBEDTLS_SSL_COMPRESS_DEFLATE )
1524 ext_len = ( buf[ext_offset + 0] << 8 )
1525 | ( buf[ext_offset + 1] );
1537 ext = buf + ext_offset + 2;
1703 for( i = 0, p = buf + 41 + sess_len; i < ciph_len; i += 2, p += 2 )
1728 for( i = 0, p = buf + ciph_offset + 2; i < ciph_len; i += 2, p += 2 )
1799 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 )
1805 for( j = 0, p = buf + ciph_offset + 2; j < ciph_len; j += 2, p += 2 )
1857 unsigned char *buf, argument
1860 unsigned char *p = buf;
1882 unsigned char *buf, argument
1885 unsigned char *p = buf;
1925 unsigned char *buf, argument
1928 unsigned char *p = buf;
1952 unsigned char *buf, argument
1955 unsigned char *p = buf;
1976 unsigned char *buf, argument
1979 unsigned char *p = buf;
2012 *olen = p - buf;
2017 unsigned char *buf, argument
2020 unsigned char *p = buf;
2045 unsigned char *buf, argument
2048 unsigned char *p = buf;
2075 unsigned char *buf, argument
2079 unsigned char *p = buf;
2119 unsigned char *buf, size_t *olen ) argument
2136 buf[0] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN >> 8 ) & 0xFF );
2137 buf[1] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN ) & 0xFF );
2141 buf[2] = (unsigned char)( ( ( *olen - 4 ) >> 8 ) & 0xFF );
2142 buf[3] = (unsigned char)( ( ( *olen - 4 ) ) & 0xFF );
2144 buf[4] = (unsigned char)( ( ( *olen - 6 ) >> 8 ) & 0xFF );
2145 buf[5] = (unsigned char)( ( ( *olen - 6 ) ) & 0xFF );
2147 buf[6] = (unsigned char)( ( ( *olen - 7 ) ) & 0xFF );
2149 memcpy( buf + 7, ssl->alpn_chosen, *olen - 7 );
2223 unsigned char *buf, *p; local
2251 buf = ssl->out_msg;
2252 p = buf + 4;
2259 buf[4], buf[5] ) );
2281 memcpy( ssl->handshake->randbytes + 32, buf + 6, 32 );
2283 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, random bytes", buf + 6, 32 );
2357 MBEDTLS_SSL_DEBUG_BUF( 3, "server hello, session id", buf + 39, n );
2436 ssl->out_msglen = p - buf;
2480 unsigned char *buf, *p; local
2519 buf = ssl->out_msg;
2520 p = buf + 4;
2622 ssl->out_msglen = p - buf;