Latest update.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
|
||||
break;
|
||||
case PKCS7_OP_GET_DETACHED_SIGNATURE:
|
||||
if (nid == NID_pkcs7_signed) {
|
||||
if (!p7->d.sign || !p7->d.sign->contents->d.ptr)
|
||||
if (p7->d.sign == NULL || p7->d.sign->contents->d.ptr == NULL)
|
||||
ret = 1;
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
@@ -214,7 +214,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
||||
BIO *p7bio = NULL;
|
||||
BIO *tmpin = NULL, *tmpout = NULL;
|
||||
|
||||
if (!p7) {
|
||||
if (p7 == NULL) {
|
||||
PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_INVALID_NULL_POINTER);
|
||||
return 0;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
|
||||
X509 *signer;
|
||||
int i;
|
||||
|
||||
if (!p7) {
|
||||
if (p7 == NULL) {
|
||||
PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS, PKCS7_R_INVALID_NULL_POINTER);
|
||||
return NULL;
|
||||
}
|
||||
@@ -480,7 +480,7 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags)
|
||||
int ret = 0, i;
|
||||
char *buf = NULL;
|
||||
|
||||
if (!p7) {
|
||||
if (p7 == NULL) {
|
||||
PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_INVALID_NULL_POINTER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user