diff options
author | 2020-09-17 15:23:29 +0000 | |
---|---|---|
committer | 2020-09-17 15:23:29 +0000 | |
commit | bfc125def3cf0f5ce55e16d56d0074d883706f74 (patch) | |
tree | e548ee5ca9a6d30f6da28dfc46c9419e34f16970 /lib/libssl/ssl_clnt.c | |
parent | Fix the previous commit whose conditions were reversed. (diff) | |
download | wireguard-openbsd-bfc125def3cf0f5ce55e16d56d0074d883706f74.tar.xz wireguard-openbsd-bfc125def3cf0f5ce55e16d56d0074d883706f74.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 'lib/libssl/ssl_clnt.c')
-rw-r--r-- | lib/libssl/ssl_clnt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libssl/ssl_clnt.c b/lib/libssl/ssl_clnt.c index 68c7a835959..d62928a093f 100644 --- a/lib/libssl/ssl_clnt.c +++ b/lib/libssl/ssl_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_clnt.c,v 1.71 2020/09/11 17:36:27 jsing Exp $ */ +/* $OpenBSD: ssl_clnt.c,v 1.72 2020/09/17 15:23:29 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -857,9 +857,7 @@ ssl3_get_server_hello(SSL *s) } s->version = server_version; - if ((method = tls1_get_client_method(server_version)) == NULL) - method = dtls1_get_client_method(server_version); - if (method == NULL) { + if ((method = ssl_get_client_method(server_version)) == NULL) { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } |