summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_ameth.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2019-09-16 15:28:57 -0400
committerRichard Levitte <levitte@openssl.org>2019-10-09 21:32:15 +0200
commit12a765a5235f181c2f4992b615eb5f892c368e88 (patch)
tree67ece1a3fb210bd4895aea73649773fc912a60d6 /crypto/ec/ec_ameth.c
parent3a4e43de473ee80347036d78163889b6b1221210 (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/ec/ec_ameth.c')
-rw-r--r--crypto/ec/ec_ameth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index a0965ea78d..6105e6b087 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -196,7 +196,7 @@ static int eckey_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)
eckey = eckey_type2param(ptype, pval);
- if (!eckey)
+ if (eckey == NULL)
goto ecliberr;
/* We have parameters now set private key */
@@ -650,7 +650,7 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
const EC_GROUP *grp;
EVP_PKEY *pk;
pk = EVP_PKEY_CTX_get0_pkey(pctx);
- if (!pk)
+ if (pk == NULL)
goto err;
grp = EC_KEY_get0_group(pk->pkey.ec);
ecpeer = EC_KEY_new();
@@ -666,7 +666,7 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
/* We have parameters now set public key */
plen = ASN1_STRING_length(pubkey);
p = ASN1_STRING_get0_data(pubkey);
- if (!p || !plen)
+ if (p == NULL || plen == 0)
goto err;
if (!o2i_ECPublicKey(&ecpeer, &p, plen))
goto err;