diff options
author | jsing <> | 2020-09-17 15:23:29 +0000 |
---|---|---|
committer | jsing <> | 2020-09-17 15:23:29 +0000 |
commit | 8b329cf90019dcaa45de44d9c3b2eed853ec9429 (patch) | |
tree | ab0f21a1d37a85215ffbd688a792523e6b1b6726 /src/lib/libssl/ssl_srvr.c | |
parent | c48a963f213a6f89d842f72d054aaa8907dee25f (diff) | |
download | openbsd-8b329cf90019dcaa45de44d9c3b2eed853ec9429.tar.gz openbsd-8b329cf90019dcaa45de44d9c3b2eed853ec9429.tar.bz2 openbsd-8b329cf90019dcaa45de44d9c3b2eed853ec9429.zip |
Simplify SSL method lookups.
There are three places where we call tls1_get_{client,server}_method() and
if that returns NULL, call dtls1_get_{client,server}_method(). Simplify
this by combining the lookup into a single function. While here also use
uint16_t for version types.
ok inoguchi@ millert@
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index eaaa57efb3..f69be70f04 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.83 2020/09/12 17:27:11 tb Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.84 2020/09/17 15:23:29 jsing 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 | * |
@@ -870,9 +870,7 @@ ssl3_get_client_hello(SSL *s) | |||
870 | s->client_version = client_version; | 870 | s->client_version = client_version; |
871 | s->version = shared_version; | 871 | s->version = shared_version; |
872 | 872 | ||
873 | if ((method = tls1_get_server_method(shared_version)) == NULL) | 873 | if ((method = ssl_get_server_method(shared_version)) == NULL) { |
874 | method = dtls1_get_server_method(shared_version); | ||
875 | if (method == NULL) { | ||
876 | SSLerror(s, ERR_R_INTERNAL_ERROR); | 874 | SSLerror(s, ERR_R_INTERNAL_ERROR); |
877 | goto err; | 875 | goto err; |
878 | } | 876 | } |