Extend DTLS method macros.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 19 Mar 2013 15:51:26 +0000 (15:51 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 18 Sep 2013 12:46:02 +0000 (13:46 +0100)
Extend DTLS method creation macros to support version numbers and encryption
methods. Update existing code.
(cherry picked from commit cfd298b7aef2b095bee8d172a6a40d6c59d1574b)

ssl/d1_clnt.c
ssl/d1_meth.c
ssl/d1_srvr.c
ssl/ssl_locl.h

index f2f991e6f78f7b8b267084caf8ea0fe33131449f..b1f8c5e8f4969873fd674dd1f86ce6372d6e1a54 100644 (file)
@@ -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)
        {
index 5c4004bfe3c7ddf97e2c32127c833e6fe04fb3df..0470624b3f0aa2f687a6131fe3487b3a8e518b30 100644 (file)
@@ -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)
 
index 6a3d3675de09019a6aa88f000c51ab372a91cc60..e96ef64e288a08cc5bf0be1b5a8a83bd04f3ce92 100644 (file)
@@ -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)
        {
index af7930943ea59de00910c6a71df3dc0cdf34971a..292d6e32e89c64afbdafca9f8d2923f2682afc6e 100644 (file)
@@ -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, \