提交 837f87c2 编写于 作者: P Paul Yang 提交者: Rich Salz

Forbid to specify -nextprotoneg if -tls1_3 is enabled

This applies both to s_client and s_server app.

Reaction to Issue #3665.
Signed-off-by: NPaul Yang <paulyang.inf@gmail.com>
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3697)
上级 6ea3bca4
...@@ -1424,6 +1424,12 @@ int s_client_main(int argc, char **argv) ...@@ -1424,6 +1424,12 @@ int s_client_main(int argc, char **argv)
if (argc != 0) if (argc != 0)
goto opthelp; goto opthelp;
#ifndef OPENSSL_NO_NEXTPROTONEG
if (min_version == TLS1_3_VERSION && next_proto_neg_in != NULL) {
BIO_printf(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
goto opthelp;
}
#endif
if (proxystr != NULL) { if (proxystr != NULL) {
int res; int res;
char *tmp_host = host, *tmp_port = port; char *tmp_host = host, *tmp_port = port;
......
...@@ -1536,6 +1536,12 @@ int s_server_main(int argc, char *argv[]) ...@@ -1536,6 +1536,12 @@ int s_server_main(int argc, char *argv[])
argc = opt_num_rest(); argc = opt_num_rest();
argv = opt_rest(); argv = opt_rest();
#ifndef OPENSSL_NO_NEXTPROTONEG
if (min_version == TLS1_3_VERSION && next_proto_neg_in != NULL) {
BIO_printf(bio_err, "Cannot supply -nextprotoneg with TLSv1.3\n");
goto opthelp;
}
#endif
#ifndef OPENSSL_NO_DTLS #ifndef OPENSSL_NO_DTLS
if (www && socket_type == SOCK_DGRAM) { if (www && socket_type == SOCK_DGRAM) {
BIO_printf(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n"); BIO_printf(bio_err, "Can't use -HTTP, -www or -WWW with DTLS\n");
......
...@@ -564,6 +564,7 @@ for example "http/1.1" or "spdy/3". ...@@ -564,6 +564,7 @@ for example "http/1.1" or "spdy/3".
An empty list of protocols is treated specially and will cause the An empty list of protocols is treated specially and will cause the
client to advertise support for the TLS extension but disconnect just client to advertise support for the TLS extension but disconnect just
after receiving ServerHello with a list of server supported protocols. after receiving ServerHello with a list of server supported protocols.
The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
=item B<-ct|noct> =item B<-ct|noct>
......
...@@ -609,6 +609,7 @@ The B<val> list is a comma-separated list of supported protocol ...@@ -609,6 +609,7 @@ The B<val> list is a comma-separated list of supported protocol
names. The list should contain the most desirable protocols first. names. The list should contain the most desirable protocols first.
Protocol names are printable ASCII strings, for example "http/1.1" or Protocol names are printable ASCII strings, for example "http/1.1" or
"spdy/3". "spdy/3".
The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
=item B<-engine val> =item B<-engine val>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册