diff options
author | Rich Salz <rsalz@akamai.com> | 2021-02-18 21:31:56 +0100 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-14 06:33:34 +0100 |
commit | cd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030 (patch) | |
tree | de59d50b2ff9b2bd73a1ebf08eedf78d8ba44aa3 /crypto/threads_none.c | |
parent | apps/ts.c: Allow -untrusted arg to refer to multiple sources (diff) | |
download | openssl-cd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030.tar.xz openssl-cd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030.zip |
Always check CRYPTO_LOCK_{read,write}_lock
Some functions that lock things are void, so we just return early.
Also make ossl_namemap_empty return 0 on error. Updated the docs, and added
some code to ossl_namemap_stored() to handle the failure, and updated the
tests to allow for failure.
Fixes: #14230
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14238)
Diffstat (limited to 'crypto/threads_none.c')
-rw-r--r-- | crypto/threads_none.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/threads_none.c b/crypto/threads_none.c index 55d4b5f0f8..f0e0f7fba4 100644 --- a/crypto/threads_none.c +++ b/crypto/threads_none.c @@ -31,14 +31,14 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void) return lock; } -int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) +__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) { if (!ossl_assert(*(unsigned int *)lock == 1)) return 0; return 1; } -int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) +__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) { if (!ossl_assert(*(unsigned int *)lock == 1)) return 0; |