diff options
| author | beck <> | 2002-05-15 02:29:21 +0000 |
|---|---|---|
| committer | beck <> | 2002-05-15 02:29:21 +0000 |
| commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
| tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/cryptlib.c | |
| parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
| download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip | |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/cryptlib.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index a7a9262133..612b3b93b4 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | #include <openssl/crypto.h> | 62 | #include <openssl/crypto.h> |
| 63 | #include <openssl/safestack.h> | 63 | #include <openssl/safestack.h> |
| 64 | 64 | ||
| 65 | #if defined(WIN32) || defined(WIN16) | 65 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) |
| 66 | static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */ | 66 | static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */ |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| @@ -74,7 +74,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] = | |||
| 74 | { | 74 | { |
| 75 | "<<ERROR>>", | 75 | "<<ERROR>>", |
| 76 | "err", | 76 | "err", |
| 77 | "err_hash", | 77 | "ex_data", |
| 78 | "x509", | 78 | "x509", |
| 79 | "x509_info", | 79 | "x509_info", |
| 80 | "x509_pkey", | 80 | "x509_pkey", |
| @@ -90,6 +90,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] = | |||
| 90 | "ssl_sess_cert", | 90 | "ssl_sess_cert", |
| 91 | "ssl", | 91 | "ssl", |
| 92 | "rand", | 92 | "rand", |
| 93 | "rand2", | ||
| 93 | "debug_malloc", | 94 | "debug_malloc", |
| 94 | "BIO", | 95 | "BIO", |
| 95 | "gethostbyname", | 96 | "gethostbyname", |
| @@ -101,7 +102,8 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] = | |||
| 101 | "dso", | 102 | "dso", |
| 102 | "dynlock", | 103 | "dynlock", |
| 103 | "engine", | 104 | "engine", |
| 104 | #if CRYPTO_NUM_LOCKS != 29 | 105 | "ui", |
| 106 | #if CRYPTO_NUM_LOCKS != 31 | ||
| 105 | # error "Inconsistency between crypto.h and cryptlib.c" | 107 | # error "Inconsistency between crypto.h and cryptlib.c" |
| 106 | #endif | 108 | #endif |
| 107 | }; | 109 | }; |
| @@ -133,11 +135,11 @@ int CRYPTO_get_new_lockid(char *name) | |||
| 133 | char *str; | 135 | char *str; |
| 134 | int i; | 136 | int i; |
| 135 | 137 | ||
| 138 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) | ||
| 136 | /* A hack to make Visual C++ 5.0 work correctly when linking as | 139 | /* A hack to make Visual C++ 5.0 work correctly when linking as |
| 137 | * a DLL using /MT. Without this, the application cannot use | 140 | * a DLL using /MT. Without this, the application cannot use |
| 138 | * and floating point printf's. | 141 | * and floating point printf's. |
| 139 | * It also seems to be needed for Visual C 1.5 (win16) */ | 142 | * It also seems to be needed for Visual C 1.5 (win16) */ |
| 140 | #if defined(WIN32) || defined(WIN16) | ||
| 141 | SSLeay_MSVC5_hack=(double)name[0]*(double)name[1]; | 143 | SSLeay_MSVC5_hack=(double)name[0]*(double)name[1]; |
| 142 | #endif | 144 | #endif |
| 143 | 145 | ||
| @@ -228,7 +230,10 @@ void CRYPTO_destroy_dynlockid(int i) | |||
| 228 | CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); | 230 | CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); |
| 229 | 231 | ||
| 230 | if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks)) | 232 | if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks)) |
| 233 | { | ||
| 234 | CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); | ||
| 231 | return; | 235 | return; |
| 236 | } | ||
| 232 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); | 237 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); |
| 233 | if (pointer != NULL) | 238 | if (pointer != NULL) |
| 234 | { | 239 | { |
| @@ -354,9 +359,9 @@ unsigned long CRYPTO_thread_id(void) | |||
| 354 | 359 | ||
| 355 | if (id_callback == NULL) | 360 | if (id_callback == NULL) |
| 356 | { | 361 | { |
| 357 | #ifdef WIN16 | 362 | #ifdef OPENSSL_SYS_WIN16 |
| 358 | ret=(unsigned long)GetCurrentTask(); | 363 | ret=(unsigned long)GetCurrentTask(); |
| 359 | #elif defined(WIN32) | 364 | #elif defined(OPENSSL_SYS_WIN32) |
| 360 | ret=(unsigned long)GetCurrentThreadId(); | 365 | ret=(unsigned long)GetCurrentThreadId(); |
| 361 | #elif defined(GETPID_IS_MEANINGLESS) | 366 | #elif defined(GETPID_IS_MEANINGLESS) |
| 362 | ret=1L; | 367 | ret=1L; |
| @@ -462,7 +467,7 @@ const char *CRYPTO_get_lock_name(int type) | |||
| 462 | } | 467 | } |
| 463 | 468 | ||
| 464 | #ifdef _DLL | 469 | #ifdef _DLL |
| 465 | #ifdef WIN32 | 470 | #ifdef OPENSSL_SYS_WIN32 |
| 466 | 471 | ||
| 467 | /* All we really need to do is remove the 'error' state when a thread | 472 | /* All we really need to do is remove the 'error' state when a thread |
| 468 | * detaches */ | 473 | * detaches */ |
