From: Dr. Stephen Henson Date: Tue, 19 Mar 2013 15:51:26 +0000 (+0000) Subject: Extend DTLS method macros. X-Git-Tag: OpenSSL_1_0_2-beta1~270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da1247d653440145a9e4dc059a5650d15bbacc6a;p=openssl Extend DTLS method macros. Extend DTLS method creation macros to support version numbers and encryption methods. Update existing code. (cherry picked from commit cfd298b7aef2b095bee8d172a6a40d6c59d1574b) --- diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index f2f991e6f7..b1f8c5e8f4 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -139,10 +139,12 @@ static const SSL_METHOD *dtls1_get_client_method(int ver) return(NULL); } -IMPLEMENT_dtls1_meth_func(DTLSv1_client_method, +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, + DTLSv1_client_method, ssl_undefined_function, dtls1_connect, - dtls1_get_client_method) + dtls1_get_client_method, + DTLSv1_enc_data) int dtls1_connect(SSL *s) { diff --git a/ssl/d1_meth.c b/ssl/d1_meth.c index 5c4004bfe3..0470624b3f 100644 --- a/ssl/d1_meth.c +++ b/ssl/d1_meth.c @@ -70,8 +70,10 @@ static const SSL_METHOD *dtls1_get_method(int ver) return(NULL); } -IMPLEMENT_dtls1_meth_func(DTLSv1_method, +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, + DTLSv1_method, dtls1_accept, dtls1_connect, - dtls1_get_method) + dtls1_get_method, + DTLSv1_enc_data) diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 6a3d3675de..e96ef64e28 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -137,10 +137,12 @@ static const SSL_METHOD *dtls1_get_server_method(int ver) return(NULL); } -IMPLEMENT_dtls1_meth_func(DTLSv1_server_method, +IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, + DTLSv1_server_method, dtls1_accept, ssl_undefined_function, - dtls1_get_server_method) + dtls1_get_server_method, + DTLSv1_enc_data) int dtls1_accept(SSL *s) { diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index af7930943e..292d6e32e8 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -910,11 +910,12 @@ const SSL_METHOD *func_name(void) \ return &func_name##_data; \ } -#define IMPLEMENT_dtls1_meth_func(func_name, s_accept, s_connect, s_get_meth) \ +#define IMPLEMENT_dtls1_meth_func(version, func_name, s_accept, s_connect, \ + s_get_meth, enc_data) \ const SSL_METHOD *func_name(void) \ { \ static const SSL_METHOD func_name##_data= { \ - DTLS1_VERSION, \ + version, \ dtls1_new, \ dtls1_clear, \ dtls1_free, \ @@ -939,7 +940,7 @@ const SSL_METHOD *func_name(void) \ dtls1_get_cipher, \ s_get_meth, \ dtls1_default_timeout, \ - &DTLSv1_enc_data, \ + &enc_data, \ ssl_undefined_void_function, \ ssl3_callback_ctrl, \ ssl3_ctx_callback_ctrl, \