summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_npas.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/pkcs12/p12_npas.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/pkcs12/p12_npas.c')
-rw-r--r--crypto/pkcs12/p12_npas.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c
index eece1dd8f7..7c916d46cd 100644
--- a/crypto/pkcs12/p12_npas.c
+++ b/crypto/pkcs12/p12_npas.c
@@ -33,7 +33,7 @@ int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass)
{
/* Check for NULL PKCS12 structure */
- if (!p12) {
+ if (p12 == NULL) {
PKCS12err(PKCS12_F_PKCS12_NEWPASS,
PKCS12_R_INVALID_NULL_PKCS12_POINTER);
return 0;
@@ -94,7 +94,7 @@ static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass)
else
p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL,
pbe_saltlen, pbe_iter, bags);
- if (!p7new || !sk_PKCS7_push(newsafes, p7new))
+ if (p7new == NULL || !sk_PKCS7_push(newsafes, p7new))
goto err;
sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
bags = NULL;
@@ -173,8 +173,9 @@ static int alg_get(const X509_ALGOR *alg, int *pnid, int *piter,
int *psaltlen)
{
PBEPARAM *pbe;
+
pbe = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(PBEPARAM), alg->parameter);
- if (!pbe)
+ if (pbe == NULL)
return 0;
*pnid = OBJ_obj2nid(alg->algorithm);
*piter = ASN1_INTEGER_get(pbe->iter);