From: jsing Date: Tue, 2 Nov 2021 14:39:09 +0000 (+0000) Subject: Add regress that calls SSL_set_tlsext_host_name() with a NULL host name. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=73c65e27e71dd028195409d480507f7b8b7c77b8;p=openbsd Add regress that calls SSL_set_tlsext_host_name() with a NULL host name. --- diff --git a/regress/lib/libssl/tlsext/tlsexttest.c b/regress/lib/libssl/tlsext/tlsexttest.c index 21e096cf608..9bd438f24ba 100644 --- a/regress/lib/libssl/tlsext/tlsexttest.c +++ b/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;