summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-18 21:31:56 +0100
committerPauli <ppzgs1@gmail.com>2021-03-14 06:33:34 +0100
commitcd3f8c1b11b0b9f4163bc8c62cbae38aec1b4030 (patch)
treede59d50b2ff9b2bd73a1ebf08eedf78d8ba44aa3 /crypto/ui
parentapps/ts.c: Allow -untrusted arg to refer to multiple sources (diff)
downloadopenssl-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/ui')
-rw-r--r--crypto/ui/ui_openssl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 0a38658c72..42524d42a2 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -372,7 +372,8 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
/* Internal functions to open, handle and close a channel to the console. */
static int open_console(UI *ui)
{
- CRYPTO_THREAD_write_lock(ui->lock);
+ if (!CRYPTO_THREAD_write_lock(ui->lock))
+ return 0;
is_a_tty = 1;
# if defined(OPENSSL_SYS_VXWORKS)