Lines Matching refs:pkt
41 int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_renegotiate() argument
48 if (!PACKET_get_1(pkt, &ilen) in tls_parse_ctos_renegotiate()
49 || !PACKET_get_bytes(pkt, &data, ilen)) { in tls_parse_ctos_renegotiate()
97 int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_server_name() argument
103 if (!PACKET_as_length_prefixed_2(pkt, &sni) in tls_parse_ctos_server_name()
180 int tls_parse_ctos_maxfragmentlen(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_maxfragmentlen() argument
185 if (PACKET_remaining(pkt) != 1 || !PACKET_get_1(pkt, &value)) { in tls_parse_ctos_maxfragmentlen()
220 int tls_parse_ctos_srp(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_srp() argument
225 if (!PACKET_as_length_prefixed_1(pkt, &srp_I) in tls_parse_ctos_srp()
248 int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_ec_pt_formats() argument
253 if (!PACKET_as_length_prefixed_1(pkt, &ec_point_format_list) in tls_parse_ctos_ec_pt_formats()
274 int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_session_ticket() argument
278 !s->ext.session_ticket_cb(s, PACKET_data(pkt), in tls_parse_ctos_session_ticket()
279 PACKET_remaining(pkt), in tls_parse_ctos_session_ticket()
289 int tls_parse_ctos_sig_algs_cert(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_sig_algs_cert() argument
294 if (!PACKET_as_length_prefixed_2(pkt, &supported_sig_algs) in tls_parse_ctos_sig_algs_cert()
310 int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_sig_algs() argument
315 if (!PACKET_as_length_prefixed_2(pkt, &supported_sig_algs) in tls_parse_ctos_sig_algs()
332 int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_status_request() argument
345 if (!PACKET_get_1(pkt, (unsigned int *)&s->ext.status_type)) { in tls_parse_ctos_status_request()
359 if (!PACKET_get_length_prefixed_2 (pkt, &responder_id_list)) { in tls_parse_ctos_status_request()
421 if (!PACKET_as_length_prefixed_2(pkt, &exts)) { in tls_parse_ctos_status_request()
446 int tls_parse_ctos_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_npn() argument
464 int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_alpn() argument
472 if (!PACKET_as_length_prefixed_2(pkt, &protocol_list) in tls_parse_ctos_alpn()
504 int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_use_srtp() argument
517 if (!PACKET_get_net_2(pkt, &ct) || (ct & 1) != 0 in tls_parse_ctos_use_srtp()
518 || !PACKET_get_sub_packet(pkt, &subpkt, ct)) { in tls_parse_ctos_use_srtp()
555 if (!PACKET_get_1(pkt, &mki_len)) { in tls_parse_ctos_use_srtp()
561 if (!PACKET_forward(pkt, mki_len) in tls_parse_ctos_use_srtp()
562 || PACKET_remaining(pkt)) { in tls_parse_ctos_use_srtp()
572 int tls_parse_ctos_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_etm() argument
585 int tls_parse_ctos_psk_kex_modes(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_psk_kex_modes() argument
592 if (!PACKET_as_length_prefixed_1(pkt, &psk_kex_modes) in tls_parse_ctos_psk_kex_modes()
615 int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_key_share() argument
635 if (!PACKET_as_length_prefixed_2(pkt, &key_share_list)) { in tls_parse_ctos_key_share()
731 int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_cookie() argument
751 if (!PACKET_as_length_prefixed_2(pkt, &cookie)) { in tls_parse_ctos_cookie()
955 int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_supported_groups() argument
961 if (!PACKET_as_length_prefixed_2(pkt, &supported_groups_list) in tls_parse_ctos_supported_groups()
987 int tls_parse_ctos_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_ems() argument
991 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_ems()
1003 int tls_parse_ctos_early_data(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_early_data() argument
1006 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_early_data()
1049 int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_psk() argument
1066 if (!PACKET_get_length_prefixed_2(pkt, &identities)) { in tls_parse_ctos_psk()
1253 binderoffset = PACKET_data(pkt) - (const unsigned char *)s->init_buf->data; in tls_parse_ctos_psk()
1256 if (!PACKET_get_length_prefixed_2(pkt, &binders)) { in tls_parse_ctos_psk()
1292 int tls_parse_ctos_post_handshake_auth(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_post_handshake_auth() argument
1295 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_post_handshake_auth()
1309 EXT_RETURN tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, in tls_construct_stoc_renegotiate() argument
1317 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) in tls_construct_stoc_renegotiate()
1318 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_renegotiate()
1319 || !WPACKET_start_sub_packet_u8(pkt) in tls_construct_stoc_renegotiate()
1320 || !WPACKET_memcpy(pkt, s->s3->previous_client_finished, in tls_construct_stoc_renegotiate()
1322 || !WPACKET_memcpy(pkt, s->s3->previous_server_finished, in tls_construct_stoc_renegotiate()
1324 || !WPACKET_close(pkt) in tls_construct_stoc_renegotiate()
1325 || !WPACKET_close(pkt)) { in tls_construct_stoc_renegotiate()
1334 EXT_RETURN tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, in tls_construct_stoc_server_name() argument
1348 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) in tls_construct_stoc_server_name()
1349 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_server_name()
1359 EXT_RETURN tls_construct_stoc_maxfragmentlen(SSL *s, WPACKET *pkt, in tls_construct_stoc_maxfragmentlen() argument
1370 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_max_fragment_length) in tls_construct_stoc_maxfragmentlen()
1371 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_maxfragmentlen()
1372 || !WPACKET_put_bytes_u8(pkt, s->session->ext.max_fragment_len_mode) in tls_construct_stoc_maxfragmentlen()
1373 || !WPACKET_close(pkt)) { in tls_construct_stoc_maxfragmentlen()
1383 EXT_RETURN tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, in tls_construct_stoc_ec_pt_formats() argument
1398 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) in tls_construct_stoc_ec_pt_formats()
1399 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_ec_pt_formats()
1400 || !WPACKET_sub_memcpy_u8(pkt, plist, plistlen) in tls_construct_stoc_ec_pt_formats()
1401 || !WPACKET_close(pkt)) { in tls_construct_stoc_ec_pt_formats()
1412 EXT_RETURN tls_construct_stoc_supported_groups(SSL *s, WPACKET *pkt, in tls_construct_stoc_supported_groups() argument
1445 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_groups) in tls_construct_stoc_supported_groups()
1447 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_supported_groups()
1448 || !WPACKET_start_sub_packet_u16(pkt)) { in tls_construct_stoc_supported_groups()
1457 if (!WPACKET_put_bytes_u16(pkt, group)) { in tls_construct_stoc_supported_groups()
1466 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) { in tls_construct_stoc_supported_groups()
1477 EXT_RETURN tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt, in tls_construct_stoc_session_ticket() argument
1486 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket) in tls_construct_stoc_session_ticket()
1487 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_session_ticket()
1497 EXT_RETURN tls_construct_stoc_status_request(SSL *s, WPACKET *pkt, in tls_construct_stoc_status_request() argument
1511 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request) in tls_construct_stoc_status_request()
1512 || !WPACKET_start_sub_packet_u16(pkt)) { in tls_construct_stoc_status_request()
1523 if (SSL_IS_TLS13(s) && !tls_construct_cert_status_body(s, pkt)) { in tls_construct_stoc_status_request()
1527 if (!WPACKET_close(pkt)) { in tls_construct_stoc_status_request()
1538 EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt, in tls_construct_stoc_next_proto_neg() argument
1554 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg) in tls_construct_stoc_next_proto_neg()
1555 || !WPACKET_sub_memcpy_u16(pkt, npa, npalen)) { in tls_construct_stoc_next_proto_neg()
1568 EXT_RETURN tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_alpn() argument
1574 if (!WPACKET_put_bytes_u16(pkt, in tls_construct_stoc_alpn()
1576 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_alpn()
1577 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_alpn()
1578 || !WPACKET_sub_memcpy_u8(pkt, s->s3->alpn_selected, in tls_construct_stoc_alpn()
1580 || !WPACKET_close(pkt) in tls_construct_stoc_alpn()
1581 || !WPACKET_close(pkt)) { in tls_construct_stoc_alpn()
1591 EXT_RETURN tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, in tls_construct_stoc_use_srtp() argument
1598 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp) in tls_construct_stoc_use_srtp()
1599 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_use_srtp()
1600 || !WPACKET_put_bytes_u16(pkt, 2) in tls_construct_stoc_use_srtp()
1601 || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id) in tls_construct_stoc_use_srtp()
1602 || !WPACKET_put_bytes_u8(pkt, 0) in tls_construct_stoc_use_srtp()
1603 || !WPACKET_close(pkt)) { in tls_construct_stoc_use_srtp()
1613 EXT_RETURN tls_construct_stoc_etm(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_etm() argument
1631 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac) in tls_construct_stoc_etm()
1632 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_etm()
1641 EXT_RETURN tls_construct_stoc_ems(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_ems() argument
1647 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_extended_master_secret) in tls_construct_stoc_ems()
1648 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_ems()
1657 EXT_RETURN tls_construct_stoc_supported_versions(SSL *s, WPACKET *pkt, in tls_construct_stoc_supported_versions() argument
1668 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions) in tls_construct_stoc_supported_versions()
1669 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_supported_versions()
1670 || !WPACKET_put_bytes_u16(pkt, s->version) in tls_construct_stoc_supported_versions()
1671 || !WPACKET_close(pkt)) { in tls_construct_stoc_supported_versions()
1681 EXT_RETURN tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, in tls_construct_stoc_key_share() argument
1695 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share) in tls_construct_stoc_key_share()
1696 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_key_share()
1697 || !WPACKET_put_bytes_u16(pkt, s->s3->group_id) in tls_construct_stoc_key_share()
1698 || !WPACKET_close(pkt)) { in tls_construct_stoc_key_share()
1718 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share) in tls_construct_stoc_key_share()
1719 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_key_share()
1720 || !WPACKET_put_bytes_u16(pkt, s->s3->group_id)) { in tls_construct_stoc_key_share()
1742 if (!WPACKET_sub_memcpy_u16(pkt, encodedPoint, encoded_pt_len) in tls_construct_stoc_key_share()
1743 || !WPACKET_close(pkt)) { in tls_construct_stoc_key_share()
1764 EXT_RETURN tls_construct_stoc_cookie(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_cookie() argument
1784 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_cookie) in tls_construct_stoc_cookie()
1785 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1786 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1787 || !WPACKET_get_total_written(pkt, &startlen) in tls_construct_stoc_cookie()
1788 || !WPACKET_reserve_bytes(pkt, MAX_COOKIE_SIZE, &cookie) in tls_construct_stoc_cookie()
1789 || !WPACKET_put_bytes_u16(pkt, COOKIE_STATE_FORMAT_VERSION) in tls_construct_stoc_cookie()
1790 || !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION) in tls_construct_stoc_cookie()
1791 || !WPACKET_put_bytes_u16(pkt, s->s3->group_id) in tls_construct_stoc_cookie()
1792 || !s->method->put_cipher_by_char(s->s3->tmp.new_cipher, pkt, in tls_construct_stoc_cookie()
1795 || !WPACKET_put_bytes_u8(pkt, s->s3->peer_tmp == NULL) in tls_construct_stoc_cookie()
1796 || !WPACKET_put_bytes_u32(pkt, (unsigned int)time(NULL)) in tls_construct_stoc_cookie()
1797 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1798 || !WPACKET_reserve_bytes(pkt, EVP_MAX_MD_SIZE, &hashval1)) { in tls_construct_stoc_cookie()
1815 if (!WPACKET_allocate_bytes(pkt, hashlen, &hashval2) in tls_construct_stoc_cookie()
1817 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1818 || !WPACKET_start_sub_packet_u8(pkt) in tls_construct_stoc_cookie()
1819 || !WPACKET_reserve_bytes(pkt, SSL_COOKIE_LENGTH, &appcookie1)) { in tls_construct_stoc_cookie()
1832 if (!WPACKET_allocate_bytes(pkt, appcookielen, &appcookie2) in tls_construct_stoc_cookie()
1834 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1835 || !WPACKET_get_total_written(pkt, &totcookielen) in tls_construct_stoc_cookie()
1836 || !WPACKET_reserve_bytes(pkt, SHA256_DIGEST_LENGTH, &hmac)) { in tls_construct_stoc_cookie()
1876 if (!WPACKET_allocate_bytes(pkt, hmaclen, &hmac2) in tls_construct_stoc_cookie()
1879 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1880 || !WPACKET_close(pkt)) { in tls_construct_stoc_cookie()
1897 EXT_RETURN tls_construct_stoc_cryptopro_bug(SSL *s, WPACKET *pkt, in tls_construct_stoc_cryptopro_bug() argument
1915 if (!WPACKET_memcpy(pkt, cryptopro_ext, sizeof(cryptopro_ext))) { in tls_construct_stoc_cryptopro_bug()
1924 EXT_RETURN tls_construct_stoc_early_data(SSL *s, WPACKET *pkt, in tls_construct_stoc_early_data() argument
1932 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data) in tls_construct_stoc_early_data()
1933 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_early_data()
1934 || !WPACKET_put_bytes_u32(pkt, s->max_early_data) in tls_construct_stoc_early_data()
1935 || !WPACKET_close(pkt)) { in tls_construct_stoc_early_data()
1947 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data) in tls_construct_stoc_early_data()
1948 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_early_data()
1949 || !WPACKET_close(pkt)) { in tls_construct_stoc_early_data()
1958 EXT_RETURN tls_construct_stoc_psk(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_psk() argument
1964 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk) in tls_construct_stoc_psk()
1965 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_psk()
1966 || !WPACKET_put_bytes_u16(pkt, s->ext.tick_identity) in tls_construct_stoc_psk()
1967 || !WPACKET_close(pkt)) { in tls_construct_stoc_psk()