From a32b35170819e9b07e0183d19aee21b9a246943b Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 14 Apr 2018 07:09:21 +0000 Subject: 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 --- src/lib/libcrypto/engine/eng_init.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/engine/eng_init.c') 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 @@ -/* $OpenBSD: eng_init.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_init.c,v 1.9 2018/04/14 07:09:21 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. * @@ -134,10 +134,8 @@ ENGINE_finish(ENGINE *e) { int to_return = 1; - if (e == NULL) { - ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); - return 0; - } + if (e == NULL) + return 1; CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); to_return = engine_unlocked_finish(e, 1); CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); -- cgit v1.2.3-55-g6feb