summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_local.h
diff options
context:
space:
mode:
authortb <>2023-04-23 18:51:53 +0000
committertb <>2023-04-23 18:51:53 +0000
commitfb7a7adad4b566192144a21e4c93b739671b0cae (patch)
treefa6d649a58d3a734a4bc9dea3b97a71426074f8b /src/lib/libssl/ssl_local.h
parent292e18c3ddebe32b0e929925c98c01b416d0210e (diff)
downloadopenbsd-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_local.h')
-rw-r--r--src/lib/libssl/ssl_local.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_local.h b/src/lib/libssl/ssl_local.h
index d510f80d8c..1748eccbfd 100644
--- a/src/lib/libssl/ssl_local.h
+++ b/src/lib/libssl/ssl_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_local.h,v 1.3 2022/12/26 07:31:44 jmc Exp $ */ 1/* $OpenBSD: ssl_local.h,v 1.4 2023/04/23 18:51:53 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -974,6 +974,7 @@ struct ssl_st {
974 974
975 unsigned int max_send_fragment; 975 unsigned int max_send_fragment;
976 976
977 const struct tls_extension **tlsext_build_order;
977 char *tlsext_hostname; 978 char *tlsext_hostname;
978 979
979 /* certificate status request info */ 980 /* certificate status request info */