Use p==NULL not !p (in if statements, mainly)

Reviewed-by: Tim Hudson <tjh@openssl.org>
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c
index 9932dde..19cf6ff 100644
--- a/ssl/d1_srtp.c
+++ b/ssl/d1_srtp.c
@@ -160,7 +160,7 @@
     char *ptr = (char *)profiles_string;
     SRTP_PROTECTION_PROFILE *p;
 
-    if (!(profiles = sk_SRTP_PROTECTION_PROFILE_new_null())) {
+    if ((profiles = sk_SRTP_PROTECTION_PROFILE_new_null()) == NULL) {
         SSLerr(SSL_F_SSL_CTX_MAKE_PROFILES,
                SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES);
         return 1;
diff --git a/ssl/kssl.c b/ssl/kssl.c
index d781042..15973ed 100644
--- a/ssl/kssl.c
+++ b/ssl/kssl.c
@@ -873,7 +873,8 @@
 # endif                         /* KRB5_MIT_OLD11 */
 
 # ifdef KRB5CHECKAUTH
-    if (!cklens && !(cklens = (size_t *)calloc(sizeof(int), n + 1)))
+    if (cklens == NULL
+        && (cklens = (size_t *)calloc(sizeof(int), n + 1)) == NULL)
         return NULL;
 
     for (i = 0; i < n; i++) {
@@ -911,7 +912,8 @@
 
     conlen = (etype) ? 8 : 0;
 
-    if (!cksumlens && !(cksumlens = populate_cksumlens()))
+    if (cksumlens NULL
+        && (cksumlens = populate_cksumlens()) == NULL)
         return NULL;
     for (i = 0; (cklen = cksumlens[i]) != 0; i++) {
         test_auth = a + conlen + cklen;
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 86b7994..85a3ef6 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -1506,7 +1506,7 @@
         }
         param_len += i;
 
-        if (!(s->srp_ctx.N = BN_bin2bn(p, i, NULL))) {
+        if ((s->srp_ctx.N = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1526,7 +1526,7 @@
         }
         param_len += i;
 
-        if (!(s->srp_ctx.g = BN_bin2bn(p, i, NULL))) {
+        if ((s->srp_ctx.g = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1547,7 +1547,7 @@
         }
         param_len += i;
 
-        if (!(s->srp_ctx.s = BN_bin2bn(p, i, NULL))) {
+        if ((s->srp_ctx.s = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1567,7 +1567,7 @@
         }
         param_len += i;
 
-        if (!(s->srp_ctx.B = BN_bin2bn(p, i, NULL))) {
+        if ((s->srp_ctx.B = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1623,7 +1623,7 @@
         }
         param_len += i;
 
-        if (!(rsa->n = BN_bin2bn(p, i, rsa->n))) {
+        if ((rsa->n = BN_bin2bn(p, i, rsa->n)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1643,7 +1643,7 @@
         }
         param_len += i;
 
-        if (!(rsa->e = BN_bin2bn(p, i, rsa->e))) {
+        if ((rsa->e = BN_bin2bn(p, i, rsa->e)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1685,7 +1685,7 @@
         }
         param_len += i;
 
-        if (!(dh->p = BN_bin2bn(p, i, NULL))) {
+        if ((dh->p = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1705,7 +1705,7 @@
         }
         param_len += i;
 
-        if (!(dh->g = BN_bin2bn(p, i, NULL))) {
+        if ((dh->g = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
@@ -1725,7 +1725,7 @@
         }
         param_len += i;
 
-        if (!(dh->pub_key = BN_bin2bn(p, i, NULL))) {
+        if ((dh->pub_key = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index ec94882..2f3158b 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -2828,7 +2828,7 @@
                    SSL_R_BAD_SRP_A_LENGTH);
             goto f_err;
         }
-        if (!(s->srp_ctx.A = BN_bin2bn(p, i, NULL))) {
+        if ((s->srp_ctx.A = BN_bin2bn(p, i, NULL)) == NULL) {
             SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_BN_LIB);
             goto err;
         }
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c
index 5445f3c..7d4fd1d 100644
--- a/ssl/tls_srp.c
+++ b/ssl/tls_srp.c
@@ -340,21 +340,18 @@
 
     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 @@
      */
     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 @@
          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);