Fix BN_[pseudo_]rand: 'mask' must be used even if top=-1.
[oweals/openssl.git] / crypto / cryptlib.c
index cf291b4be573780506684368b94e0d9ae52718d5..8634c078d8f376a55b7b19c5ea1482bb5acb77f6 100644 (file)
@@ -66,8 +66,8 @@
 static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
 #endif
 
-DECLARE_STACK_OF(CRYPTO_dynlock);
-IMPLEMENT_STACK_OF(CRYPTO_dynlock);
+DECLARE_STACK_OF(CRYPTO_dynlock)
+IMPLEMENT_STACK_OF(CRYPTO_dynlock)
 
 /* real #defines in crypto.h, keep these upto date */
 static const char* lock_names[CRYPTO_NUM_LOCKS] =
@@ -100,7 +100,8 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
        "debug_malloc2",
        "dso",
        "dynlock",
-#if CRYPTO_NUM_LOCKS != 28
+       "engine",
+#if CRYPTO_NUM_LOCKS != 29
 # error "Inconsistency between crypto.h and cryptlib.c"
 #endif
        };
@@ -132,11 +133,11 @@ int CRYPTO_get_new_lockid(char *name)
        char *str;
        int i;
 
+#if defined(WIN32) || defined(WIN16)
        /* A hack to make Visual C++ 5.0 work correctly when linking as
         * a DLL using /MT. Without this, the application cannot use
         * and floating point printf's.
         * It also seems to be needed for Visual C 1.5 (win16) */
-#if defined(WIN32) || defined(WIN16)
        SSLeay_MSVC5_hack=(double)name[0]*(double)name[1];
 #endif
 
@@ -175,7 +176,7 @@ int CRYPTO_get_new_dynlockid(void)
                }
        CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
        if ((dyn_locks == NULL)
-               && ((dyn_locks=sk_new_null()) == NULL))
+               && ((dyn_locks=sk_CRYPTO_dynlock_new_null()) == NULL))
                {
                CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
                CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,ERR_R_MALLOC_FAILURE);