X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fcryptlib.c;h=a8f29f1e65c2ac938959920a45d2283ed27e1905;hb=e84c2d267950e9f7c2a210edfee783be84dd83b4;hp=3285813a13d743dff5091aad1525e93623a9a98a;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 3285813a13..a8f29f1e65 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -59,8 +59,7 @@ #include #include #include "cryptlib.h" -#include "crypto.h" -#include "date.h" +#include #if defined(WIN32) || defined(WIN16) static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */ @@ -84,28 +83,29 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] = "ssl_ctx", "ssl_cert", "ssl_session", + "ssl_sess_cert", "ssl", "rand", "debug_malloc", "BIO", - "bio_gethostbyname", + "gethostbyname", + "getservbyname", + "readdir", "RSA_blinding", + "dh", + "debug_malloc2", +#if CRYPTO_NUM_LOCKS != 26 +# error "Inconsistency between crypto.h and cryptlib.c" +#endif }; static STACK *app_locks=NULL; -#ifndef NOPROTO static void (MS_FAR *locking_callback)(int mode,int type, const char *file,int line)=NULL; static int (MS_FAR *add_lock_callback)(int *pointer,int amount, int type,const char *file,int line)=NULL; static unsigned long (MS_FAR *id_callback)(void)=NULL; -#else -static void (MS_FAR *locking_callback)()=NULL; -static int (MS_FAR *add_lock_callback)()=NULL; -static unsigned long (MS_FAR *id_callback)()=NULL; -#endif - int CRYPTO_get_new_lockid(char *name) { char *str; @@ -134,6 +134,11 @@ int CRYPTO_get_new_lockid(char *name) return(i); } +int CRYPTO_num_locks(void) + { + return CRYPTO_NUM_LOCKS; + } + void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file, int line) { @@ -158,12 +163,12 @@ void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type, add_lock_callback=func; } -unsigned long (*CRYPTO_get_id_callback(P_V))(P_V) +unsigned long (*CRYPTO_get_id_callback(void))(void) { return(id_callback); } -void CRYPTO_set_id_callback(func) unsigned long (*func)(P_V); +void CRYPTO_set_id_callback(unsigned long (*func)(void)) { id_callback=func; } @@ -178,7 +183,7 @@ unsigned long CRYPTO_thread_id(void) ret=(unsigned long)GetCurrentTask(); #elif defined(WIN32) ret=(unsigned long)GetCurrentThreadId(); -#elif defined(MSDOS) +#elif defined(GETPID_IS_MEANINGLESS) ret=1L; #else ret=(unsigned long)getpid();