diff options
author | Rich Salz <rsalz@akamai.com> | 2019-09-16 15:28:57 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-09 21:32:15 +0200 |
commit | 12a765a5235f181c2f4992b615eb5f892c368e88 (patch) | |
tree | 67ece1a3fb210bd4895aea73649773fc912a60d6 /crypto/engine | |
parent | 3a4e43de473ee80347036d78163889b6b1221210 (diff) |
Explicitly test against NULL; do not use !p or similar
Also added blanks lines after declarations in a couple of places.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9916)
Diffstat (limited to 'crypto/engine')
-rw-r--r-- | crypto/engine/eng_dyn.c | 2 | ||||
-rw-r--r-- | crypto/engine/eng_openssl.c | 3 | ||||
-rw-r--r-- | crypto/engine/eng_pkey.c | 4 | ||||
-rw-r--r-- | crypto/engine/eng_table.c | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c index 7b1bc6ed84..15504410d9 100644 --- a/crypto/engine/eng_dyn.c +++ b/crypto/engine/eng_dyn.c @@ -343,7 +343,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void)) return 1; case DYNAMIC_CMD_DIR_ADD: /* a NULL 'p' or a string of zero-length is the same thing */ - if (!p || (strlen((const char *)p) < 1)) { + if (p == NULL || (strlen((const char *)p) < 1)) { ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ENGINE_R_INVALID_ARGUMENT); return 0; } diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c index 53edb41a3e..b5c087830c 100644 --- a/crypto/engine/eng_openssl.c +++ b/crypto/engine/eng_openssl.c @@ -625,7 +625,8 @@ static int ossl_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth, EVP_PKEY_HMAC, 0 }; - if (!pmeth) { + + if (pmeth == NULL) { *nids = ossl_pkey_nids; return 1; } diff --git a/crypto/engine/eng_pkey.c b/crypto/engine/eng_pkey.c index 1f67eaa4fc..b8853df1cf 100644 --- a/crypto/engine/eng_pkey.c +++ b/crypto/engine/eng_pkey.c @@ -73,7 +73,7 @@ EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, return 0; } pkey = e->load_privkey(e, key_id, ui_method, callback_data); - if (!pkey) { + if (pkey == NULL) { ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY, ENGINE_R_FAILED_LOADING_PRIVATE_KEY); return 0; @@ -103,7 +103,7 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, return 0; } pkey = e->load_pubkey(e, key_id, ui_method, callback_data); - if (!pkey) { + if (pkey == NULL) { ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY, ENGINE_R_FAILED_LOADING_PUBLIC_KEY); return 0; diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c index f6dfad9867..dc85cdf526 100644 --- a/crypto/engine/eng_table.c +++ b/crypto/engine/eng_table.c @@ -170,7 +170,7 @@ void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e) static void int_cleanup_cb_doall(ENGINE_PILE *p) { - if (!p) + if (p == NULL) return; sk_ENGINE_free(p->sk); if (p->funct) |