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()
94 int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_server_name() argument
100 if (!PACKET_as_length_prefixed_2(pkt, &sni) in tls_parse_ctos_server_name()
166 int tls_parse_ctos_maxfragmentlen(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_maxfragmentlen() argument
171 if (PACKET_remaining(pkt) != 1 || !PACKET_get_1(pkt, &value)) { in tls_parse_ctos_maxfragmentlen()
203 int tls_parse_ctos_srp(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_srp() argument
208 if (!PACKET_as_length_prefixed_1(pkt, &srp_I) in tls_parse_ctos_srp()
223 int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_ec_pt_formats() argument
228 if (!PACKET_as_length_prefixed_1(pkt, &ec_point_format_list) in tls_parse_ctos_ec_pt_formats()
246 int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_session_ticket() argument
250 !s->ext.session_ticket_cb(s, PACKET_data(pkt), in tls_parse_ctos_session_ticket()
251 PACKET_remaining(pkt), in tls_parse_ctos_session_ticket()
260 int tls_parse_ctos_sig_algs_cert(SSL *s, PACKET *pkt, in tls_parse_ctos_sig_algs_cert() argument
267 if (!PACKET_as_length_prefixed_2(pkt, &supported_sig_algs) in tls_parse_ctos_sig_algs_cert()
281 int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_sig_algs() argument
286 if (!PACKET_as_length_prefixed_2(pkt, &supported_sig_algs) in tls_parse_ctos_sig_algs()
301 int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_status_request() argument
314 if (!PACKET_get_1(pkt, (unsigned int *)&s->ext.status_type)) { in tls_parse_ctos_status_request()
327 if (!PACKET_get_length_prefixed_2 (pkt, &responder_id_list)) { in tls_parse_ctos_status_request()
382 if (!PACKET_as_length_prefixed_2(pkt, &exts)) { in tls_parse_ctos_status_request()
405 int tls_parse_ctos_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_npn() argument
423 int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_alpn() argument
431 if (!PACKET_as_length_prefixed_2(pkt, &protocol_list) in tls_parse_ctos_alpn()
460 int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_use_srtp() argument
473 if (!PACKET_get_net_2(pkt, &ct) || (ct & 1) != 0 in tls_parse_ctos_use_srtp()
474 || !PACKET_get_sub_packet(pkt, &subpkt, ct)) { in tls_parse_ctos_use_srtp()
511 if (!PACKET_get_1(pkt, &mki_len)) { in tls_parse_ctos_use_srtp()
517 if (!PACKET_forward(pkt, mki_len) in tls_parse_ctos_use_srtp()
518 || PACKET_remaining(pkt)) { in tls_parse_ctos_use_srtp()
527 int tls_parse_ctos_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_etm() argument
540 int tls_parse_ctos_psk_kex_modes(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_psk_kex_modes() argument
547 if (!PACKET_as_length_prefixed_1(pkt, &psk_kex_modes) in tls_parse_ctos_psk_kex_modes()
569 int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_key_share() argument
588 if (!PACKET_as_length_prefixed_2(pkt, &key_share_list)) { in tls_parse_ctos_key_share()
680 int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_cookie() argument
700 if (!PACKET_as_length_prefixed_2(pkt, &cookie)) { in tls_parse_ctos_cookie()
887 int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_supported_groups() argument
893 if (!PACKET_as_length_prefixed_2(pkt, &supported_groups_list) in tls_parse_ctos_supported_groups()
915 int tls_parse_ctos_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_ems() argument
919 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_ems()
933 int tls_parse_ctos_early_data(SSL *s, PACKET *pkt, unsigned int context, in tls_parse_ctos_early_data() argument
936 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_early_data()
977 int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, in tls_parse_ctos_psk() argument
994 if (!PACKET_get_length_prefixed_2(pkt, &identities)) { in tls_parse_ctos_psk()
1173 binderoffset = PACKET_data(pkt) - (const unsigned char *)s->init_buf->data; in tls_parse_ctos_psk()
1176 if (!PACKET_get_length_prefixed_2(pkt, &binders)) { in tls_parse_ctos_psk()
1209 int tls_parse_ctos_post_handshake_auth(SSL *s, PACKET *pkt, in tls_parse_ctos_post_handshake_auth() argument
1214 if (PACKET_remaining(pkt) != 0) { in tls_parse_ctos_post_handshake_auth()
1228 EXT_RETURN tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, in tls_construct_stoc_renegotiate() argument
1236 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) in tls_construct_stoc_renegotiate()
1237 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_renegotiate()
1238 || !WPACKET_start_sub_packet_u8(pkt) in tls_construct_stoc_renegotiate()
1239 || !WPACKET_memcpy(pkt, s->s3.previous_client_finished, in tls_construct_stoc_renegotiate()
1241 || !WPACKET_memcpy(pkt, s->s3.previous_server_finished, in tls_construct_stoc_renegotiate()
1243 || !WPACKET_close(pkt) in tls_construct_stoc_renegotiate()
1244 || !WPACKET_close(pkt)) { in tls_construct_stoc_renegotiate()
1252 EXT_RETURN tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, in tls_construct_stoc_server_name() argument
1266 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) in tls_construct_stoc_server_name()
1267 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_server_name()
1276 EXT_RETURN tls_construct_stoc_maxfragmentlen(SSL *s, WPACKET *pkt, in tls_construct_stoc_maxfragmentlen() argument
1287 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_max_fragment_length) in tls_construct_stoc_maxfragmentlen()
1288 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_maxfragmentlen()
1289 || !WPACKET_put_bytes_u8(pkt, s->session->ext.max_fragment_len_mode) in tls_construct_stoc_maxfragmentlen()
1290 || !WPACKET_close(pkt)) { in tls_construct_stoc_maxfragmentlen()
1298 EXT_RETURN tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, in tls_construct_stoc_ec_pt_formats() argument
1313 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) in tls_construct_stoc_ec_pt_formats()
1314 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_ec_pt_formats()
1315 || !WPACKET_sub_memcpy_u8(pkt, plist, plistlen) in tls_construct_stoc_ec_pt_formats()
1316 || !WPACKET_close(pkt)) { in tls_construct_stoc_ec_pt_formats()
1324 EXT_RETURN tls_construct_stoc_supported_groups(SSL *s, WPACKET *pkt, in tls_construct_stoc_supported_groups() argument
1359 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_groups) in tls_construct_stoc_supported_groups()
1361 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_supported_groups()
1362 || !WPACKET_start_sub_packet_u16(pkt)) { in tls_construct_stoc_supported_groups()
1369 if (!WPACKET_put_bytes_u16(pkt, group)) { in tls_construct_stoc_supported_groups()
1376 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) { in tls_construct_stoc_supported_groups()
1384 EXT_RETURN tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt, in tls_construct_stoc_session_ticket() argument
1393 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket) in tls_construct_stoc_session_ticket()
1394 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_session_ticket()
1403 EXT_RETURN tls_construct_stoc_status_request(SSL *s, WPACKET *pkt, in tls_construct_stoc_status_request() argument
1417 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request) in tls_construct_stoc_status_request()
1418 || !WPACKET_start_sub_packet_u16(pkt)) { in tls_construct_stoc_status_request()
1428 if (SSL_IS_TLS13(s) && !tls_construct_cert_status_body(s, pkt)) { in tls_construct_stoc_status_request()
1432 if (!WPACKET_close(pkt)) { in tls_construct_stoc_status_request()
1442 EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt, in tls_construct_stoc_next_proto_neg() argument
1458 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg) in tls_construct_stoc_next_proto_neg()
1459 || !WPACKET_sub_memcpy_u16(pkt, npa, npalen)) { in tls_construct_stoc_next_proto_neg()
1470 EXT_RETURN tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_alpn() argument
1476 if (!WPACKET_put_bytes_u16(pkt, in tls_construct_stoc_alpn()
1478 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_alpn()
1479 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_alpn()
1480 || !WPACKET_sub_memcpy_u8(pkt, s->s3.alpn_selected, in tls_construct_stoc_alpn()
1482 || !WPACKET_close(pkt) in tls_construct_stoc_alpn()
1483 || !WPACKET_close(pkt)) { in tls_construct_stoc_alpn()
1492 EXT_RETURN tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, in tls_construct_stoc_use_srtp() argument
1499 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp) in tls_construct_stoc_use_srtp()
1500 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_use_srtp()
1501 || !WPACKET_put_bytes_u16(pkt, 2) in tls_construct_stoc_use_srtp()
1502 || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id) in tls_construct_stoc_use_srtp()
1503 || !WPACKET_put_bytes_u8(pkt, 0) in tls_construct_stoc_use_srtp()
1504 || !WPACKET_close(pkt)) { in tls_construct_stoc_use_srtp()
1513 EXT_RETURN tls_construct_stoc_etm(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_etm() argument
1533 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac) in tls_construct_stoc_etm()
1534 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_etm()
1542 EXT_RETURN tls_construct_stoc_ems(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_ems() argument
1548 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_extended_master_secret) in tls_construct_stoc_ems()
1549 || !WPACKET_put_bytes_u16(pkt, 0)) { in tls_construct_stoc_ems()
1557 EXT_RETURN tls_construct_stoc_supported_versions(SSL *s, WPACKET *pkt, in tls_construct_stoc_supported_versions() argument
1566 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions) in tls_construct_stoc_supported_versions()
1567 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_supported_versions()
1568 || !WPACKET_put_bytes_u16(pkt, s->version) in tls_construct_stoc_supported_versions()
1569 || !WPACKET_close(pkt)) { in tls_construct_stoc_supported_versions()
1577 EXT_RETURN tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, in tls_construct_stoc_key_share() argument
1592 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share) in tls_construct_stoc_key_share()
1593 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_key_share()
1594 || !WPACKET_put_bytes_u16(pkt, s->s3.group_id) in tls_construct_stoc_key_share()
1595 || !WPACKET_close(pkt)) { in tls_construct_stoc_key_share()
1619 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share) in tls_construct_stoc_key_share()
1620 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_key_share()
1621 || !WPACKET_put_bytes_u16(pkt, s->s3.group_id)) { in tls_construct_stoc_key_share()
1647 if (!WPACKET_sub_memcpy_u16(pkt, encodedPoint, encoded_pt_len) in tls_construct_stoc_key_share()
1648 || !WPACKET_close(pkt)) { in tls_construct_stoc_key_share()
1686 if (!WPACKET_sub_memcpy_u16(pkt, ct, ctlen) in tls_construct_stoc_key_share()
1687 || !WPACKET_close(pkt)) { in tls_construct_stoc_key_share()
1709 EXT_RETURN tls_construct_stoc_cookie(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_cookie() argument
1728 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_cookie) in tls_construct_stoc_cookie()
1729 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1730 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1731 || !WPACKET_get_total_written(pkt, &startlen) in tls_construct_stoc_cookie()
1732 || !WPACKET_reserve_bytes(pkt, MAX_COOKIE_SIZE, &cookie) in tls_construct_stoc_cookie()
1733 || !WPACKET_put_bytes_u16(pkt, COOKIE_STATE_FORMAT_VERSION) in tls_construct_stoc_cookie()
1734 || !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION) in tls_construct_stoc_cookie()
1735 || !WPACKET_put_bytes_u16(pkt, s->s3.group_id) in tls_construct_stoc_cookie()
1736 || !s->method->put_cipher_by_char(s->s3.tmp.new_cipher, pkt, in tls_construct_stoc_cookie()
1739 || !WPACKET_put_bytes_u8(pkt, s->s3.peer_tmp == NULL) in tls_construct_stoc_cookie()
1740 || !WPACKET_put_bytes_u32(pkt, (unsigned int)time(NULL)) in tls_construct_stoc_cookie()
1741 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_cookie()
1742 || !WPACKET_reserve_bytes(pkt, EVP_MAX_MD_SIZE, &hashval1)) { in tls_construct_stoc_cookie()
1758 if (!WPACKET_allocate_bytes(pkt, hashlen, &hashval2) in tls_construct_stoc_cookie()
1760 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1761 || !WPACKET_start_sub_packet_u8(pkt) in tls_construct_stoc_cookie()
1762 || !WPACKET_reserve_bytes(pkt, SSL_COOKIE_LENGTH, &appcookie1)) { in tls_construct_stoc_cookie()
1773 if (!WPACKET_allocate_bytes(pkt, appcookielen, &appcookie2) in tls_construct_stoc_cookie()
1775 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1776 || !WPACKET_get_total_written(pkt, &totcookielen) in tls_construct_stoc_cookie()
1777 || !WPACKET_reserve_bytes(pkt, SHA256_DIGEST_LENGTH, &hmac)) { in tls_construct_stoc_cookie()
1813 if (!WPACKET_allocate_bytes(pkt, hmaclen, &hmac2) in tls_construct_stoc_cookie()
1816 || !WPACKET_close(pkt) in tls_construct_stoc_cookie()
1817 || !WPACKET_close(pkt)) { in tls_construct_stoc_cookie()
1833 EXT_RETURN tls_construct_stoc_cryptopro_bug(SSL *s, WPACKET *pkt, in tls_construct_stoc_cryptopro_bug() argument
1851 if (!WPACKET_memcpy(pkt, cryptopro_ext, sizeof(cryptopro_ext))) { in tls_construct_stoc_cryptopro_bug()
1859 EXT_RETURN tls_construct_stoc_early_data(SSL *s, WPACKET *pkt, in tls_construct_stoc_early_data() argument
1867 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data) in tls_construct_stoc_early_data()
1868 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_early_data()
1869 || !WPACKET_put_bytes_u32(pkt, s->max_early_data) in tls_construct_stoc_early_data()
1870 || !WPACKET_close(pkt)) { in tls_construct_stoc_early_data()
1881 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data) in tls_construct_stoc_early_data()
1882 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_early_data()
1883 || !WPACKET_close(pkt)) { in tls_construct_stoc_early_data()
1891 EXT_RETURN tls_construct_stoc_psk(SSL *s, WPACKET *pkt, unsigned int context, in tls_construct_stoc_psk() argument
1897 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk) in tls_construct_stoc_psk()
1898 || !WPACKET_start_sub_packet_u16(pkt) in tls_construct_stoc_psk()
1899 || !WPACKET_put_bytes_u16(pkt, s->ext.tick_identity) in tls_construct_stoc_psk()
1900 || !WPACKET_close(pkt)) { in tls_construct_stoc_psk()