Explicitly test against NULL; do not use !p or similar
[openssl.git] / crypto / pkcs7 / pk7_doit.c
index 030718a1cb8898adcacf19c5b70f308ce58bc46d..2cf62b62cd5553133564ea6fc1ff041bc36a56ef 100644 (file)
@@ -94,12 +94,11 @@ static int pkcs7_encode_rinfo(PKCS7_RECIP_INFO *ri,
     size_t eklen;
 
     pkey = X509_get0_pubkey(ri->cert);
-
-    if (!pkey)
+    if (pkey == NULL)
         return 0;
 
     pctx = EVP_PKEY_CTX_new(pkey, NULL);
-    if (!pctx)
+    if (pctx == NULL)
         return 0;
 
     if (EVP_PKEY_encrypt_init(pctx) <= 0)
@@ -143,11 +142,10 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,
     EVP_PKEY_CTX *pctx = NULL;
     unsigned char *ek = NULL;
     size_t eklen;
-
     int ret = -1;
 
     pctx = EVP_PKEY_CTX_new(pkey, NULL);
-    if (!pctx)
+    if (pctx == NULL)
         return -1;
 
     if (EVP_PKEY_decrypt_init(pctx) <= 0)
@@ -1067,7 +1065,7 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
 
     os = si->enc_digest;
     pkey = X509_get0_pubkey(x509);
-    if (!pkey) {
+    if (pkey == NULL) {
         ret = -1;
         goto err;
     }