diff options
author | tb <> | 2018-04-14 07:09:21 +0000 |
---|---|---|
committer | tb <> | 2018-04-14 07:09:21 +0000 |
commit | 0c5418014797b1fadca3f270eb2f140fd6f5bdf8 (patch) | |
tree | 83fef660683163befc47beedefbc0b11b71b2756 /src/lib/libcrypto/pem/pem_lib.c | |
parent | 0c3f32384bbfe8e0484372a52a7b00027b367750 (diff) | |
download | openbsd-0c5418014797b1fadca3f270eb2f140fd6f5bdf8.tar.gz openbsd-0c5418014797b1fadca3f270eb2f140fd6f5bdf8.tar.bz2 openbsd-0c5418014797b1fadca3f270eb2f140fd6f5bdf8.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/pem/pem_lib.c')
-rw-r--r-- | src/lib/libcrypto/pem/pem_lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 0f7c36d21c..89e9e9a7ec 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pem_lib.c,v 1.45 2017/05/02 03:59:44 deraadt Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.46 2018/04/14 07:09:21 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -227,8 +227,7 @@ check_pem(const char *nm, const char *name) | |||
227 | else | 227 | else |
228 | r = 0; | 228 | r = 0; |
229 | #ifndef OPENSSL_NO_ENGINE | 229 | #ifndef OPENSSL_NO_ENGINE |
230 | if (e) | 230 | ENGINE_finish(e); |
231 | ENGINE_finish(e); | ||
232 | #endif | 231 | #endif |
233 | return r; | 232 | return r; |
234 | } | 233 | } |