aboutsummaryrefslogtreecommitdiff
path: root/ssl/methods.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 16:28:50 +0000
committerMatt Caswell <matt@openssl.org>2015-11-05 15:05:58 +0000
commitcf0113eb47111b437658844bfc1ea87c38ca19ad (patch)
tree7968343fcece90a62842cef9a27f9dd3c398b33b /ssl/methods.c
parent3d866ea67e8b19777e88ac2a78ee4188e0983168 (diff)
downloadopenssl-cf0113eb47111b437658844bfc1ea87c38ca19ad.zip
openssl-cf0113eb47111b437658844bfc1ea87c38ca19ad.tar.gz
openssl-cf0113eb47111b437658844bfc1ea87c38ca19ad.tar.bz2
Ensure the dtls1_get_*_methods work with DTLS_ANY_VERSION
The various dtls1_get*_methods did not handle the DTLS_ANY_VERSION case, so this needed to be added. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/methods.c')
-rw-r--r--ssl/methods.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/ssl/methods.c b/ssl/methods.c
index 3319119..ef20c9c 100644
--- a/ssl/methods.c
+++ b/ssl/methods.c
@@ -258,12 +258,14 @@ IMPLEMENT_ssl3_meth_func(SSLv3_client_method,
*/
static const SSL_METHOD *dtls1_get_method(int ver)
{
- if (ver == DTLS1_VERSION)
- return (DTLSv1_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_method();
+ else if (ver == DTLS1_VERSION)
+ return DTLSv1_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_method());
+ return DTLSv1_2_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -291,12 +293,14 @@ IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
static const SSL_METHOD *dtls1_get_server_method(int ver)
{
- if (ver == DTLS1_VERSION)
- return (DTLSv1_server_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_server_method();
+ else if (ver == DTLS1_VERSION)
+ return DTLSv1_server_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_server_method());
+ return DTLSv1_2_server_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -324,12 +328,14 @@ IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
static const SSL_METHOD *dtls1_get_client_method(int ver)
{
- if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER)
- return (DTLSv1_client_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_client_method();
+ else if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER)
+ return DTLSv1_client_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_client_method());
+ return DTLSv1_2_client_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,