X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=ssl%2Fd1_meth.c;h=5c4004bfe3c7ddf97e2c32127c833e6fe04fb3df;hb=2daceb0342c8ca3514f37796e7f983e232d63f2a;hp=dc4c8ede8667b17d243ceae9d7600f164b53415b;hpb=36d16f8ee0845d932e250286e8e236580470e35b;p=oweals%2Fopenssl.git diff --git a/ssl/d1_meth.c b/ssl/d1_meth.c index dc4c8ede86..5c4004bfe3 100644 --- a/ssl/d1_meth.c +++ b/ssl/d1_meth.c @@ -61,8 +61,8 @@ #include #include "ssl_locl.h" -static SSL_METHOD *dtls1_get_method(int ver); -static SSL_METHOD *dtls1_get_method(int ver) +static const SSL_METHOD *dtls1_get_method(int ver); +static const SSL_METHOD *dtls1_get_method(int ver) { if (ver == DTLS1_VERSION) return(DTLSv1_method()); @@ -70,27 +70,8 @@ static SSL_METHOD *dtls1_get_method(int ver) return(NULL); } -SSL_METHOD *DTLSv1_method(void) - { - static int init=1; - static SSL_METHOD DTLSv1_data; - - if (init) - { - CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - - if (init) - { - memcpy((char *)&DTLSv1_data,(char *)dtlsv1_base_method(), - sizeof(SSL_METHOD)); - DTLSv1_data.ssl_connect=dtls1_connect; - DTLSv1_data.ssl_accept=dtls1_accept; - DTLSv1_data.get_ssl_method=dtls1_get_method; - init=0; - } +IMPLEMENT_dtls1_meth_func(DTLSv1_method, + dtls1_accept, + dtls1_connect, + dtls1_get_method) - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - - return(&DTLSv1_data); - }