From: Matt Caswell Date: Mon, 10 Apr 2017 15:18:26 +0000 (+0100) Subject: Only send custom extensions where we have received one in the ClientHello X-Git-Tag: OpenSSL_1_1_1-pre1~1608 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7f533d6fa1e1497e3c43630952528521b2627f53;p=oweals%2Fopenssl.git Only send custom extensions where we have received one in the ClientHello We already did this for ServerHello and EncryptedExtensions. We should be doing it for Certificate and HelloRetryRequest as well. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3298) --- diff --git a/ssl/statem/extensions_cust.c b/ssl/statem/extensions_cust.c index 6de59e2425..2a21ec492c 100644 --- a/ssl/statem/extensions_cust.c +++ b/ssl/statem/extensions_cust.c @@ -181,11 +181,10 @@ int custom_ext_add(SSL *s, int context, WPACKET *pkt, X509 *x, size_t chainidx, if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO - | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS)) != 0) { - /* - * For ServerHello/EncryptedExtensions only send extensions present - * in ClientHello. - */ + | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS + | SSL_EXT_TLS1_3_CERTIFICATE + | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) { + /* Only send extensions present in ClientHello. */ if (!(meth->ext_flags & SSL_EXT_FLAG_RECEIVED)) continue; }