diff options
author | tb <> | 2023-04-23 18:51:53 +0000 |
---|---|---|
committer | tb <> | 2023-04-23 18:51:53 +0000 |
commit | fb7a7adad4b566192144a21e4c93b739671b0cae (patch) | |
tree | fa6d649a58d3a734a4bc9dea3b97a71426074f8b /src/lib/libssl/ssl_tlsext.h | |
parent | 292e18c3ddebe32b0e929925c98c01b416d0210e (diff) | |
download | openbsd-fb7a7adad4b566192144a21e4c93b739671b0cae.tar.gz openbsd-fb7a7adad4b566192144a21e4c93b739671b0cae.tar.bz2 openbsd-fb7a7adad4b566192144a21e4c93b739671b0cae.zip |
Randomize the order of TLS extensions
On creation of an SSL using SSL_new(), randomize the order in which the
extensions will be sent. There are several constraints: the PSK extension
must always come last. The order cannot be randomized on a per-message
basis as the strict interpretation of the standard chosen in the CH hashing
doesn't allow changing the order between first and second ClientHello.
Another constraint is that the current code calls callbacks directly on
parsing an extension, which means that the order callbacks are called
depends on the order in which the peer sent the extensions. This results
in breaking apache-httpd setups using virtual hosts with full ranomization
because virtual hosts don't work if the SNI is unknown at the time the
ALPN callback is called. So for the time being, we ensure that SNI always
precedes ALPN to avoid issues until this issue is fixed.
This is based on an idea by David Benjamin
https://boringssl-review.googlesource.com/c/boringssl/+/48045
Input & ok jsing
Diffstat (limited to 'src/lib/libssl/ssl_tlsext.h')
-rw-r--r-- | src/lib/libssl/ssl_tlsext.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_tlsext.h b/src/lib/libssl/ssl_tlsext.h index 7a41c8095d..da14f7fa94 100644 --- a/src/lib/libssl/ssl_tlsext.h +++ b/src/lib/libssl/ssl_tlsext.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_tlsext.h,v 1.32 2022/08/04 09:27:36 tb Exp $ */ | 1 | /* $OpenBSD: ssl_tlsext.h,v 1.33 2023/04/23 18:51:53 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> | 4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> |
@@ -41,6 +41,7 @@ int tlsext_server_build(SSL *s, uint16_t msg_type, CBB *cbb); | |||
41 | int tlsext_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert); | 41 | int tlsext_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert); |
42 | 42 | ||
43 | int tlsext_extension_seen(SSL *s, uint16_t); | 43 | int tlsext_extension_seen(SSL *s, uint16_t); |
44 | int tlsext_randomize_build_order(SSL *s); | ||
44 | 45 | ||
45 | __END_HIDDEN_DECLS | 46 | __END_HIDDEN_DECLS |
46 | 47 | ||