Lines Matching refs:pkt
15 EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt,
23 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
24 || !WPACKET_start_sub_packet_u16(pkt)
25 || !WPACKET_sub_memcpy_u8(pkt, s->s3->previous_client_finished,
27 || !WPACKET_close(pkt)) {
36 EXT_RETURN tls_construct_ctos_server_name(SSL *s, WPACKET *pkt,
44 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name)
46 || !WPACKET_start_sub_packet_u16(pkt)
48 || !WPACKET_start_sub_packet_u16(pkt)
49 || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
50 || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname,
52 || !WPACKET_close(pkt)
53 || !WPACKET_close(pkt)) {
63 EXT_RETURN tls_construct_ctos_maxfragmentlen(SSL *s, WPACKET *pkt,
75 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_max_fragment_length)
77 || !WPACKET_start_sub_packet_u16(pkt)
78 || !WPACKET_put_bytes_u8(pkt, s->ext.max_fragment_len_mode)
79 || !WPACKET_close(pkt)) {
89 EXT_RETURN tls_construct_ctos_srp(SSL *s, WPACKET *pkt, unsigned int context,
96 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_srp)
98 || !WPACKET_start_sub_packet_u16(pkt)
99 || !WPACKET_start_sub_packet_u8(pkt)
101 || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH)
102 || !WPACKET_memcpy(pkt, s->srp_ctx.login,
104 || !WPACKET_close(pkt)
105 || !WPACKET_close(pkt)) {
145 EXT_RETURN tls_construct_ctos_ec_pt_formats(SSL *s, WPACKET *pkt,
158 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats)
160 || !WPACKET_start_sub_packet_u16(pkt)
161 || !WPACKET_sub_memcpy_u8(pkt, pformats, num_formats)
162 || !WPACKET_close(pkt)) {
171 EXT_RETURN tls_construct_ctos_supported_groups(SSL *s, WPACKET *pkt,
187 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_groups)
189 || !WPACKET_start_sub_packet_u16(pkt)
190 || !WPACKET_start_sub_packet_u16(pkt)) {
201 if (!WPACKET_put_bytes_u16(pkt, ctmp)) {
209 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
220 EXT_RETURN tls_construct_ctos_session_ticket(SSL *s, WPACKET *pkt,
254 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket)
255 || !WPACKET_sub_memcpy_u16(pkt, s->session->ext.tick, ticklen)) {
264 EXT_RETURN tls_construct_ctos_sig_algs(SSL *s, WPACKET *pkt,
275 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signature_algorithms)
277 || !WPACKET_start_sub_packet_u16(pkt)
279 || !WPACKET_start_sub_packet_u16(pkt)
280 || !tls12_copy_sigalgs(s, pkt, salg, salglen)
281 || !WPACKET_close(pkt)
282 || !WPACKET_close(pkt)) {
292 EXT_RETURN tls_construct_ctos_status_request(SSL *s, WPACKET *pkt,
305 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request)
307 || !WPACKET_start_sub_packet_u16(pkt)
308 || !WPACKET_put_bytes_u8(pkt, TLSEXT_STATUSTYPE_ocsp)
310 || !WPACKET_start_sub_packet_u16(pkt)) {
322 || !WPACKET_sub_allocate_bytes_u16(pkt, idlen, &idbytes)
330 if (!WPACKET_close(pkt)
331 || !WPACKET_start_sub_packet_u16(pkt)) {
346 if (!WPACKET_allocate_bytes(pkt, extlen, &extbytes)
355 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
366 EXT_RETURN tls_construct_ctos_npn(SSL *s, WPACKET *pkt, unsigned int context,
376 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg)
377 || !WPACKET_put_bytes_u16(pkt, 0)) {
387 EXT_RETURN tls_construct_ctos_alpn(SSL *s, WPACKET *pkt, unsigned int context,
395 if (!WPACKET_put_bytes_u16(pkt,
398 || !WPACKET_start_sub_packet_u16(pkt)
399 || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len)
400 || !WPACKET_close(pkt)) {
412 EXT_RETURN tls_construct_ctos_use_srtp(SSL *s, WPACKET *pkt,
422 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp)
424 || !WPACKET_start_sub_packet_u16(pkt)
426 || !WPACKET_start_sub_packet_u16(pkt)) {
437 if (prof == NULL || !WPACKET_put_bytes_u16(pkt, prof->id)) {
443 if (!WPACKET_close(pkt)
445 || !WPACKET_put_bytes_u8(pkt, 0)
446 || !WPACKET_close(pkt)) {
456 EXT_RETURN tls_construct_ctos_etm(SSL *s, WPACKET *pkt, unsigned int context,
462 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac)
463 || !WPACKET_put_bytes_u16(pkt, 0)) {
473 EXT_RETURN tls_construct_ctos_sct(SSL *s, WPACKET *pkt, unsigned int context,
483 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signed_certificate_timestamp)
484 || !WPACKET_put_bytes_u16(pkt, 0)) {
494 EXT_RETURN tls_construct_ctos_ems(SSL *s, WPACKET *pkt, unsigned int context,
497 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_extended_master_secret)
498 || !WPACKET_put_bytes_u16(pkt, 0)) {
507 EXT_RETURN tls_construct_ctos_supported_versions(SSL *s, WPACKET *pkt,
527 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions)
528 || !WPACKET_start_sub_packet_u16(pkt)
529 || !WPACKET_start_sub_packet_u8(pkt)) {
537 if (!WPACKET_put_bytes_u16(pkt, currv)) {
544 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
557 EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL *s, WPACKET *pkt,
564 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk_kex_modes)
565 || !WPACKET_start_sub_packet_u16(pkt)
566 || !WPACKET_start_sub_packet_u8(pkt)
567 || !WPACKET_put_bytes_u8(pkt, TLSEXT_KEX_MODE_KE_DHE)
568 || (nodhe && !WPACKET_put_bytes_u8(pkt, TLSEXT_KEX_MODE_KE))
569 || !WPACKET_close(pkt)
570 || !WPACKET_close(pkt)) {
585 static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
618 if (!WPACKET_put_bytes_u16(pkt, curve_id)
619 || !WPACKET_sub_memcpy_u16(pkt, encoded_point, encodedlen)) {
643 EXT_RETURN tls_construct_ctos_key_share(SSL *s, WPACKET *pkt,
653 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share)
655 || !WPACKET_start_sub_packet_u16(pkt)
657 || !WPACKET_start_sub_packet_u16(pkt)) {
688 if (!add_key_share(s, pkt, curve_id)) {
693 if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
704 EXT_RETURN tls_construct_ctos_cookie(SSL *s, WPACKET *pkt, unsigned int context,
713 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_cookie)
715 || !WPACKET_start_sub_packet_u16(pkt)
716 || !WPACKET_sub_memcpy_u16(pkt, s->ext.tls13_cookie,
718 || !WPACKET_close(pkt)) {
733 EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt,
881 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data)
882 || !WPACKET_start_sub_packet_u16(pkt)
883 || !WPACKET_close(pkt)) {
916 EXT_RETURN tls_construct_ctos_padding(SSL *s, WPACKET *pkt,
932 if (!WPACKET_get_total_written(pkt, &hlen)) {
972 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_padding)
973 || !WPACKET_sub_allocate_bytes_u16(pkt, hlen, &padbytes)) {
987 EXT_RETURN tls_construct_ctos_psk(SSL *s, WPACKET *pkt, unsigned int context,
1121 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk)
1122 || !WPACKET_start_sub_packet_u16(pkt)
1123 || !WPACKET_start_sub_packet_u16(pkt)) {
1130 if (!WPACKET_sub_memcpy_u16(pkt, s->session->ext.tick,
1132 || !WPACKET_put_bytes_u32(pkt, agems)) {
1140 if (!WPACKET_sub_memcpy_u16(pkt, s->psksession_id,
1142 || !WPACKET_put_bytes_u32(pkt, 0)) {
1150 if (!WPACKET_close(pkt)
1151 || !WPACKET_get_total_written(pkt, &binderoffset)
1152 || !WPACKET_start_sub_packet_u16(pkt)
1154 && !WPACKET_sub_allocate_bytes_u8(pkt, reshashsize, &resbinder))
1156 && !WPACKET_sub_allocate_bytes_u8(pkt, pskhashsize, &pskbinder))
1157 || !WPACKET_close(pkt)
1158 || !WPACKET_close(pkt)
1159 || !WPACKET_get_total_written(pkt, &msglen)
1164 || !WPACKET_fill_lengths(pkt)) {
1170 msgstart = WPACKET_get_curr(pkt) - msglen;
1192 EXT_RETURN tls_construct_ctos_post_handshake_auth(SSL *s, WPACKET *pkt,
1201 if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_post_handshake_auth)
1202 || !WPACKET_start_sub_packet_u16(pkt)
1203 || !WPACKET_close(pkt)) {
1222 int tls_parse_stoc_renegotiate(SSL *s, PACKET *pkt, unsigned int context,
1241 if (!PACKET_get_1_len(pkt, &ilen)) {
1248 if (PACKET_remaining(pkt) != ilen) {
1261 if (!PACKET_get_bytes(pkt, &data, s->s3->previous_client_finished_len)
1269 if (!PACKET_get_bytes(pkt, &data, s->s3->previous_server_finished_len)
1282 int tls_parse_stoc_maxfragmentlen(SSL *s, PACKET *pkt, unsigned int context,
1287 if (PACKET_remaining(pkt) != 1 || !PACKET_get_1(pkt, &value)) {
1323 int tls_parse_stoc_server_name(SSL *s, PACKET *pkt, unsigned int context,
1332 if (PACKET_remaining(pkt) > 0) {
1356 int tls_parse_stoc_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
1362 if (!PACKET_as_length_prefixed_1(pkt, &ecptformatlist)) {
1400 int tls_parse_stoc_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
1404 !s->ext.session_ticket_cb(s, PACKET_data(pkt),
1405 PACKET_remaining(pkt),
1417 if (PACKET_remaining(pkt) > 0) {
1429 int tls_parse_stoc_status_request(SSL *s, PACKET *pkt, unsigned int context,
1447 if (!SSL_IS_TLS13(s) && PACKET_remaining(pkt) > 0) {
1461 return tls_process_cert_status_body(s, pkt);
1473 int tls_parse_stoc_sct(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1488 size_t size = PACKET_remaining(pkt);
1503 if (!PACKET_copy_bytes(pkt, s->ext.scts, size)) {
1527 PACKET_data(pkt), PACKET_remaining(pkt),
1545 static int ssl_next_proto_validate(SSL *s, PACKET *pkt)
1549 while (PACKET_remaining(pkt)) {
1550 if (!PACKET_get_length_prefixed_1(pkt, &tmp_protocol)
1561 int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1580 tmppkt = *pkt;
1586 PACKET_data(pkt),
1587 PACKET_remaining(pkt),
1616 int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1633 if (!PACKET_get_net_2_len(pkt, &len)
1634 || PACKET_remaining(pkt) != len || !PACKET_get_1_len(pkt, &len)
1635 || PACKET_remaining(pkt) != len) {
1648 if (!PACKET_copy_bytes(pkt, s->s3->alpn_selected, len)) {
1687 int tls_parse_stoc_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1695 if (!PACKET_get_net_2(pkt, &ct) || ct != 2
1696 || !PACKET_get_net_2(pkt, &id)
1697 || !PACKET_get_1(pkt, &mki)
1698 || PACKET_remaining(pkt) != 0) {
1738 int tls_parse_stoc_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1750 int tls_parse_stoc_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1760 int tls_parse_stoc_supported_versions(SSL *s, PACKET *pkt, unsigned int context,
1765 if (!PACKET_get_net_2(pkt, &version)
1766 || PACKET_remaining(pkt) != 0) {
1794 int tls_parse_stoc_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1809 if (!PACKET_get_net_2(pkt, &group_id)) {
1819 if (PACKET_remaining(pkt) != 0) {
1864 if (!PACKET_as_length_prefixed_2(pkt, &encoded_pt)
1896 int tls_parse_stoc_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1901 if (!PACKET_as_length_prefixed_2(pkt, &cookie)
1912 int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context,
1918 if (!PACKET_get_net_4(pkt, &max_early_data)
1919 || PACKET_remaining(pkt) != 0) {
1930 if (PACKET_remaining(pkt) != 0) {
1953 int tls_parse_stoc_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
1959 if (!PACKET_get_net_2(pkt, &identity) || PACKET_remaining(pkt) != 0) {