diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-30 11:12:26 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-09 22:48:41 +0000 |
commit | 90945fa31a42dcf3beb90540c618e4d627c595ea (patch) | |
tree | e73870c253abf0c37ca618384e30a7937a996b55 /crypto/rsa/rsa_x931g.c | |
parent | a71edf3ba275b946224b5bcded0a8ecfce1855c0 (diff) | |
download | openssl-90945fa31a42dcf3beb90540c618e4d627c595ea.tar.gz |
Continue standardising malloc style for libcrypto
Continuing from previous commit ensure our style is consistent for malloc
return checks.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'crypto/rsa/rsa_x931g.c')
-rw-r--r-- | crypto/rsa/rsa_x931g.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c index e158c6d443..24d3cb9c23 100644 --- a/crypto/rsa/rsa_x931g.c +++ b/crypto/rsa/rsa_x931g.c @@ -78,7 +78,7 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, goto err; ctx = BN_CTX_new(); - if (!ctx) + if (ctx == NULL) goto err; BN_CTX_start(ctx); @@ -101,9 +101,9 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, * test programs to output selective parameters. */ - if (Xp && !rsa->p) { + if (Xp && rsa->p == NULL) { rsa->p = BN_new(); - if (!rsa->p) + if (rsa->p == NULL) goto err; if (!BN_X931_derive_prime_ex(rsa->p, p1, p2, @@ -111,16 +111,16 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, goto err; } - if (Xq && !rsa->q) { + if (Xq && rsa->q == NULL) { rsa->q = BN_new(); - if (!rsa->q) + if (rsa->q == NULL) goto err; if (!BN_X931_derive_prime_ex(rsa->q, q1, q2, Xq, Xq1, Xq2, e, ctx, cb)) goto err; } - if (!rsa->p || !rsa->q) { + if (rsa->p == NULL || rsa->q == NULL) { BN_CTX_end(ctx); BN_CTX_free(ctx); return 2; @@ -153,7 +153,7 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, goto err; /* LCM((p-1)(q-1)) */ ctx2 = BN_CTX_new(); - if (!ctx2) + if (ctx2 == NULL) goto err; rsa->d = BN_mod_inverse(NULL, rsa->e, r0, ctx2); /* d */ @@ -196,7 +196,7 @@ int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_CTX *ctx = NULL; ctx = BN_CTX_new(); - if (!ctx) + if (ctx == NULL) goto error; BN_CTX_start(ctx); @@ -207,7 +207,7 @@ int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, rsa->p = BN_new(); rsa->q = BN_new(); - if (!rsa->p || !rsa->q) + if (rsa->p == NULL || rsa->q == NULL) goto error; /* Generate two primes from Xp, Xq */ |