summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_clnt.c
diff options
context:
space:
mode:
authorjsing <>2020-09-17 15:23:29 +0000
committerjsing <>2020-09-17 15:23:29 +0000
commit8b329cf90019dcaa45de44d9c3b2eed853ec9429 (patch)
treeab0f21a1d37a85215ffbd688a792523e6b1b6726 /src/lib/libssl/ssl_clnt.c
parentc48a963f213a6f89d842f72d054aaa8907dee25f (diff)
downloadopenbsd-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_clnt.c')
-rw-r--r--src/lib/libssl/ssl_clnt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 68c7a83595..d62928a093 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.71 2020/09/11 17:36:27 jsing Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.72 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 *
@@ -857,9 +857,7 @@ ssl3_get_server_hello(SSL *s)
857 } 857 }
858 s->version = server_version; 858 s->version = server_version;
859 859
860 if ((method = tls1_get_client_method(server_version)) == NULL) 860 if ((method = ssl_get_client_method(server_version)) == NULL) {
861 method = dtls1_get_client_method(server_version);
862 if (method == NULL) {
863 SSLerror(s, ERR_R_INTERNAL_ERROR); 861 SSLerror(s, ERR_R_INTERNAL_ERROR);
864 goto err; 862 goto err;
865 } 863 }