summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2001-11-23 20:58:40 +0000
committerBodo Möller <bodo@openssl.org>2001-11-23 20:58:40 +0000
commit883b0c2274872570cf7023d7567b1b963e2d039d (patch)
tree2779757825a2ec32323226a4c19e459c3b5436b0
parent4f94d1a8b18cb35914eb253f75d96fec410694ad (diff)
fix submitted by Andy Schneider <andy.schneider@bjss.co.uk>
(in main branch, hn_ncipher.c is already correct)
-rw-r--r--CHANGES8
-rw-r--r--crypto/cryptlib.c3
-rw-r--r--crypto/engine/hw_ncipher.c4
3 files changed, 13 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 5d785a03e2..f4d70fe867 100644
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,14 @@
*) 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
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index 4eb584c90a..2f62fd77c6 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -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)
{
diff --git a/crypto/engine/hw_ncipher.c b/crypto/engine/hw_ncipher.c
index da52912462..39cf7f56dc 100644
--- a/crypto/engine/hw_ncipher.c
+++ b/crypto/engine/hw_ncipher.c
@@ -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)