summaryrefslogtreecommitdiffstats
path: root/ssl/tls_srp.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-06 19:43:59 +0200
committerRich Salz <rsalz@openssl.org>2015-05-11 16:06:38 +0200
commit75ebbd9aa411c5b8b19ded6ace2b34181566b56a (patch)
tree6bc9cd77b2794b25f9cd9aac1c66f4626fb975a5 /ssl/tls_srp.c
parentAdd missing NULL check in X509V3_parse_list() (diff)
downloadopenssl-75ebbd9aa411c5b8b19ded6ace2b34181566b56a.tar.xz
openssl-75ebbd9aa411c5b8b19ded6ace2b34181566b56a.zip
Use p==NULL not !p (in if statements, mainly)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/tls_srp.c')
-rw-r--r--ssl/tls_srp.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c
index 5445f3cbe3..7d4fd1db32 100644
--- a/ssl/tls_srp.c
+++ b/ssl/tls_srp.c
@@ -340,21 +340,18 @@ int SRP_generate_server_master_secret(SSL *s, unsigned char *master_key)
if (!SRP_Verify_A_mod_N(s->srp_ctx.A, s->srp_ctx.N))
goto err;
- if (!(u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)))
+ if ((u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) == NULL)
goto err;
- if (!
- (K =
- SRP_Calc_server_key(s->srp_ctx.A, s->srp_ctx.v, u, s->srp_ctx.b,
- s->srp_ctx.N)))
+ if ((K = SRP_Calc_server_key(s->srp_ctx.A, s->srp_ctx.v, u, s->srp_ctx.b,
+ s->srp_ctx.N)) == NULL)
goto err;
tmp_len = BN_num_bytes(K);
if ((tmp = OPENSSL_malloc(tmp_len)) == NULL)
goto err;
BN_bn2bin(K, tmp);
- ret =
- s->method->ssl3_enc->generate_master_secret(s, master_key, tmp,
- tmp_len);
+ ret = s->method->ssl3_enc->generate_master_secret(s, master_key, tmp,
+ tmp_len);
err:
OPENSSL_clear_free(tmp, tmp_len);
BN_clear_free(K);
@@ -375,7 +372,7 @@ int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key)
*/
if (SRP_Verify_B_mod_N(s->srp_ctx.B, s->srp_ctx.N) == 0)
goto err;
- if (!(u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)))
+ if ((u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) == NULL)
goto err;
if (s->srp_ctx.SRP_give_srp_client_pwd_callback == NULL)
goto err;
@@ -384,12 +381,10 @@ int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key)
s->srp_ctx.SRP_give_srp_client_pwd_callback(s,
s->srp_ctx.SRP_cb_arg)))
goto err;
- if (!(x = SRP_Calc_x(s->srp_ctx.s, s->srp_ctx.login, passwd)))
+ if ((x = SRP_Calc_x(s->srp_ctx.s, s->srp_ctx.login, passwd)) == NULL)
goto err;
- if (!
- (K =
- SRP_Calc_client_key(s->srp_ctx.N, s->srp_ctx.B, s->srp_ctx.g, x,
- s->srp_ctx.a, u)))
+ if ((K = SRP_Calc_client_key(s->srp_ctx.N, s->srp_ctx.B, s->srp_ctx.g, x,
+ s->srp_ctx.a, u)) == NULL)
goto err;
tmp_len = BN_num_bytes(K);