diff options
author | Rich Salz <rsalz@akamai.com> | 2015-05-06 13:43:59 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-11 10:06:38 -0400 |
commit | 75ebbd9aa411c5b8b19ded6ace2b34181566b56a (patch) | |
tree | 6bc9cd77b2794b25f9cd9aac1c66f4626fb975a5 /crypto/pkcs12/p12_mutl.c | |
parent | 344c271eb339fc2982e9a3584a94e51112d84584 (diff) |
Use p==NULL not !p (in if statements, mainly)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/pkcs12/p12_mutl.c')
-rw-r--r-- | crypto/pkcs12/p12_mutl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c index 252aca0021..b193da1b3d 100644 --- a/crypto/pkcs12/p12_mutl.c +++ b/crypto/pkcs12/p12_mutl.c @@ -84,7 +84,8 @@ int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, iter = 1; else iter = ASN1_INTEGER_get(p12->mac->iter); - if (!(md_type = EVP_get_digestbyobj(p12->mac->dinfo->algor->algorithm))) { + if ((md_type = EVP_get_digestbyobj(p12->mac->dinfo->algor->algorithm)) + == NULL) { PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM); return 0; } @@ -157,10 +158,10 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, const EVP_MD *md_type) { - if (!(p12->mac = PKCS12_MAC_DATA_new())) + if ((p12->mac = PKCS12_MAC_DATA_new()) == NULL) return PKCS12_ERROR; if (iter > 1) { - if (!(p12->mac->iter = ASN1_INTEGER_new())) { + if ((p12->mac->iter = ASN1_INTEGER_new()) == NULL) { PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); return 0; } @@ -172,7 +173,7 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, if (!saltlen) saltlen = PKCS12_SALT_LEN; p12->mac->salt->length = saltlen; - if (!(p12->mac->salt->data = OPENSSL_malloc(saltlen))) { + if ((p12->mac->salt->data = OPENSSL_malloc(saltlen)) == NULL) { PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); return 0; } @@ -182,7 +183,7 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, } else memcpy(p12->mac->salt->data, salt, saltlen); p12->mac->dinfo->algor->algorithm = OBJ_nid2obj(EVP_MD_type(md_type)); - if (!(p12->mac->dinfo->algor->parameter = ASN1_TYPE_new())) { + if ((p12->mac->dinfo->algor->parameter = ASN1_TYPE_new()) == NULL) { PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); return 0; } |