summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_tlsext.h
blob: 0c8144548908bc582bce3f3c2339a09af91d1bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* $OpenBSD: tls13_tlsext.h,v 1.2 2019/01/17 02:55:48 beck Exp $ */
/*
 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef HEADER_SSL_TLS13_TLSEXT_H
#define HEADER_SSL_TLS13_TLSEXT_H

/* RFC 8446 Section 4.2 */
#define TLS13_TLSEXT_MSG_CH	0x0001	/* ClientHello */
#define TLS13_TLSEXT_MSG_SH	0x0002	/* ServerHello */
#define TLS13_TLSEXT_MSG_EE	0x0004	/* EncryptedExtension */
#define TLS13_TLSEXT_MSG_CT	0x0008	/* Certificate */
#define TLS13_TLSEXT_MSG_CR	0x0010	/* CertificateRequest */
#define TLS13_TLSEXT_MSG_NST	0x0020	/* NewSessionTicket */
#define TLS13_TLSEXT_MSG_HRR	0x0030	/* HelloRetryRequest */

__BEGIN_HIDDEN_DECLS

int tls13_tlsext_alpn_clienthello_needs(SSL *s);
int tls13_tlsext_alpn_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_alpn_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_alpn_serverhello_needs(SSL *s);
int tls13_tlsext_alpn_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_alpn_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_ri_clienthello_needs(SSL *s);
int tls13_tlsext_ri_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ri_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_ri_serverhello_needs(SSL *s);
int tls13_tlsext_ri_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ri_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_sigalgs_clienthello_needs(SSL *s);
int tls13_tlsext_sigalgs_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sigalgs_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_sigalgs_serverhello_needs(SSL *s);
int tls13_tlsext_sigalgs_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sigalgs_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_sni_clienthello_needs(SSL *s);
int tls13_tlsext_sni_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sni_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_sni_serverhello_needs(SSL *s);
int tls13_tlsext_sni_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sni_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_supportedgroups_clienthello_needs(SSL *s);
int tls13_tlsext_supportedgroups_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_supportedgroups_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_supportedgroups_serverhello_needs(SSL *s);
int tls13_tlsext_supportedgroups_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_supportedgroups_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_ecpf_clienthello_needs(SSL *s);
int tls13_tlsext_ecpf_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ecpf_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_ecpf_serverhello_needs(SSL *s);
int tls13_tlsext_ecpf_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ecpf_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_ocsp_clienthello_needs(SSL *s);
int tls13_tlsext_ocsp_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ocsp_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_ocsp_serverhello_needs(SSL *s);
int tls13_tlsext_ocsp_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_ocsp_serverhello_parse(SSL *s, CBS *cbs, int *alert);

int tls13_tlsext_sessionticket_clienthello_needs(SSL *s);
int tls13_tlsext_sessionticket_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sessionticket_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_sessionticket_serverhello_needs(SSL *s);
int tls13_tlsext_sessionticket_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_sessionticket_serverhello_parse(SSL *s, CBS *cbs, int *alert);

#ifndef OPENSSL_NO_SRTP
int tls13_tlsext_srtp_clienthello_needs(SSL *s);
int tls13_tlsext_srtp_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_srtp_clienthello_parse(SSL *s, CBS *cbs, int *alert);
int tls13_tlsext_srtp_serverhello_needs(SSL *s);
int tls13_tlsext_srtp_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_srtp_serverhello_parse(SSL *s, CBS *cbs, int *alert);
#endif

int tls13_tlsext_clienthello_build(SSL *s, CBB *cbb);
int tls13_tlsext_clienthello_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg);

int tls13_tlsext_serverhello_build(SSL *s, CBB *cbb);
int tls13_tlsext_serverhello_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg);

__END_HIDDEN_DECLS

#endif