fix submitted by Andy Schneider <andy.schneider@bjss.co.uk>
authorBodo Möller <bodo@openssl.org>
Fri, 23 Nov 2001 20:58:40 +0000 (20:58 +0000)
committerBodo Möller <bodo@openssl.org>
Fri, 23 Nov 2001 20:58:40 +0000 (20:58 +0000)
(in main branch, hn_ncipher.c is already correct)

CHANGES
crypto/cryptlib.c
crypto/engine/hw_ncipher.c

diff --git a/CHANGES b/CHANGES
index 5d785a03e2c9ff4276175d163c2be8b0ee456f32..f4d70fe867cc84c559a3eb8e1e57a6680d6b7cfe 100644 (file)
--- a/CHANGES
+++ b/CHANGES
          *) applies to 0.9.6a/0.9.6b/0.9.6c and 0.9.7
          +) applies to 0.9.7 only
 
+  *) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid()
+     returns early because it has nothing to do.
+     [Andy Schneider <andy.schneider@bjss.co.uk>]
+
+  *) [In 0.9.6c-engine and 0.9.7 release:]
+     Fix mutex callback return values in crypto/engine/hw_ncipher.c.
+     [Andy Schneider <andy.schneider@bjss.co.uk>]
+
   *) Add a configuration entry for OS/390 Unix.  The C compiler 'c89'
      is called via tools/c89.sh because arguments have to be
      rearranged (all '-L' options must appear before the first object
index 4eb584c90a5855c7ca643e73889fb079b3dddb86..2f62fd77c64973e2fdde2feeb583117b8f35d6a7 100644 (file)
@@ -230,7 +230,10 @@ void CRYPTO_destroy_dynlockid(int i)
        CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
 
        if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
+               {
+               CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
                return;
+               }
        pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
        if (pointer != NULL)
                {
index da52912462a28b571b949068d3c3770f089d02cf..39cf7f56dc836f22613d52fe21ed3408463be690 100644 (file)
@@ -1204,8 +1204,8 @@ static int hwcrhk_mutex_init(HWCryptoHook_Mutex* mt,
        {
        mt->lockid = CRYPTO_get_new_dynlockid();
        if (mt->lockid == 0)
-               return -1;
-       return 0;
+               return 1; /* failure */
+       return 0; /* success */
        }
 
 static int hwcrhk_mutex_lock(HWCryptoHook_Mutex *mt)