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/pem | |
parent | 344c271eb339fc2982e9a3584a94e51112d84584 (diff) | |
download | openssl-75ebbd9aa411c5b8b19ded6ace2b34181566b56a.tar.gz |
Use p==NULL not !p (in if statements, mainly)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_pk8.c | 9 | ||||
-rw-r--r-- | crypto/pem/pvkfmt.c | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c index 529d077a9a..52b40fe5ea 100644 --- a/crypto/pem/pem_pk8.c +++ b/crypto/pem/pem_pk8.c @@ -116,7 +116,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, PKCS8_PRIV_KEY_INFO *p8inf; char buf[PEM_BUFSIZE]; int ret; - if (!(p8inf = EVP_PKEY2PKCS8(x))) { + + if ((p8inf = EVP_PKEY2PKCS8(x)) == NULL) { PEMerr(PEM_F_DO_PK8PKEY, PEM_R_ERROR_CONVERTING_PRIVATE_KEY); return 0; } @@ -224,7 +225,8 @@ static int do_pk8pkey_fp(FILE *fp, EVP_PKEY *x, int isder, int nid, { BIO *bp; int ret; - if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + + if ((bp = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) { PEMerr(PEM_F_DO_PK8PKEY_FP, ERR_R_BUF_LIB); return (0); } @@ -238,7 +240,8 @@ EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, { BIO *bp; EVP_PKEY *ret; - if (!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { + + if ((bp = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) { PEMerr(PEM_F_D2I_PKCS8PRIVATEKEY_FP, ERR_R_BUF_LIB); return NULL; } diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index d2a5952c9e..0900ef603b 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -316,13 +316,12 @@ static EVP_PKEY *b2i_dss(const unsigned char **in, unsigned int length, if (!read_lebn(&p, 20, &dsa->priv_key)) goto memerr; /* Calculate public key */ - if (!(dsa->pub_key = BN_new())) + if ((dsa->pub_key = BN_new()) == NULL) goto memerr; - if (!(ctx = BN_CTX_new())) + if ((ctx = BN_CTX_new()) == NULL) goto memerr; if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) - goto memerr; BN_CTX_free(ctx); } |