From 76e9f577da320593c54eb46e4ae17bbf74fec42b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 2 Nov 2021 14:39:09 +0000 Subject: Add regress that calls SSL_set_tlsext_host_name() with a NULL host name. --- src/regress/lib/libssl/tlsext/tlsexttest.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c index 21e096cf60..9bd438f24b 100644 --- a/src/regress/lib/libssl/tlsext/tlsexttest.c +++ b/src/regress/lib/libssl/tlsext/tlsexttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlsexttest.c,v 1.52 2021/11/01 16:39:01 jsing Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.53 2021/11/02 14:39:09 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -1722,6 +1722,20 @@ test_tlsext_sni_client(void) goto err; } + /* + * SSL_set_tlsext_host_name() may be called with a NULL host name to + * disable SNI. + */ + if (!SSL_set_tlsext_host_name(ssl, NULL)) { + FAIL("cannot set host name to NULL"); + goto err; + } + + if (tlsext_sni_client_needs(ssl, SSL_TLSEXT_MSG_CH)) { + FAIL("client should not need SNI\n"); + goto err; + } + if ((ssl->session = SSL_SESSION_new()) == NULL) { FAIL("failed to create session"); goto err; -- cgit v1.2.3-55-g6feb