projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
As ftruncate is not availabe on all platforms, switch back to
[oweals/openssl.git]
/
crypto
/
cryptlib.c
diff --git
a/crypto/cryptlib.c
b/crypto/cryptlib.c
index 3614e3fc5d14da87333c3aec4af354dd3a8ecb95..a8f29f1e65c2ac938959920a45d2283ed27e1905 100644
(file)
--- a/
crypto/cryptlib.c
+++ b/
crypto/cryptlib.c
@@
-59,15
+59,14
@@
#include <stdio.h>
#include <string.h>
#include "cryptlib.h"
#include <stdio.h>
#include <string.h>
#include "cryptlib.h"
-#include "crypto.h"
-#include "date.h"
+#include <openssl/crypto.h>
#if defined(WIN32) || defined(WIN16)
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
/* real #defines in crypto.h, keep these upto date */
#if defined(WIN32) || defined(WIN16)
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
/* real #defines in crypto.h, keep these upto date */
-static char* lock_names[CRYPTO_NUM_LOCKS] =
+static c
onst c
har* lock_names[CRYPTO_NUM_LOCKS] =
{
"<<ERROR>>",
"err",
{
"<<ERROR>>",
"err",
@@
-84,30
+83,30
@@
static char* lock_names[CRYPTO_NUM_LOCKS] =
"ssl_ctx",
"ssl_cert",
"ssl_session",
"ssl_ctx",
"ssl_cert",
"ssl_session",
+ "ssl_sess_cert",
"ssl",
"rand",
"debug_malloc",
"BIO",
"ssl",
"rand",
"debug_malloc",
"BIO",
- "bio_gethostbyname",
+ "gethostbyname",
+ "getservbyname",
+ "readdir",
"RSA_blinding",
"RSA_blinding",
+ "dh",
+ "debug_malloc2",
+#if CRYPTO_NUM_LOCKS != 26
+# error "Inconsistency between crypto.h and cryptlib.c"
+#endif
};
static STACK *app_locks=NULL;
};
static STACK *app_locks=NULL;
-#ifndef NOPROTO
static void (MS_FAR *locking_callback)(int mode,int type,
static void (MS_FAR *locking_callback)(int mode,int type,
- char *file,int line)=NULL;
+ c
onst c
har *file,int line)=NULL;
static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
- int type,char *file,int line)=NULL;
+ int type,c
onst c
har *file,int line)=NULL;
static unsigned long (MS_FAR *id_callback)(void)=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(name)
-char *name;
+int CRYPTO_get_new_lockid(char *name)
{
char *str;
int i;
{
char *str;
int i;
@@
-135,40
+134,46
@@
char *name;
return(i);
}
return(i);
}
-void (*CRYPTO_get_locking_callback(P_V))(P_I_I_P_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)
{
return(locking_callback);
}
{
return(locking_callback);
}
-int (*CRYPTO_get_add_lock_callback(P_V))(P_IP_I_I_P_I)
+int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
+ const char *file,int line)
{
return(add_lock_callback);
}
{
return(add_lock_callback);
}
-void CRYPTO_set_locking_callback(
func)
-void (*func)(P_I_I_P_I);
+void CRYPTO_set_locking_callback(
void (*func)(int mode,int type,
+ const char *file,int line))
{
locking_callback=func;
}
{
locking_callback=func;
}
-void CRYPTO_set_add_lock_callback(
func)
-int (*func)(P_IP_I_I_P_I);
+void CRYPTO_set_add_lock_callback(
int (*func)(int *num,int mount,int type,
+ const char *file,int line))
{
add_lock_callback=func;
}
{
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);
}
{
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;
}
{
id_callback=func;
}
-unsigned long CRYPTO_thread_id()
+unsigned long CRYPTO_thread_id(
void
)
{
unsigned long ret=0;
{
unsigned long ret=0;
@@
-178,7
+183,7
@@
unsigned long CRYPTO_thread_id()
ret=(unsigned long)GetCurrentTask();
#elif defined(WIN32)
ret=(unsigned long)GetCurrentThreadId();
ret=(unsigned long)GetCurrentTask();
#elif defined(WIN32)
ret=(unsigned long)GetCurrentThreadId();
-#elif defined(
MSDO
S)
+#elif defined(
GETPID_IS_MEANINGLES
S)
ret=1L;
#else
ret=(unsigned long)getpid();
ret=1L;
#else
ret=(unsigned long)getpid();
@@
-189,11
+194,7
@@
unsigned long CRYPTO_thread_id()
return(ret);
}
return(ret);
}
-void CRYPTO_lock(mode,type,file,line)
-int mode;
-int type;
-char *file;
-int line;
+void CRYPTO_lock(int mode, int type, const char *file, int line)
{
#ifdef LOCK_DEBUG
{
{
#ifdef LOCK_DEBUG
{
@@
-222,12
+223,8
@@
int line;
locking_callback(mode,type,file,line);
}
locking_callback(mode,type,file,line);
}
-int CRYPTO_add_lock(pointer,amount,type,file,line)
-int *pointer;
-int amount;
-int type;
-char *file;
-int line;
+int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
+ int line)
{
int ret;
{
int ret;
@@
-265,8
+262,7
@@
int line;
return(ret);
}
return(ret);
}
-char *CRYPTO_get_lock_name(type)
-int type;
+const char *CRYPTO_get_lock_name(int type)
{
if (type < 0)
return("ERROR");
{
if (type < 0)
return("ERROR");
@@
-284,10
+280,8
@@
int type;
/* All we really need to do is remove the 'error' state when a thread
* detaches */
/* All we really need to do is remove the 'error' state when a thread
* detaches */
-BOOL WINAPI DLLEntryPoint(hinstDLL,fdwReason,lpvReserved)
-HINSTANCE hinstDLL;
-DWORD fdwReason;
-LPVOID lpvReserved;
+BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
+ LPVOID lpvReserved)
{
switch(fdwReason)
{
{
switch(fdwReason)
{