diff options
author | jsing <> | 2017-07-16 18:14:37 +0000 |
---|---|---|
committer | jsing <> | 2017-07-16 18:14:37 +0000 |
commit | 231770c97badca4c3da92986469ccbd7bf13471d (patch) | |
tree | d9fc4f0686256f704a616fd78164deb16cbfba14 /src/lib/libssl/ssl_tlsext.h | |
parent | 78c8f5de9ccfc2a6133cb7cb00d67a257d2d4f46 (diff) | |
download | openbsd-231770c97badca4c3da92986469ccbd7bf13471d.tar.gz openbsd-231770c97badca4c3da92986469ccbd7bf13471d.tar.bz2 openbsd-231770c97badca4c3da92986469ccbd7bf13471d.zip |
Start rewriting TLS extension handling.
Introduce a TLS extension handling framework that has per-extension type
functions to determine if an extension is needed, to build the extension
data and parse the extension data. This is somewhat analogous to BoringSSL,
however these build and parse functions are intentionally symetrical. The
framework is hooked into the existing TLS handling code in such a way that
we can gradual convert the extension handling code.
Convert the TLS Server Name Indication extension to the new framework,
while rewriting it to use CBB/CBS and be more strict in the process.
Discussed with beck@
ok inoguchi@
Diffstat (limited to 'src/lib/libssl/ssl_tlsext.h')
-rw-r--r-- | src/lib/libssl/ssl_tlsext.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/libssl/ssl_tlsext.h b/src/lib/libssl/ssl_tlsext.h new file mode 100644 index 0000000000..a8e478d9c0 --- /dev/null +++ b/src/lib/libssl/ssl_tlsext.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* $OpenBSD: ssl_tlsext.h,v 1.1 2017/07/16 18:14:37 jsing Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | int tlsext_sni_clienthello_needs(SSL *s); | ||
19 | int tlsext_sni_clienthello_build(SSL *s, CBB *cbb); | ||
20 | int tlsext_sni_clienthello_parse(SSL *s, CBS *cbs, int *alert); | ||
21 | int tlsext_sni_serverhello_needs(SSL *s); | ||
22 | int tlsext_sni_serverhello_build(SSL *s, CBB *cbb); | ||
23 | int tlsext_sni_serverhello_parse(SSL *s, CBS *cbs, int *alert); | ||
24 | |||
25 | int tlsext_clienthello_build(SSL *s, CBB *cbb); | ||
26 | int tlsext_clienthello_parse_one(SSL *s, CBS *cbs, uint16_t tlsext_type, | ||
27 | int *alert); | ||
28 | |||
29 | int tlsext_serverhello_build(SSL *s, CBB *cbb); | ||
30 | int tlsext_serverhello_parse_one(SSL *s, CBS *cbs, uint16_t tlsext_type, | ||
31 | int *alert); | ||