summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/eng_init.c
diff options
context:
space:
mode:
authortb <>2018-04-14 07:09:21 +0000
committertb <>2018-04-14 07:09:21 +0000
commita32b35170819e9b07e0183d19aee21b9a246943b (patch)
tree83fef660683163befc47beedefbc0b11b71b2756 /src/lib/libcrypto/engine/eng_init.c
parent7eaeb0d1b3ae143b8adb8634c48219a657764be9 (diff)
downloadopenbsd-a32b35170819e9b07e0183d19aee21b9a246943b.tar.gz
openbsd-a32b35170819e9b07e0183d19aee21b9a246943b.tar.bz2
openbsd-a32b35170819e9b07e0183d19aee21b9a246943b.zip
make ENGINE_finish() succeed on NULL and simplify callers as in
OpenSSL commit 7c96dbcdab9 by Rich Salz. This cleans up the caller side quite a bit and reduces the number of lines enclosed in #ifndef OPENSSL_NO_ENGINE. codesearch.debian.net shows that almost nothing checks the return value of ENGINE_finish(). While there, replace a few nearby 'if (!ptr)' with 'if (ptr == NULL)'. ok jsing, tested by & ok inoguchi
Diffstat (limited to 'src/lib/libcrypto/engine/eng_init.c')
-rw-r--r--src/lib/libcrypto/engine/eng_init.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/engine/eng_init.c b/src/lib/libcrypto/engine/eng_init.c
index 75d6698c70..793adba8be 100644
--- a/src/lib/libcrypto/engine/eng_init.c
+++ b/src/lib/libcrypto/engine/eng_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_init.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: eng_init.c,v 1.9 2018/04/14 07:09:21 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -134,10 +134,8 @@ ENGINE_finish(ENGINE *e)
134{ 134{
135 int to_return = 1; 135 int to_return = 1;
136 136
137 if (e == NULL) { 137 if (e == NULL)
138 ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); 138 return 1;
139 return 0;
140 }
141 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); 139 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
142 to_return = engine_unlocked_finish(e, 1); 140 to_return = engine_unlocked_finish(e, 1);
143 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); 141 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);