diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index 6c0e5a410..9de7b1d5c 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -72,7 +72,6 @@ const char *des_options(void) { const char *ptr,*unroll,*risc,*size; - init=0; #ifdef DES_PTR ptr="ptr"; #else @@ -98,6 +97,7 @@ const char *des_options(void) else size="long"; sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size); + init=0; } return(buf); } diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index dbf13e686..5b2db35aa 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -241,7 +241,6 @@ static void ssleay_rand_bytes(unsigned char *buf, int num) if (init) { - init=0; CRYPTO_w_unlock(CRYPTO_LOCK_RAND); /* put in some default random data, we need more than * just this */ @@ -281,6 +280,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num) memset(md,0,MD_DIGEST_LENGTH); #endif CRYPTO_w_lock(CRYPTO_LOCK_RAND); + init=0; } st_idx=state_index; diff --git a/crypto/x509v3/v3err.c b/crypto/x509v3/v3err.c index a00dda754..febd36dfc 100644 --- a/crypto/x509v3/v3err.c +++ b/crypto/x509v3/v3err.c @@ -151,7 +151,7 @@ static ERR_STRING_DATA X509V3_str_reasons[]= #endif -void ERR_load_X509V3_strings(void) +void ERR_load_X509V3_strings() { static int init=1; diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index 61c742013..c7f85a621 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -94,11 +94,11 @@ SSL_METHOD *SSLv23_client_method(void) if (init) { - init=0; memcpy((char *)&SSLv23_client_data, (char *)sslv23_base_method(),sizeof(SSL_METHOD)); SSLv23_client_data.ssl_connect=ssl23_connect; SSLv23_client_data.get_ssl_method=ssl23_get_client_method; + init=0; } return(&SSLv23_client_data); } diff --git a/ssl/s23_meth.c b/ssl/s23_meth.c index edcbdbb2b..f1f81325b 100644 --- a/ssl/s23_meth.c +++ b/ssl/s23_meth.c @@ -85,12 +85,12 @@ SSL_METHOD *SSLv23_method(void) if (init) { - init=0; memcpy((char *)&SSLv23_data,(char *)sslv23_base_method(), sizeof(SSL_METHOD)); SSLv23_data.ssl_connect=ssl23_connect; SSLv23_data.ssl_accept=ssl23_accept; SSLv23_data.get_ssl_method=ssl23_get_method; + init=0; } return(&SSLv23_data); } diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c index 8dc0a0608..f626c9cb0 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -92,11 +92,11 @@ SSL_METHOD *SSLv23_server_method(void) if (init) { - init=0; memcpy((char *)&SSLv23_server_data, (char *)sslv23_base_method(),sizeof(SSL_METHOD)); SSLv23_server_data.ssl_accept=ssl23_accept; SSLv23_server_data.get_ssl_method=ssl23_get_server_method; + init=0; } return(&SSLv23_server_data); } diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index 5652549da..3a79fd741 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -103,11 +103,11 @@ SSL_METHOD *SSLv2_client_method(void) if (init) { - init=0; memcpy((char *)&SSLv2_client_data,(char *)sslv2_base_method(), sizeof(SSL_METHOD)); SSLv2_client_data.ssl_connect=ssl2_connect; SSLv2_client_data.get_ssl_method=ssl2_get_client_method; + init=0; } return(&SSLv2_client_data); } diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index 43c7cab3e..4c734c9ac 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -316,7 +316,7 @@ SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p) if (init) { - init=0; + CRYPTO_w_lock(CRYPTO_LOCK_SSL); for (i=0; i