summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_sess.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2020-09-17 15:23:30 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2020-09-17 15:23:30 +0000
commitf54899523eb5d5d3b68a4401bf05ea642bb08754 (patch)
treeb0dc3ef9cd8fe597f7d6e550f085ee8b0caa3540 /lib/libssl/ssl_sess.c
parent2c6687089e8711e26c6388eafd3160bff307297e (diff)
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_sess.c')
-rw-r--r--lib/libssl/ssl_sess.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c
index 4f9252679aa..191e43b74ba 100644
--- a/lib/libssl/ssl_sess.c
+++ b/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_sess.c,v 1.98 2020/09/14 18:25:23 jsing Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.99 2020/09/17 15:23:29 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -785,9 +785,7 @@ SSL_set_session(SSL *s, SSL_SESSION *session)
return SSL_set_ssl_method(s, s->ctx->method);
}
- if ((method = tls1_get_client_method(session->ssl_version)) == NULL)
- method = dtls1_get_client_method(session->ssl_version);
- if (method == NULL) {
+ if ((method = ssl_get_client_method(session->ssl_version)) == NULL) {
SSLerror(s, SSL_R_UNABLE_TO_FIND_SSL_METHOD);
return (0);
}