Use "==0" instead of "!strcmp" etc
authorRich Salz <rsalz@akamai.com>
Wed, 6 May 2015 18:56:14 +0000 (14:56 -0400)
committerRich Salz <rsalz@openssl.org>
Thu, 7 May 2015 02:37:53 +0000 (22:37 -0400)
For the various string-compare routines (strcmp, strcasecmp, str.*cmp)
use "strcmp()==0" instead of "!strcmp()"

Reviewed-by: Tim Hudson <tjh@openssl.org>
57 files changed:
apps/apps.c
apps/ca.c
apps/ecparam.c
apps/pkcs12.c
apps/req.c
apps/s_cb.c
apps/s_server.c
apps/speed.c
apps/srp.c
crypto/asn1/a_strnid.c
crypto/asn1/ameth_lib.c
crypto/asn1/asn1_gen.c
crypto/asn1/asn_mime.c
crypto/asn1/asn_mstbl.c
crypto/asn1/t_bitst.c
crypto/cmac/cm_pmeth.c
crypto/conf/conf_mod.c
crypto/dh/dh_pmeth.c
crypto/dsa/dsa_pmeth.c
crypto/ec/ec_curve.c
crypto/ec/ec_pmeth.c
crypto/engine/eng_cnf.c
crypto/engine/eng_fat.c
crypto/engine/eng_openssl.c
crypto/engine/tb_asnmth.c
crypto/evp/evp_cnf.c
crypto/evp/pmeth_lib.c
crypto/hmac/hm_pmeth.c
crypto/ocsp/ocsp_lib.c
crypto/pem/pem_lib.c
crypto/pem/pem_pkey.c
crypto/rsa/rsa_pmeth.c
crypto/x509v3/v3_addr.c
crypto/x509v3/v3_akey.c
crypto/x509v3/v3_alt.c
crypto/x509v3/v3_asid.c
crypto/x509v3/v3_bcons.c
crypto/x509v3/v3_bitst.c
crypto/x509v3/v3_conf.c
crypto/x509v3/v3_cpols.c
crypto/x509v3/v3_crld.c
crypto/x509v3/v3_ncons.c
crypto/x509v3/v3_pcons.c
crypto/x509v3/v3_purp.c
crypto/x509v3/v3_utl.c
demos/bio/client-arg.c
demos/bio/client-conf.c
demos/bio/server-arg.c
demos/bio/server-conf.c
engines/ccgost/gost_pmeth.c
engines/ccgost/gostsum.c
ssl/d1_srtp.c
ssl/ssl_ciph.c
ssl/ssl_conf.c
ssl/t1_lib.c
test/evp_test.c
test/ssltest.c

index 215acb121971db7ef0cd0578cab4aa06849046af..1c182bafb60b05d27db69afa9ac733bae1e60765 100644 (file)
@@ -428,9 +428,10 @@ static char *app_get_pass(char *arg, int keepbio)
     char *tmp, tpass[APP_PASS_LEN];
     static BIO *pwdbio = NULL;
     int i;
     char *tmp, tpass[APP_PASS_LEN];
     static BIO *pwdbio = NULL;
     int i;
-    if (!strncmp(arg, "pass:", 5))
+
+    if (strncmp(arg, "pass:", 5) == 0)
         return BUF_strdup(arg + 5);
         return BUF_strdup(arg + 5);
-    if (!strncmp(arg, "env:", 4)) {
+    if (strncmp(arg, "env:", 4) == 0) {
         tmp = getenv(arg + 4);
         if (!tmp) {
             BIO_printf(bio_err, "Can't read environment variable %s\n", arg + 4);
         tmp = getenv(arg + 4);
         if (!tmp) {
             BIO_printf(bio_err, "Can't read environment variable %s\n", arg + 4);
@@ -439,7 +440,7 @@ static char *app_get_pass(char *arg, int keepbio)
         return BUF_strdup(tmp);
     }
     if (!keepbio || !pwdbio) {
         return BUF_strdup(tmp);
     }
     if (!keepbio || !pwdbio) {
-        if (!strncmp(arg, "file:", 5)) {
+        if (strncmp(arg, "file:", 5) == 0) {
             pwdbio = BIO_new_file(arg + 5, "r");
             if (!pwdbio) {
                 BIO_printf(bio_err, "Can't open file %s\n", arg + 5);
             pwdbio = BIO_new_file(arg + 5, "r");
             if (!pwdbio) {
                 BIO_printf(bio_err, "Can't open file %s\n", arg + 5);
@@ -454,7 +455,7 @@ static char *app_get_pass(char *arg, int keepbio)
              * on real Windows descriptors, such as those obtained
              * with CreateFile.
              */
              * on real Windows descriptors, such as those obtained
              * with CreateFile.
              */
-        } else if (!strncmp(arg, "fd:", 3)) {
+        } else if (strncmp(arg, "fd:", 3) == 0) {
             BIO *btmp;
             i = atoi(arg + 3);
             if (i >= 0)
             BIO *btmp;
             i = atoi(arg + 3);
             if (i >= 0)
@@ -469,7 +470,7 @@ static char *app_get_pass(char *arg, int keepbio)
             btmp = BIO_new(BIO_f_buffer());
             pwdbio = BIO_push(btmp, pwdbio);
 #endif
             btmp = BIO_new(BIO_f_buffer());
             pwdbio = BIO_push(btmp, pwdbio);
 #endif
-        } else if (!strcmp(arg, "stdin")) {
+        } else if (strcmp(arg, "stdin") == 0) {
             pwdbio = dup_bio_in();
             if (!pwdbio) {
                 BIO_printf(bio_err, "Can't open BIO for stdin\n");
             pwdbio = dup_bio_in();
             if (!pwdbio) {
                 BIO_printf(bio_err, "Can't open BIO for stdin\n");
@@ -1083,11 +1084,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
 
 int set_ext_copy(int *copy_type, const char *arg)
 {
 
 int set_ext_copy(int *copy_type, const char *arg)
 {
-    if (!strcasecmp(arg, "none"))
+    if (strcasecmp(arg, "none") == 0)
         *copy_type = EXT_COPY_NONE;
         *copy_type = EXT_COPY_NONE;
-    else if (!strcasecmp(arg, "copy"))
+    else if (strcasecmp(arg, "copy") == 0)
         *copy_type = EXT_COPY_ADD;
         *copy_type = EXT_COPY_ADD;
-    else if (!strcasecmp(arg, "copyall"))
+    else if (strcasecmp(arg, "copyall") == 0)
         *copy_type = EXT_COPY_ALL;
     else
         return 0;
         *copy_type = EXT_COPY_ALL;
     else
         return 0;
@@ -1169,7 +1170,7 @@ static int set_table_opts(unsigned long *flags, const char *arg,
         c = 1;
 
     for (ptbl = in_tbl; ptbl->name; ptbl++) {
         c = 1;
 
     for (ptbl = in_tbl; ptbl->name; ptbl++) {
-        if (!strcasecmp(arg, ptbl->name)) {
+        if (strcasecmp(arg, ptbl->name) == 0) {
             *flags &= ~ptbl->mask;
             if (c)
                 *flags |= ptbl->flag;
             *flags &= ~ptbl->mask;
             if (c)
                 *flags |= ptbl->flag;
@@ -2279,7 +2280,7 @@ static const char *get_dp_url(DIST_POINT *dp)
         uri = GENERAL_NAME_get0_value(gen, &gtype);
         if (gtype == GEN_URI && ASN1_STRING_length(uri) > 6) {
             char *uptr = (char *)ASN1_STRING_data(uri);
         uri = GENERAL_NAME_get0_value(gen, &gtype);
         if (gtype == GEN_URI && ASN1_STRING_length(uri) > 6) {
             char *uptr = (char *)ASN1_STRING_data(uri);
-            if (!strncmp(uptr, "http://", 7))
+            if (strncmp(uptr, "http://", 7) == 0)
                 return uptr;
         }
     }
                 return uptr;
         }
     }
index abce53489618e75e801bacd99911d1c79985544f..d7a9aca07dfbbfb2f788ce1e482c2a6500f37d2e 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -569,7 +569,7 @@ end_of_options:
         f = NCONF_get_string(conf, section, UTF8_IN);
         if (!f)
             ERR_clear_error();
         f = NCONF_get_string(conf, section, UTF8_IN);
         if (!f)
             ERR_clear_error();
-        else if (!strcmp(f, "yes"))
+        else if (strcmp(f, "yes") == 0)
             chtype = MBSTRING_UTF8;
     }
 
             chtype = MBSTRING_UTF8;
     }
 
@@ -841,7 +841,7 @@ end_of_options:
         goto end;
     }
 
         goto end;
     }
 
-    if (!strcmp(md, "default")) {
+    if (strcmp(md, "default") == 0) {
         int def_nid;
         if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0) {
             BIO_puts(bio_err, "no default digest\n");
         int def_nid;
         if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0) {
             BIO_puts(bio_err, "no default digest\n");
@@ -2419,7 +2419,7 @@ char *make_revocation_str(int rev_type, char *rev_arg)
 
     case REV_CRL_REASON:
         for (i = 0; i < 8; i++) {
 
     case REV_CRL_REASON:
         for (i = 0; i < 8; i++) {
-            if (!strcasecmp(rev_arg, crl_reasons[i])) {
+            if (strcasecmp(rev_arg, crl_reasons[i]) == 0) {
                 reason = crl_reasons[i];
                 break;
             }
                 reason = crl_reasons[i];
                 break;
             }
@@ -2637,7 +2637,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
     }
     if (reason_str) {
         for (i = 0; i < NUM_REASONS; i++) {
     }
     if (reason_str) {
         for (i = 0; i < NUM_REASONS; i++) {
-            if (!strcasecmp(reason_str, crl_reasons[i])) {
+            if (strcasecmp(reason_str, crl_reasons[i]) == 0) {
                 reason_code = i;
                 break;
             }
                 reason_code = i;
                 break;
             }
index 5ceaec79b257bccec47c2b3d37aa52c42f2bb6c8..755b1be18250415c6f9614530577092dbe190a33 100644 (file)
@@ -265,11 +265,11 @@ int ecparam_main(int argc, char **argv)
          * are the same as the curves prime192v1 and prime256v1 defined in
          * X9.62)
          */
          * are the same as the curves prime192v1 and prime256v1 defined in
          * X9.62)
          */
-        if (!strcmp(curve_name, "secp192r1")) {
+        if (strcmp(curve_name, "secp192r1") == 0) {
             BIO_printf(bio_err, "using curve name prime192v1 "
                        "instead of secp192r1\n");
             nid = NID_X9_62_prime192v1;
             BIO_printf(bio_err, "using curve name prime192v1 "
                        "instead of secp192r1\n");
             nid = NID_X9_62_prime192v1;
-        } else if (!strcmp(curve_name, "secp256r1")) {
+        } else if (strcmp(curve_name, "secp256r1") == 0) {
             BIO_printf(bio_err, "using curve name prime256v1 "
                        "instead of secp256r1\n");
             nid = NID_X9_62_prime256v1;
             BIO_printf(bio_err, "using curve name prime256v1 "
                        "instead of secp256r1\n");
             nid = NID_X9_62_prime256v1;
index 0a4ee3ed1033ddecee19b3d995d5847162366803..67d33a21ffa2bad62b1eaafea92f666153c7209e 100644 (file)
@@ -836,7 +836,7 @@ static int set_pbe(int *ppbe, const char *str)
 {
     if (!str)
         return 0;
 {
     if (!str)
         return 0;
-    if (!strcmp(str, "NONE")) {
+    if (strcmp(str, "NONE") == 0) {
         *ppbe = -1;
         return 1;
     }
         *ppbe = -1;
         return 1;
     }
index b9dc35cbf85e5c69feec0e3205408449fc9371f6..225474b4f5a03f6b9c5b22e41255d5735db61b3a 100644 (file)
@@ -477,7 +477,7 @@ int req_main(int argc, char **argv)
         p = NCONF_get_string(req_conf, SECTION, UTF8_IN);
         if (!p)
             ERR_clear_error();
         p = NCONF_get_string(req_conf, SECTION, UTF8_IN);
         if (!p)
             ERR_clear_error();
-        else if (!strcmp(p, "yes"))
+        else if (strcmp(p, "yes") == 0)
             chtype = MBSTRING_UTF8;
     }
 
             chtype = MBSTRING_UTF8;
     }
 
@@ -904,7 +904,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn,
     tmp = NCONF_get_string(req_conf, SECTION, PROMPT);
     if (tmp == NULL)
         ERR_clear_error();
     tmp = NCONF_get_string(req_conf, SECTION, PROMPT);
     if (tmp == NULL)
         ERR_clear_error();
-    if ((tmp != NULL) && !strcmp(tmp, "no"))
+    if ((tmp != NULL) && strcmp(tmp, "no") == 0)
         no_prompt = 1;
 
     dn_sect = NCONF_get_string(req_conf, SECTION, DISTINGUISHED_NAME);
         no_prompt = 1;
 
     dn_sect = NCONF_get_string(req_conf, SECTION, DISTINGUISHED_NAME);
@@ -1373,7 +1373,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
         *pkey_type = EVP_PKEY_RSA;
         keylen = atol(gstr);
         *pkeylen = keylen;
         *pkey_type = EVP_PKEY_RSA;
         keylen = atol(gstr);
         *pkeylen = keylen;
-    } else if (!strncmp(gstr, "param:", 6))
+    } else if (strncmp(gstr, "param:", 6) == 0)
         paramfile = gstr + 6;
     else {
         const char *p = strchr(gstr, ':');
         paramfile = gstr + 6;
     else {
         const char *p = strchr(gstr, ':');
index d371cc9b98a153edb3a26aabe1b93a484329825b..442b33556817e789e4fe9b0d9d7f5771217b3afb 100644 (file)
@@ -1392,10 +1392,10 @@ int config_ctx(SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str,
         const char *flag = sk_OPENSSL_STRING_value(str, i);
         const char *arg = sk_OPENSSL_STRING_value(str, i + 1);
         /* If no_ecdhe or named curve already specified don't need a default. */
         const char *flag = sk_OPENSSL_STRING_value(str, i);
         const char *arg = sk_OPENSSL_STRING_value(str, i + 1);
         /* If no_ecdhe or named curve already specified don't need a default. */
-        if (!no_ecdhe && !strcmp(flag, "-named_curve"))
+        if (!no_ecdhe && strcmp(flag, "-named_curve") == 0)
             no_ecdhe = 1;
 #ifndef OPENSSL_NO_JPAKE
             no_ecdhe = 1;
 #ifndef OPENSSL_NO_JPAKE
-        if (!no_jpake && !strcmp(flag, "-cipher")) {
+        if (!no_jpake && (strcmp(flag, "-cipher") == 0)) {
             BIO_puts(bio_err, "JPAKE sets cipher to PSK\n");
             return 0;
         }
             BIO_puts(bio_err, "JPAKE sets cipher to PSK\n");
             return 0;
         }
index 7f8a2a6b81c05b8d69a2be789221e30839d6be8f..ba281e095011c9ccc9d93f944153e52195b89d8e 100644 (file)
@@ -3025,7 +3025,7 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
                 p--;
                 i--;
             }
                 p--;
                 i--;
             }
-            if (!s_ign_eof && i == 5 && !strncmp(buf, "CLOSE", 5)) {
+            if (!s_ign_eof && (i == 5) && (strncmp(buf, "CLOSE", 5) == 0)) {
                 ret = 1;
                 BIO_printf(bio_err, "CONNECTION CLOSED\n");
                 goto end;
                 ret = 1;
                 BIO_printf(bio_err, "CONNECTION CLOSED\n");
                 goto end;
index 00c7c4115e2b73beb9d061047abd256b0c3206b8..9ab1648b2cf0a58947b3aea7f1061c22411f1bc6 100644 (file)
@@ -2327,7 +2327,7 @@ static int do_multi(int multi)
                 continue;
             }
             printf("Got: %s from %d\n", buf, n);
                 continue;
             }
             printf("Got: %s from %d\n", buf, n);
-            if (!strncmp(buf, "+F:", 3)) {
+            if (strncmp(buf, "+F:", 3) == 0) {
                 int alg;
                 int j;
 
                 int alg;
                 int j;
 
@@ -2336,7 +2336,7 @@ static int do_multi(int multi)
                 sstrsep(&p, sep);
                 for (j = 0; j < SIZE_NUM; ++j)
                     results[alg][j] += atof(sstrsep(&p, sep));
                 sstrsep(&p, sep);
                 for (j = 0; j < SIZE_NUM; ++j)
                     results[alg][j] += atof(sstrsep(&p, sep));
-            } else if (!strncmp(buf, "+F2:", 4)) {
+            } else if (strncmp(buf, "+F2:", 4) == 0) {
                 int k;
                 double d;
 
                 int k;
                 double d;
 
@@ -2357,7 +2357,7 @@ static int do_multi(int multi)
                     rsa_results[k][1] = d;
             }
 # ifndef OPENSSL_NO_DSA
                     rsa_results[k][1] = d;
             }
 # ifndef OPENSSL_NO_DSA
-            else if (!strncmp(buf, "+F3:", 4)) {
+            else if (strncmp(buf, "+F3:", 4) == 0) {
                 int k;
                 double d;
 
                 int k;
                 double d;
 
@@ -2379,7 +2379,7 @@ static int do_multi(int multi)
             }
 # endif
 # ifndef OPENSSL_NO_EC
             }
 # endif
 # ifndef OPENSSL_NO_EC
-            else if (!strncmp(buf, "+F4:", 4)) {
+            else if (strncmp(buf, "+F4:", 4) == 0) {
                 int k;
                 double d;
 
                 int k;
                 double d;
 
@@ -2404,7 +2404,7 @@ static int do_multi(int multi)
 # endif
 
 # ifndef OPENSSL_NO_EC
 # endif
 
 # ifndef OPENSSL_NO_EC
-            else if (!strncmp(buf, "+F5:", 4)) {
+            else if (strncmp(buf, "+F5:", 4) == 0) {
                 int k;
                 double d;
 
                 int k;
                 double d;
 
@@ -2421,7 +2421,7 @@ static int do_multi(int multi)
             }
 # endif
 
             }
 # endif
 
-            else if (!strncmp(buf, "+H:", 3)) {
+            else if (strncmp(buf, "+H:", 3) == 0) {
                 ;
             } else
                 fprintf(stderr, "Unknown type '%s' from child %d\n", buf, n);
                 ;
             } else
                 fprintf(stderr, "Unknown type '%s' from child %d\n", buf, n);
index c7a93cf7490a791d7fa597b2f78512d2d04e7a14..111f829ca648707d40ebc289b987491422eea728 100644 (file)
@@ -88,14 +88,14 @@ static int get_index(CA_DB *db, char *id, char type)
         for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
             pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
             if (pp[DB_srptype][0] == DB_SRP_INDEX
         for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
             pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
             if (pp[DB_srptype][0] == DB_SRP_INDEX
-                && !strcmp(id, pp[DB_srpid]))
+                && strcmp(id, pp[DB_srpid]) == 0)
                 return i;
     } else
         for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
             pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
 
             if (pp[DB_srptype][0] != DB_SRP_INDEX
                 return i;
     } else
         for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
             pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
 
             if (pp[DB_srptype][0] != DB_SRP_INDEX
-                && !strcmp(id, pp[DB_srpid]))
+                && strcmp(id, pp[DB_srpid]) == 0)
                 return i;
         }
 
                 return i;
         }
 
@@ -434,7 +434,7 @@ int srp_main(int argc, char **argv)
 
         if (pp[DB_srptype][0] == DB_SRP_INDEX) {
             maxgN = i;
 
         if (pp[DB_srptype][0] == DB_SRP_INDEX) {
             maxgN = i;
-            if (gNindex < 0 && gN != NULL && !strcmp(gN, pp[DB_srpid]))
+            if ((gNindex < 0) && (gN != NULL) && strcmp(gN, pp[DB_srpid]) == 0)
                 gNindex = i;
 
             print_index(db, i, verbose > 1);
                 gNindex = i;
 
             print_index(db, i, verbose > 1);
index 071613b89b80cd5d0886e727236bc9ff7296d378..92d4134fc57b358676c65475fd0249535bf390c6 100644 (file)
@@ -100,19 +100,19 @@ int ASN1_STRING_set_default_mask_asc(const char *p)
 {
     unsigned long mask;
     char *end;
 {
     unsigned long mask;
     char *end;
-    if (!strncmp(p, "MASK:", 5)) {
+    if (strncmp(p, "MASK:", 5) == 0) {
         if (!p[5])
             return 0;
         mask = strtoul(p + 5, &end, 0);
         if (*end)
             return 0;
         if (!p[5])
             return 0;
         mask = strtoul(p + 5, &end, 0);
         if (*end)
             return 0;
-    } else if (!strcmp(p, "nombstr"))
+    } else if (strcmp(p, "nombstr") == 0)
         mask = ~((unsigned long)(B_ASN1_BMPSTRING | B_ASN1_UTF8STRING));
         mask = ~((unsigned long)(B_ASN1_BMPSTRING | B_ASN1_UTF8STRING));
-    else if (!strcmp(p, "pkix"))
+    else if (strcmp(p, "pkix") == 0)
         mask = ~((unsigned long)B_ASN1_T61STRING);
         mask = ~((unsigned long)B_ASN1_T61STRING);
-    else if (!strcmp(p, "utf8only"))
+    else if (strcmp(p, "utf8only") == 0)
         mask = B_ASN1_UTF8STRING;
         mask = B_ASN1_UTF8STRING;
-    else if (!strcmp(p, "default"))
+    else if (strcmp(p, "default") == 0)
         mask = 0xFFFFFFFFL;
     else
         return 0;
         mask = 0xFFFFFFFFL;
     else
         return 0;
index de70f9b4b2472ddc9526d1ec842cf48d5d4e75b8..ce4c0dcaf9325a80f2762ca60e9380c07265a063 100644 (file)
@@ -221,8 +221,8 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
         ameth = EVP_PKEY_asn1_get0(i);
         if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
             continue;
         ameth = EVP_PKEY_asn1_get0(i);
         if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
             continue;
-        if (((int)strlen(ameth->pem_str) == len) &&
-            !strncasecmp(ameth->pem_str, str, len))
+        if (((int)strlen(ameth->pem_str) == len)
+            && (strncasecmp(ameth->pem_str, str, len) == 0))
             return ameth;
     }
     return NULL;
             return ameth;
     }
     return NULL;
index ab82b52c2bd28ffe01fe04d7e16b71760d35f0fc..84d85e63cda1ff57943c7f63e71022e141ad4536 100644 (file)
@@ -375,13 +375,13 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
             ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
             return -1;
         }
             ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
             return -1;
         }
-        if (!strncmp(vstart, "ASCII", 5))
+        if (strncmp(vstart, "ASCII", 5) == 0)
             arg->format = ASN1_GEN_FORMAT_ASCII;
             arg->format = ASN1_GEN_FORMAT_ASCII;
-        else if (!strncmp(vstart, "UTF8", 4))
+        else if (strncmp(vstart, "UTF8", 4) == 0)
             arg->format = ASN1_GEN_FORMAT_UTF8;
             arg->format = ASN1_GEN_FORMAT_UTF8;
-        else if (!strncmp(vstart, "HEX", 3))
+        else if (strncmp(vstart, "HEX", 3) == 0)
             arg->format = ASN1_GEN_FORMAT_HEX;
             arg->format = ASN1_GEN_FORMAT_HEX;
-        else if (!strncmp(vstart, "BITLIST", 7))
+        else if (strncmp(vstart, "BITLIST", 7) == 0)
             arg->format = ASN1_GEN_FORMAT_BITLIST;
         else {
             ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
             arg->format = ASN1_GEN_FORMAT_BITLIST;
         else {
             ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
@@ -621,7 +621,7 @@ static int asn1_str2tag(const char *tagstr, int len)
 
     tntmp = tnst;
     for (i = 0; i < OSSL_NELEM(tnst); i++, tntmp++) {
 
     tntmp = tnst;
     for (i = 0; i < OSSL_NELEM(tnst); i++, tntmp++) {
-        if ((len == tntmp->len) && !strncmp(tntmp->strnam, tagstr, len))
+        if ((len == tntmp->len) && (strncmp(tntmp->strnam, tagstr, len) == 0))
             return tntmp->tag;
     }
 
             return tntmp->tag;
     }
 
@@ -829,7 +829,7 @@ static int mask_cb(const char *elem, int len, void *arg)
     int tag;
     if (elem == NULL)
         return 0;
     int tag;
     if (elem == NULL)
         return 0;
-    if (len == 3 && !strncmp(elem, "DIR", 3)) {
+    if ((len == 3) && (strncmp(elem, "DIR", 3) == 0)) {
         *pmask |= B_ASN1_DIRECTORYSTRING;
         return 1;
     }
         *pmask |= B_ASN1_DIRECTORYSTRING;
         return 1;
     }
index da5b4170487fcb60ccdc5dfce57f2c33d64d5572..2fe6cf987e68ba5eb0e5169d3d30abf72fb2350d 100644 (file)
@@ -440,7 +440,7 @@ ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
 
     /* Handle multipart/signed */
 
 
     /* Handle multipart/signed */
 
-    if (!strcmp(hdr->value, "multipart/signed")) {
+    if (strcmp(hdr->value, "multipart/signed") == 0) {
         /* Split into two parts */
         prm = mime_param_find(hdr, "boundary");
         if (!prm || !prm->param_value) {
         /* Split into two parts */
         prm = mime_param_find(hdr, "boundary");
         if (!prm || !prm->param_value) {
@@ -971,8 +971,9 @@ static int mime_bound_check(char *line, int linelen, char *bound, int blen)
     if (blen + 2 > linelen)
         return 0;
     /* Check for part boundary */
     if (blen + 2 > linelen)
         return 0;
     /* Check for part boundary */
-    if (!strncmp(line, "--", 2) && !strncmp(line + 2, bound, blen)) {
-        if (!strncmp(line + blen + 2, "--", 2))
+    if ((strncmp(line, "--", 2) == 0)
+        && strncmp(line + 2, bound, blen) == 0) {
+        if (strncmp(line + blen + 2, "--", 2) == 0)
             return 2;
         else
             return 1;
             return 2;
         else
             return 1;
index 94ffbd8adadf9b1c802be9f77835aa4f9a97583b..9b50d1400127243c5ac9f0ff06625a13f3a666be 100644 (file)
@@ -118,21 +118,21 @@ static int do_tcreate(char *value, char *name)
         goto err;
     for (i = 0; i < sk_CONF_VALUE_num(lst); i++) {
         cnf = sk_CONF_VALUE_value(lst, i);
         goto err;
     for (i = 0; i < sk_CONF_VALUE_num(lst); i++) {
         cnf = sk_CONF_VALUE_value(lst, i);
-        if (!strcmp(cnf->name, "min")) {
+        if (strcmp(cnf->name, "min") == 0) {
             tbl_min = strtoul(cnf->value, &eptr, 0);
             if (*eptr)
                 goto err;
             tbl_min = strtoul(cnf->value, &eptr, 0);
             if (*eptr)
                 goto err;
-        } else if (!strcmp(cnf->name, "max")) {
+        } else if (strcmp(cnf->name, "max") == 0) {
             tbl_max = strtoul(cnf->value, &eptr, 0);
             if (*eptr)
                 goto err;
             tbl_max = strtoul(cnf->value, &eptr, 0);
             if (*eptr)
                 goto err;
-        } else if (!strcmp(cnf->name, "mask")) {
+        } else if (strcmp(cnf->name, "mask") == 0) {
             if (!ASN1_str2mask(cnf->value, &tbl_mask) || !tbl_mask)
                 goto err;
             if (!ASN1_str2mask(cnf->value, &tbl_mask) || !tbl_mask)
                 goto err;
-        } else if (!strcmp(cnf->name, "flags")) {
-            if (!strcmp(cnf->value, "nomask"))
+        } else if (strcmp(cnf->name, "flags") == 0) {
+            if (strcmp(cnf->value, "nomask") == 0)
                 tbl_flags = STABLE_NO_MASK;
                 tbl_flags = STABLE_NO_MASK;
-            else if (!strcmp(cnf->value, "none"))
+            else if (strcmp(cnf->value, "none") == 0)
                 tbl_flags = STABLE_FLAGS_CLEAR;
             else
                 goto err;
                 tbl_flags = STABLE_FLAGS_CLEAR;
             else
                 goto err;
index d5cf3c7732404134cad74b2351e3e7d07d450e24..83c5af7005fded23dad4ed5036766eac806c3db9 100644 (file)
@@ -98,7 +98,8 @@ int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl)
 {
     BIT_STRING_BITNAME *bnam;
     for (bnam = tbl; bnam->lname; bnam++) {
 {
     BIT_STRING_BITNAME *bnam;
     for (bnam = tbl; bnam->lname; bnam++) {
-        if (!strcmp(bnam->sname, name) || !strcmp(bnam->lname, name))
+        if ((strcmp(bnam->sname, name) == 0)
+            || (strcmp(bnam->lname, name) == 0))
             return bnam->bitnum;
     }
     return -1;
             return bnam->bitnum;
     }
     return -1;
index 389ae5da8438d14e71bb3f1588bcbfce3d71748c..013ac570948b1f034533eb643cd4d96fa440ca9b 100644 (file)
@@ -157,18 +157,18 @@ static int pkey_cmac_ctrl_str(EVP_PKEY_CTX *ctx,
     if (!value) {
         return 0;
     }
     if (!value) {
         return 0;
     }
-    if (!strcmp(type, "key")) {
+    if (strcmp(type, "key") == 0) {
         void *p = (void *)value;
         return pkey_cmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, strlen(p), p);
     }
         void *p = (void *)value;
         return pkey_cmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, strlen(p), p);
     }
-    if (!strcmp(type, "cipher")) {
+    if (strcmp(type, "cipher") == 0) {
         const EVP_CIPHER *c;
         c = EVP_get_cipherbyname(value);
         if (!c)
             return 0;
         return pkey_cmac_ctrl(ctx, EVP_PKEY_CTRL_CIPHER, -1, (void *)c);
     }
         const EVP_CIPHER *c;
         c = EVP_get_cipherbyname(value);
         if (!c)
             return 0;
         return pkey_cmac_ctrl(ctx, EVP_PKEY_CTRL_CIPHER, -1, (void *)c);
     }
-    if (!strcmp(type, "hexkey")) {
+    if (strcmp(type, "hexkey") == 0) {
         unsigned char *key;
         int r;
         long keylen;
         unsigned char *key;
         int r;
         long keylen;
index 23d2a58e824ae738e69ff07266b72279b988fc33..b01319fd399f2a2602276823852174b938e7552f 100644 (file)
@@ -319,7 +319,7 @@ static CONF_MODULE *module_find(char *name)
 
     for (i = 0; i < sk_CONF_MODULE_num(supported_modules); i++) {
         tmod = sk_CONF_MODULE_value(supported_modules, i);
 
     for (i = 0; i < sk_CONF_MODULE_num(supported_modules); i++) {
         tmod = sk_CONF_MODULE_value(supported_modules, i);
-        if (!strncmp(tmod->name, name, nchar))
+        if (strncmp(tmod->name, name, nchar) == 0)
             return tmod;
     }
 
             return tmod;
     }
 
index 1e1036491e375fe62dc3fe3730508027d78e3c3e..07d74dc9298e9163c3ae6f54c26c929c19d9a330 100644 (file)
@@ -259,12 +259,12 @@ static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
                             const char *type, const char *value)
 {
 static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
                             const char *type, const char *value)
 {
-    if (!strcmp(type, "dh_paramgen_prime_len")) {
+    if (strcmp(type, "dh_paramgen_prime_len") == 0) {
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len);
     }
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len);
     }
-    if (!strcmp(type, "dh_rfc5114")) {
+    if (strcmp(type, "dh_rfc5114") == 0) {
         DH_PKEY_CTX *dctx = ctx->data;
         int len;
         len = atoi(value);
         DH_PKEY_CTX *dctx = ctx->data;
         int len;
         len = atoi(value);
@@ -273,17 +273,17 @@ static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
         dctx->rfc5114_param = len;
         return 1;
     }
         dctx->rfc5114_param = len;
         return 1;
     }
-    if (!strcmp(type, "dh_paramgen_generator")) {
+    if (strcmp(type, "dh_paramgen_generator") == 0) {
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, len);
     }
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, len);
     }
-    if (!strcmp(type, "dh_paramgen_subprime_len")) {
+    if (strcmp(type, "dh_paramgen_subprime_len") == 0) {
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len);
     }
         int len;
         len = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len);
     }
-    if (!strcmp(type, "dh_paramgen_type")) {
+    if (strcmp(type, "dh_paramgen_type") == 0) {
         int typ;
         typ = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ);
         int typ;
         typ = atoi(value);
         return EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ);
index 853612ac74feafa2096c37f0eb5dea9f860ccc91..1bb3683a9263b104a8fa334af35fed6c2ddf09c3 100644 (file)
@@ -218,18 +218,18 @@ static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 static int pkey_dsa_ctrl_str(EVP_PKEY_CTX *ctx,
                              const char *type, const char *value)
 {
 static int pkey_dsa_ctrl_str(EVP_PKEY_CTX *ctx,
                              const char *type, const char *value)
 {
-    if (!strcmp(type, "dsa_paramgen_bits")) {
+    if (strcmp(type, "dsa_paramgen_bits") == 0) {
         int nbits;
         nbits = atoi(value);
         return EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits);
     }
         int nbits;
         nbits = atoi(value);
         return EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits);
     }
-    if (!strcmp(type, "dsa_paramgen_q_bits")) {
+    if (strcmp(type, "dsa_paramgen_q_bits") == 0) {
         int qbits = atoi(value);
         return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN,
                                  EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits,
                                  NULL);
     }
         int qbits = atoi(value);
         return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN,
                                  EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits,
                                  NULL);
     }
-    if (!strcmp(type, "dsa_paramgen_md")) {
+    if (strcmp(type, "dsa_paramgen_md") == 0) {
         return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN,
                                  EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0,
                                  (void *)EVP_get_digestbyname(value));
         return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN,
                                  EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0,
                                  (void *)EVP_get_digestbyname(value));
index d0f1fcb2fd7b1c6ea70444a99371978198c7b6d0..8f9308dbfd581c9a96f3e47f6ed7ac80334eb02b 100644 (file)
@@ -3206,7 +3206,7 @@ int EC_curve_nist2nid(const char *name)
 {
     size_t i;
     for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
 {
     size_t i;
     for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
-        if (!strcmp(nist_curves[i].name, name))
+        if (strcmp(nist_curves[i].name, name) == 0)
             return nist_curves[i].nid;
     }
     return NID_undef;
             return nist_curves[i].nid;
     }
     return NID_undef;
index 3fbeac5789e03722382d2156974b211a0654da17..37d3efb314cbee2ebf986144e2ca153305f54f67 100644 (file)
@@ -404,7 +404,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
                             const char *type, const char *value)
 {
 static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
                             const char *type, const char *value)
 {
-    if (!strcmp(type, "ec_paramgen_curve")) {
+    if (strcmp(type, "ec_paramgen_curve") == 0) {
         int nid;
         nid = EC_curve_nist2nid(value);
         if (nid == NID_undef)
         int nid;
         nid = EC_curve_nist2nid(value);
         if (nid == NID_undef)
@@ -416,23 +416,23 @@ static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
             return 0;
         }
         return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid);
             return 0;
         }
         return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid);
-    } else if (!strcmp(type, "ec_param_enc")) {
+    } else if (strcmp(type, "ec_param_enc") == 0) {
         int param_enc;
         int param_enc;
-        if (!strcmp(value, "explicit"))
+        if (strcmp(value, "explicit") == 0)
             param_enc = 0;
             param_enc = 0;
-        else if (!strcmp(value, "named_curve"))
+        else if (strcmp(value, "named_curve") == 0)
             param_enc = OPENSSL_EC_NAMED_CURVE;
         else
             return -2;
         return EVP_PKEY_CTX_set_ec_param_enc(ctx, param_enc);
             param_enc = OPENSSL_EC_NAMED_CURVE;
         else
             return -2;
         return EVP_PKEY_CTX_set_ec_param_enc(ctx, param_enc);
-    } else if (!strcmp(type, "ecdh_kdf_md")) {
+    } else if (strcmp(type, "ecdh_kdf_md") == 0) {
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             ECerr(EC_F_PKEY_EC_CTRL_STR, EC_R_INVALID_DIGEST);
             return 0;
         }
         return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md);
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             ECerr(EC_F_PKEY_EC_CTRL_STR, EC_R_INVALID_DIGEST);
             return 0;
         }
         return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md);
-    } else if (!strcmp(type, "ecdh_cofactor_mode")) {
+    } else if (strcmp(type, "ecdh_cofactor_mode") == 0) {
         int co_mode;
         co_mode = atoi(value);
         return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, co_mode);
         int co_mode;
         co_mode = atoi(value);
         return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, co_mode);
index e84281f22e903e99e1bbfcb5d608602d27330e56..ca45af564fe5ab4e7ffc2096f440f2dd69ca37ea 100644 (file)
@@ -124,12 +124,12 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
         /* First handle some special pseudo ctrls */
 
         /* Override engine name to use */
         /* First handle some special pseudo ctrls */
 
         /* Override engine name to use */
-        if (!strcmp(ctrlname, "engine_id"))
+        if (strcmp(ctrlname, "engine_id") == 0)
             name = ctrlvalue;
             name = ctrlvalue;
-        else if (!strcmp(ctrlname, "soft_load"))
+        else if (strcmp(ctrlname, "soft_load") == 0)
             soft = 1;
         /* Load a dynamic ENGINE */
             soft = 1;
         /* Load a dynamic ENGINE */
-        else if (!strcmp(ctrlname, "dynamic_path")) {
+        else if (strcmp(ctrlname, "dynamic_path") == 0) {
             e = ENGINE_by_id("dynamic");
             if (!e)
                 goto err;
             e = ENGINE_by_id("dynamic");
             if (!e)
                 goto err;
@@ -159,9 +159,9 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
              * Allow "EMPTY" to mean no value: this allows a valid "value" to
              * be passed to ctrls of type NO_INPUT
              */
              * Allow "EMPTY" to mean no value: this allows a valid "value" to
              * be passed to ctrls of type NO_INPUT
              */
-            if (!strcmp(ctrlvalue, "EMPTY"))
+            if (strcmp(ctrlvalue, "EMPTY") == 0)
                 ctrlvalue = NULL;
                 ctrlvalue = NULL;
-            if (!strcmp(ctrlname, "init")) {
+            if (strcmp(ctrlname, "init") == 0) {
                 if (!NCONF_get_number_e(cnf, value, "init", &do_init))
                     goto err;
                 if (do_init == 1) {
                 if (!NCONF_get_number_e(cnf, value, "init", &do_init))
                     goto err;
                 if (do_init == 1) {
@@ -172,7 +172,7 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
                               ENGINE_R_INVALID_INIT_VALUE);
                     goto err;
                 }
                               ENGINE_R_INVALID_INIT_VALUE);
                     goto err;
                 }
-            } else if (!strcmp(ctrlname, "default_algorithms")) {
+            } else if (strcmp(ctrlname, "default_algorithms") == 0) {
                 if (!ENGINE_set_default_string(e, ctrlvalue))
                     goto err;
             } else if (!ENGINE_ctrl_cmd_string(e, ctrlname, ctrlvalue, 0))
                 if (!ENGINE_set_default_string(e, ctrlvalue))
                     goto err;
             } else if (!ENGINE_ctrl_cmd_string(e, ctrlname, ctrlvalue, 0))
index af353bd9369098c7e8c990b29e9a54d2f7197557..e0c8f96f699d20254815987dffff8105377a53a6 100644 (file)
@@ -103,29 +103,29 @@ static int int_def_cb(const char *alg, int len, void *arg)
     unsigned int *pflags = arg;
     if (alg == NULL)
         return 0;
     unsigned int *pflags = arg;
     if (alg == NULL)
         return 0;
-    if (!strncmp(alg, "ALL", len))
+    if (strncmp(alg, "ALL", len) == 0)
         *pflags |= ENGINE_METHOD_ALL;
         *pflags |= ENGINE_METHOD_ALL;
-    else if (!strncmp(alg, "RSA", len))
+    else if (strncmp(alg, "RSA", len) == 0)
         *pflags |= ENGINE_METHOD_RSA;
         *pflags |= ENGINE_METHOD_RSA;
-    else if (!strncmp(alg, "DSA", len))
+    else if (strncmp(alg, "DSA", len) == 0)
         *pflags |= ENGINE_METHOD_DSA;
         *pflags |= ENGINE_METHOD_DSA;
-    else if (!strncmp(alg, "ECDH", len))
+    else if (strncmp(alg, "ECDH", len) == 0)
         *pflags |= ENGINE_METHOD_ECDH;
         *pflags |= ENGINE_METHOD_ECDH;
-    else if (!strncmp(alg, "ECDSA", len))
+    else if (strncmp(alg, "ECDSA", len) == 0)
         *pflags |= ENGINE_METHOD_ECDSA;
         *pflags |= ENGINE_METHOD_ECDSA;
-    else if (!strncmp(alg, "DH", len))
+    else if (strncmp(alg, "DH", len) == 0)
         *pflags |= ENGINE_METHOD_DH;
         *pflags |= ENGINE_METHOD_DH;
-    else if (!strncmp(alg, "RAND", len))
+    else if (strncmp(alg, "RAND", len) == 0)
         *pflags |= ENGINE_METHOD_RAND;
         *pflags |= ENGINE_METHOD_RAND;
-    else if (!strncmp(alg, "CIPHERS", len))
+    else if (strncmp(alg, "CIPHERS", len) == 0)
         *pflags |= ENGINE_METHOD_CIPHERS;
         *pflags |= ENGINE_METHOD_CIPHERS;
-    else if (!strncmp(alg, "DIGESTS", len))
+    else if (strncmp(alg, "DIGESTS", len) == 0)
         *pflags |= ENGINE_METHOD_DIGESTS;
         *pflags |= ENGINE_METHOD_DIGESTS;
-    else if (!strncmp(alg, "PKEY", len))
+    else if (strncmp(alg, "PKEY", len) == 0)
         *pflags |= ENGINE_METHOD_PKEY_METHS | ENGINE_METHOD_PKEY_ASN1_METHS;
         *pflags |= ENGINE_METHOD_PKEY_METHS | ENGINE_METHOD_PKEY_ASN1_METHS;
-    else if (!strncmp(alg, "PKEY_CRYPTO", len))
+    else if (strncmp(alg, "PKEY_CRYPTO", len) == 0)
         *pflags |= ENGINE_METHOD_PKEY_METHS;
         *pflags |= ENGINE_METHOD_PKEY_METHS;
-    else if (!strncmp(alg, "PKEY_ASN1", len))
+    else if (strncmp(alg, "PKEY_ASN1", len) == 0)
         *pflags |= ENGINE_METHOD_PKEY_ASN1_METHS;
     else
         return 0;
         *pflags |= ENGINE_METHOD_PKEY_ASN1_METHS;
     else
         return 0;
index e9bdd010438b67451a59afdac57fa629ff33dbc1..560c9b3c932102984f2b0a2ee34e429b9d15684e 100644 (file)
@@ -556,11 +556,11 @@ static int ossl_hmac_ctrl_str(EVP_PKEY_CTX *ctx,
     if (!value) {
         return 0;
     }
     if (!value) {
         return 0;
     }
-    if (!strcmp(type, "key")) {
+    if (strcmp(type, "key") == 0) {
         void *p = (void *)value;
         return ossl_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, -1, p);
     }
         void *p = (void *)value;
         return ossl_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, -1, p);
     }
-    if (!strcmp(type, "hexkey")) {
+    if (strcmp(type, "hexkey") == 0) {
         unsigned char *key;
         int r;
         long keylen;
         unsigned char *key;
         int r;
         long keylen;
index 4685fcf2ade6d3ea4b046ea20da7649f87cd31cf..407023fdf6565ddb642210c92c13752dc3208aa3 100644 (file)
@@ -191,8 +191,8 @@ const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
     nidcount = e->pkey_asn1_meths(e, NULL, &nids, 0);
     for (i = 0; i < nidcount; i++) {
         e->pkey_asn1_meths(e, &ameth, NULL, nids[i]);
     nidcount = e->pkey_asn1_meths(e, NULL, &nids, 0);
     for (i = 0; i < nidcount; i++) {
         e->pkey_asn1_meths(e, &ameth, NULL, nids[i]);
-        if (((int)strlen(ameth->pem_str) == len) &&
-            !strncasecmp(ameth->pem_str, str, len))
+        if (((int)strlen(ameth->pem_str) == len)
+            && strncasecmp(ameth->pem_str, str, len) == 0)
             return ameth;
     }
     return NULL;
             return ameth;
     }
     return NULL;
@@ -215,8 +215,8 @@ static void look_str_cb(int nid, STACK_OF(ENGINE) *sk, ENGINE *def, void *arg)
         ENGINE *e = sk_ENGINE_value(sk, i);
         EVP_PKEY_ASN1_METHOD *ameth;
         e->pkey_asn1_meths(e, &ameth, NULL, nid);
         ENGINE *e = sk_ENGINE_value(sk, i);
         EVP_PKEY_ASN1_METHOD *ameth;
         e->pkey_asn1_meths(e, &ameth, NULL, nid);
-        if (((int)strlen(ameth->pem_str) == lk->len) &&
-            !strncasecmp(ameth->pem_str, lk->str, lk->len)) {
+        if (((int)strlen(ameth->pem_str) == lk->len)
+                && strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) {
             lk->e = e;
             lk->ameth = ameth;
             return;
             lk->e = e;
             lk->ameth = ameth;
             return;
index 31a90543c5855512303263909f2e8bb04903d24c..3073091cbe33697f70ff58c2c75d50e3e23569f3 100644 (file)
@@ -81,7 +81,7 @@ static int alg_module_init(CONF_IMODULE *md, const CONF *cnf)
     }
     for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
         oval = sk_CONF_VALUE_value(sktmp, i);
     }
     for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
         oval = sk_CONF_VALUE_value(sktmp, i);
-        if (!strcmp(oval->name, "fips_mode")) {
+        if (strcmp(oval->name, "fips_mode") == 0) {
             int m;
             if (!X509V3_get_value_bool(oval, &m)) {
                 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_INVALID_FIPS_MODE);
             int m;
             if (!X509V3_get_value_bool(oval, &m)) {
                 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_INVALID_FIPS_MODE);
index eeee53a2efbf26f4bf3747b340f283c3d6b1c197..10d974633d32ce0df01e3fe438890b293faebb0c 100644 (file)
@@ -414,7 +414,7 @@ int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx,
         EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);
         return -2;
     }
         EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);
         return -2;
     }
-    if (!strcmp(name, "digest")) {
+    if (strcmp(name, "digest") == 0) {
         const EVP_MD *md;
         if (!value || !(md = EVP_get_digestbyname(value))) {
             EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_INVALID_DIGEST);
         const EVP_MD *md;
         if (!value || !(md = EVP_get_digestbyname(value))) {
             EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_INVALID_DIGEST);
index 845a72b2ebf2e641a1ce72a77341fcbb2fbae341..2980254402e83aad3b885651831bf8de89685322 100644 (file)
@@ -206,11 +206,11 @@ static int pkey_hmac_ctrl_str(EVP_PKEY_CTX *ctx,
     if (!value) {
         return 0;
     }
     if (!value) {
         return 0;
     }
-    if (!strcmp(type, "key")) {
+    if (strcmp(type, "key") == 0) {
         void *p = (void *)value;
         return pkey_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, -1, p);
     }
         void *p = (void *)value;
         return pkey_hmac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY, -1, p);
     }
-    if (!strcmp(type, "hexkey")) {
+    if (strcmp(type, "hexkey") == 0) {
         unsigned char *key;
         int r;
         long keylen;
         unsigned char *key;
         int r;
         long keylen;
index 62a5812b5684b51bc98fb6d41631fd2752b10a29..1f383f6c83db805c1eff95daadc36cf18ed51641 100644 (file)
@@ -196,10 +196,10 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
 
     *(p++) = '\0';
 
 
     *(p++) = '\0';
 
-    if (!strcmp(buf, "http")) {
+    if (strcmp(buf, "http") == 0) {
         *pssl = 0;
         port = "80";
         *pssl = 0;
         port = "80";
-    } else if (!strcmp(buf, "https")) {
+    } else if (strcmp(buf, "https") == 0) {
         *pssl = 1;
         port = "443";
     } else
         *pssl = 1;
         port = "443";
     } else
index bb3b31ebbfac7900656b7318e3e6780deeffe207..088288d0d4d4ee07e41cec9958df461a612424ff 100644 (file)
@@ -182,17 +182,17 @@ void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
 static int check_pem(const char *nm, const char *name)
 {
     /* Normal matching nm and name */
 static int check_pem(const char *nm, const char *name)
 {
     /* Normal matching nm and name */
-    if (!strcmp(nm, name))
+    if (strcmp(nm, name) == 0)
         return 1;
 
     /* Make PEM_STRING_EVP_PKEY match any private key */
 
         return 1;
 
     /* Make PEM_STRING_EVP_PKEY match any private key */
 
-    if (!strcmp(name, PEM_STRING_EVP_PKEY)) {
+    if (strcmp(name, PEM_STRING_EVP_PKEY) == 0) {
         int slen;
         const EVP_PKEY_ASN1_METHOD *ameth;
         int slen;
         const EVP_PKEY_ASN1_METHOD *ameth;
-        if (!strcmp(nm, PEM_STRING_PKCS8))
+        if (strcmp(nm, PEM_STRING_PKCS8) == 0)
             return 1;
             return 1;
-        if (!strcmp(nm, PEM_STRING_PKCS8INF))
+        if (strcmp(nm, PEM_STRING_PKCS8INF) == 0)
             return 1;
         slen = pem_check_suffix(nm, "PRIVATE KEY");
         if (slen > 0) {
             return 1;
         slen = pem_check_suffix(nm, "PRIVATE KEY");
         if (slen > 0) {
@@ -207,7 +207,7 @@ static int check_pem(const char *nm, const char *name)
         return 0;
     }
 
         return 0;
     }
 
-    if (!strcmp(name, PEM_STRING_PARAMETERS)) {
+    if (strcmp(name, PEM_STRING_PARAMETERS) == 0) {
         int slen;
         const EVP_PKEY_ASN1_METHOD *ameth;
         slen = pem_check_suffix(nm, "PARAMETERS");
         int slen;
         const EVP_PKEY_ASN1_METHOD *ameth;
         slen = pem_check_suffix(nm, "PARAMETERS");
@@ -230,41 +230,45 @@ static int check_pem(const char *nm, const char *name)
         return 0;
     }
     /* If reading DH parameters handle X9.42 DH format too */
         return 0;
     }
     /* If reading DH parameters handle X9.42 DH format too */
-    if (!strcmp(nm, PEM_STRING_DHXPARAMS) &&
-        !strcmp(name, PEM_STRING_DHPARAMS))
+    if (strcmp(nm, PEM_STRING_DHXPARAMS) == 0
+        && strcmp(name, PEM_STRING_DHPARAMS) == 0)
         return 1;
 
     /* Permit older strings */
 
         return 1;
 
     /* Permit older strings */
 
-    if (!strcmp(nm, PEM_STRING_X509_OLD) && !strcmp(name, PEM_STRING_X509))
+    if (strcmp(nm, PEM_STRING_X509_OLD) == 0
+        && strcmp(name, PEM_STRING_X509) == 0)
         return 1;
 
         return 1;
 
-    if (!strcmp(nm, PEM_STRING_X509_REQ_OLD) &&
-        !strcmp(name, PEM_STRING_X509_REQ))
+    if (strcmp(nm, PEM_STRING_X509_REQ_OLD) == 0
+        && strcmp(name, PEM_STRING_X509_REQ) == 0)
         return 1;
 
     /* Allow normal certs to be read as trusted certs */
         return 1;
 
     /* Allow normal certs to be read as trusted certs */
-    if (!strcmp(nm, PEM_STRING_X509) &&
-        !strcmp(name, PEM_STRING_X509_TRUSTED))
+    if (strcmp(nm, PEM_STRING_X509) == 0
+        && strcmp(name, PEM_STRING_X509_TRUSTED) == 0)
         return 1;
 
         return 1;
 
-    if (!strcmp(nm, PEM_STRING_X509_OLD) &&
-        !strcmp(name, PEM_STRING_X509_TRUSTED))
+    if (strcmp(nm, PEM_STRING_X509_OLD) == 0
+        && strcmp(name, PEM_STRING_X509_TRUSTED) == 0)
         return 1;
 
     /* Some CAs use PKCS#7 with CERTIFICATE headers */
         return 1;
 
     /* Some CAs use PKCS#7 with CERTIFICATE headers */
-    if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_PKCS7))
+    if (strcmp(nm, PEM_STRING_X509) == 0
+        && strcmp(name, PEM_STRING_PKCS7) == 0)
         return 1;
 
         return 1;
 
-    if (!strcmp(nm, PEM_STRING_PKCS7_SIGNED) &&
-        !strcmp(name, PEM_STRING_PKCS7))
+    if (strcmp(nm, PEM_STRING_PKCS7_SIGNED) == 0
+        && strcmp(name, PEM_STRING_PKCS7) == 0)
         return 1;
 
 #ifndef OPENSSL_NO_CMS
         return 1;
 
 #ifndef OPENSSL_NO_CMS
-    if (!strcmp(nm, PEM_STRING_X509) && !strcmp(name, PEM_STRING_CMS))
+    if (strcmp(nm, PEM_STRING_X509) == 0
+        && strcmp(name, PEM_STRING_CMS) == 0)
         return 1;
     /* Allow CMS to be read from PKCS#7 headers */
         return 1;
     /* Allow CMS to be read from PKCS#7 headers */
-    if (!strcmp(nm, PEM_STRING_PKCS7) && !strcmp(name, PEM_STRING_CMS))
+    if (strcmp(nm, PEM_STRING_PKCS7) == 0
+        && strcmp(name, PEM_STRING_CMS) == 0)
         return 1;
 #endif
 
         return 1;
 #endif
 
index 0a110e15b9676c2857ed3879ef73911c15626205..a7dd27f061f750bae08a75c591b710abf33afd5a 100644 (file)
@@ -257,7 +257,7 @@ DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u)
         return NULL;
     p = data;
 
         return NULL;
     p = data;
 
-    if (!strcmp(nm, PEM_STRING_DHXPARAMS))
+    if (strcmp(nm, PEM_STRING_DHXPARAMS) == 0)
         ret = d2i_DHxparams(x, &p, len);
     else
         ret = d2i_DHparams(x, &p, len);
         ret = d2i_DHxparams(x, &p, len);
     else
         ret = d2i_DHparams(x, &p, len);
index e407671cb7ddd88db5e9cb2935c5c8913deca601..ced7232fdf723d0b26480fd08188375af3920bc8 100644 (file)
@@ -558,21 +558,21 @@ static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
         RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_VALUE_MISSING);
         return 0;
     }
         RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_VALUE_MISSING);
         return 0;
     }
-    if (!strcmp(type, "rsa_padding_mode")) {
+    if (strcmp(type, "rsa_padding_mode") == 0) {
         int pm;
         int pm;
-        if (!strcmp(value, "pkcs1"))
+        if (strcmp(value, "pkcs1") == 0)
             pm = RSA_PKCS1_PADDING;
             pm = RSA_PKCS1_PADDING;
-        else if (!strcmp(value, "sslv23"))
+        else if (strcmp(value, "sslv23") == 0)
             pm = RSA_SSLV23_PADDING;
             pm = RSA_SSLV23_PADDING;
-        else if (!strcmp(value, "none"))
+        else if (strcmp(value, "none") == 0)
             pm = RSA_NO_PADDING;
             pm = RSA_NO_PADDING;
-        else if (!strcmp(value, "oeap"))
+        else if (strcmp(value, "oeap") == 0)
             pm = RSA_PKCS1_OAEP_PADDING;
             pm = RSA_PKCS1_OAEP_PADDING;
-        else if (!strcmp(value, "oaep"))
+        else if (strcmp(value, "oaep") == 0)
             pm = RSA_PKCS1_OAEP_PADDING;
             pm = RSA_PKCS1_OAEP_PADDING;
-        else if (!strcmp(value, "x931"))
+        else if (strcmp(value, "x931") == 0)
             pm = RSA_X931_PADDING;
             pm = RSA_X931_PADDING;
-        else if (!strcmp(value, "pss"))
+        else if (strcmp(value, "pss") == 0)
             pm = RSA_PKCS1_PSS_PADDING;
         else {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_UNKNOWN_PADDING_TYPE);
             pm = RSA_PKCS1_PSS_PADDING;
         else {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_UNKNOWN_PADDING_TYPE);
@@ -581,19 +581,19 @@ static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
         return EVP_PKEY_CTX_set_rsa_padding(ctx, pm);
     }
 
         return EVP_PKEY_CTX_set_rsa_padding(ctx, pm);
     }
 
-    if (!strcmp(type, "rsa_pss_saltlen")) {
+    if (strcmp(type, "rsa_pss_saltlen") == 0) {
         int saltlen;
         saltlen = atoi(value);
         return EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, saltlen);
     }
 
         int saltlen;
         saltlen = atoi(value);
         return EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, saltlen);
     }
 
-    if (!strcmp(type, "rsa_keygen_bits")) {
+    if (strcmp(type, "rsa_keygen_bits") == 0) {
         int nbits;
         nbits = atoi(value);
         return EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, nbits);
     }
 
         int nbits;
         nbits = atoi(value);
         return EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, nbits);
     }
 
-    if (!strcmp(type, "rsa_keygen_pubexp")) {
+    if (strcmp(type, "rsa_keygen_pubexp") == 0) {
         int ret;
         BIGNUM *pubexp = NULL;
         if (!BN_asc2bn(&pubexp, value))
         int ret;
         BIGNUM *pubexp = NULL;
         if (!BN_asc2bn(&pubexp, value))
@@ -604,7 +604,7 @@ static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
         return ret;
     }
 
         return ret;
     }
 
-    if (!strcmp(type, "rsa_mgf1_md")) {
+    if (strcmp(type, "rsa_mgf1_md") == 0) {
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_INVALID_DIGEST);
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_INVALID_DIGEST);
@@ -613,7 +613,7 @@ static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
         return EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md);
     }
 
         return EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md);
     }
 
-    if (!strcmp(type, "rsa_oaep_md")) {
+    if (strcmp(type, "rsa_oaep_md") == 0) {
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_INVALID_DIGEST);
         const EVP_MD *md;
         if (!(md = EVP_get_digestbyname(value))) {
             RSAerr(RSA_F_PKEY_RSA_CTRL_STR, RSA_R_INVALID_DIGEST);
@@ -621,7 +621,7 @@ static int pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx,
         }
         return EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md);
     }
         }
         return EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md);
     }
-    if (!strcmp(type, "rsa_oaep_label")) {
+    if (strcmp(type, "rsa_oaep_label") == 0) {
         unsigned char *lab;
         long lablen;
         int ret;
         unsigned char *lab;
         long lablen;
         int ret;
index cdc1346ee1aab910544c88628bb7c1af9cb446d1..2029475eb09731f433a352a9efa46d9bb0bcc32d 100644 (file)
@@ -1002,7 +1002,7 @@ static void *v2i_IPAddrBlocks(const struct v3_ext_method *method,
          * Check for inheritance.  Not worth additional complexity to
          * optimize this (seldom-used) case.
          */
          * Check for inheritance.  Not worth additional complexity to
          * optimize this (seldom-used) case.
          */
-        if (!strcmp(s, "inherit")) {
+        if (strcmp(s, "inherit") == 0) {
             if (!v3_addr_add_inherit(addr, afi, safi)) {
                 X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                           X509V3_R_INVALID_INHERITANCE);
             if (!v3_addr_add_inherit(addr, afi, safi)) {
                 X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
                           X509V3_R_INVALID_INHERITANCE);
index 7369af1bb5cbcd28c298db37a88aa86dfaa241a9..652c90483ebfdd428aa893e047e31f6d8211e3ff 100644 (file)
@@ -131,13 +131,13 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
 
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         cnf = sk_CONF_VALUE_value(values, i);
 
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         cnf = sk_CONF_VALUE_value(values, i);
-        if (!strcmp(cnf->name, "keyid")) {
+        if (strcmp(cnf->name, "keyid") == 0) {
             keyid = 1;
             keyid = 1;
-            if (cnf->value && !strcmp(cnf->value, "always"))
+            if (cnf->value && strcmp(cnf->value, "always") == 0)
                 keyid = 2;
                 keyid = 2;
-        } else if (!strcmp(cnf->name, "issuer")) {
+        } else if (strcmp(cnf->name, "issuer") == 0) {
             issuer = 1;
             issuer = 1;
-            if (cnf->value && !strcmp(cnf->value, "always"))
+            if (cnf->value && strcmp(cnf->value, "always") == 0)
                 issuer = 2;
         } else {
             X509V3err(X509V3_F_V2I_AUTHORITY_KEYID, X509V3_R_UNKNOWN_OPTION);
                 issuer = 2;
         } else {
             X509V3err(X509V3_F_V2I_AUTHORITY_KEYID, X509V3_R_UNKNOWN_OPTION);
index d5ceb44bcb637e163a55c09a4e1d184730029005..c0c63a98786567491d53533456d0b60e7f9f67f7 100644 (file)
@@ -249,8 +249,8 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method,
     }
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         cnf = sk_CONF_VALUE_value(nval, i);
     }
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         cnf = sk_CONF_VALUE_value(nval, i);
-        if (!name_cmp(cnf->name, "issuer") && cnf->value &&
-            !strcmp(cnf->value, "copy")) {
+        if (!name_cmp(cnf->name, "issuer")
+            && cnf->value && strcmp(cnf->value, "copy") == 0) {
             if (!copy_issuer(ctx, gens))
                 goto err;
         } else {
             if (!copy_issuer(ctx, gens))
                 goto err;
         } else {
@@ -318,12 +318,12 @@ static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
     }
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         cnf = sk_CONF_VALUE_value(nval, i);
     }
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         cnf = sk_CONF_VALUE_value(nval, i);
-        if (!name_cmp(cnf->name, "email") && cnf->value &&
-            !strcmp(cnf->value, "copy")) {
+        if (!name_cmp(cnf->name, "email")
+            && cnf->value && strcmp(cnf->value, "copy") == 0) {
             if (!copy_email(ctx, gens, 0))
                 goto err;
             if (!copy_email(ctx, gens, 0))
                 goto err;
-        } else if (!name_cmp(cnf->name, "email") && cnf->value &&
-                   !strcmp(cnf->value, "move")) {
+        } else if (!name_cmp(cnf->name, "email")
+                   && cnf->value && strcmp(cnf->value, "move") == 0) {
             if (!copy_email(ctx, gens, 1))
                 goto err;
         } else {
             if (!copy_email(ctx, gens, 1))
                 goto err;
         } else {
index 26ca15844b03185cbfdf29697512ef638a8bc093..c5e569405febb4b4417cb37d58a48c9cf197e573 100644 (file)
@@ -572,7 +572,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method,
         /*
          * Handle inheritance.
          */
         /*
          * Handle inheritance.
          */
-        if (!strcmp(val->value, "inherit")) {
+        if (strcmp(val->value, "inherit") == 0) {
             if (v3_asid_add_inherit(asid, which))
                 continue;
             X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
             if (v3_asid_add_inherit(asid, which))
                 continue;
             X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
index dc00b9cb05a64f8cc9582d0fe6b769fad744c2b5..97bc079c0eb4f9481400d7ed29ca571d5450e2f8 100644 (file)
@@ -113,10 +113,10 @@ static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
     }
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
     }
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
-        if (!strcmp(val->name, "CA")) {
+        if (strcmp(val->name, "CA") == 0) {
             if (!X509V3_get_value_bool(val, &bcons->ca))
                 goto err;
             if (!X509V3_get_value_bool(val, &bcons->ca))
                 goto err;
-        } else if (!strcmp(val->name, "pathlen")) {
+        } else if (strcmp(val->name, "pathlen") == 0) {
             if (!X509V3_get_value_int(val, &bcons->pathlen))
                 goto err;
         } else {
             if (!X509V3_get_value_int(val, &bcons->pathlen))
                 goto err;
         } else {
index bf0d7bc24281c354ee3ce298dc19c609f1d01414..eb6d0f3654316b2836433da78b85d9e9379f51ad 100644 (file)
@@ -119,8 +119,8 @@ ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         val = sk_CONF_VALUE_value(nval, i);
         for (bnam = method->usr_data; bnam->lname; bnam++) {
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         val = sk_CONF_VALUE_value(nval, i);
         for (bnam = method->usr_data; bnam->lname; bnam++) {
-            if (!strcmp(bnam->sname, val->name) ||
-                !strcmp(bnam->lname, val->name)) {
+            if (strcmp(bnam->sname, val->name) == 0
+                || strcmp(bnam->lname, val->name) == 0) {
                 if (!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) {
                     X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,
                               ERR_R_MALLOC_FAILURE);
                 if (!ASN1_BIT_STRING_set_bit(bs, bnam->bitnum, 1)) {
                     X509V3err(X509V3_F_V2I_ASN1_BIT_STRING,
                               ERR_R_MALLOC_FAILURE);
index bb1146e674a865e8809dfdf0af4d6d69cb02fe7c..672d3de977729bf6c28494ca63fc786f60a354e4 100644 (file)
@@ -246,10 +246,10 @@ static int v3_check_generic(char **value)
 {
     int gen_type = 0;
     char *p = *value;
 {
     int gen_type = 0;
     char *p = *value;
-    if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) {
+    if ((strlen(p) >= 4) && strncmp(p, "DER:", 4) == 0) {
         p += 4;
         gen_type = 1;
         p += 4;
         gen_type = 1;
-    } else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5)) {
+    } else if ((strlen(p) >= 5) && strncmp(p, "ASN1:", 5) == 0) {
         p += 5;
         gen_type = 2;
     } else
         p += 5;
         gen_type = 2;
     } else
index 8147ea598e35ee9a06b9988666f15bacd49d7a8d..b7f80792c16fd7b1b1fae98c02c3b9577af300c1 100644 (file)
@@ -162,7 +162,7 @@ static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
             goto err;
         }
         pstr = cnf->name;
             goto err;
         }
         pstr = cnf->name;
-        if (!strcmp(pstr, "ia5org")) {
+        if (strcmp(pstr, "ia5org") == 0) {
             ia5org = 1;
             continue;
         } else if (*pstr == '@') {
             ia5org = 1;
             continue;
         } else if (*pstr == '@') {
@@ -213,7 +213,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
         goto merr;
     for (i = 0; i < sk_CONF_VALUE_num(polstrs); i++) {
         cnf = sk_CONF_VALUE_value(polstrs, i);
         goto merr;
     for (i = 0; i < sk_CONF_VALUE_num(polstrs); i++) {
         cnf = sk_CONF_VALUE_value(polstrs, i);
-        if (!strcmp(cnf->name, "policyIdentifier")) {
+        if (strcmp(cnf->name, "policyIdentifier") == 0) {
             ASN1_OBJECT *pobj;
             if (!(pobj = OBJ_txt2obj(cnf->value, 0))) {
                 X509V3err(X509V3_F_POLICY_SECTION,
             ASN1_OBJECT *pobj;
             if (!(pobj = OBJ_txt2obj(cnf->value, 0))) {
                 X509V3err(X509V3_F_POLICY_SECTION,
@@ -303,13 +303,13 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
     qual->d.usernotice = not;
     for (i = 0; i < sk_CONF_VALUE_num(unot); i++) {
         cnf = sk_CONF_VALUE_value(unot, i);
     qual->d.usernotice = not;
     for (i = 0; i < sk_CONF_VALUE_num(unot); i++) {
         cnf = sk_CONF_VALUE_value(unot, i);
-        if (!strcmp(cnf->name, "explicitText")) {
+        if (strcmp(cnf->name, "explicitText") == 0) {
             if (!(not->exptext = ASN1_VISIBLESTRING_new()))
                 goto merr;
             if (!ASN1_STRING_set(not->exptext, cnf->value,
                                  strlen(cnf->value)))
                 goto merr;
             if (!(not->exptext = ASN1_VISIBLESTRING_new()))
                 goto merr;
             if (!ASN1_STRING_set(not->exptext, cnf->value,
                                  strlen(cnf->value)))
                 goto merr;
-        } else if (!strcmp(cnf->name, "organization")) {
+        } else if (strcmp(cnf->name, "organization") == 0) {
             NOTICEREF *nref;
             if (!not->noticeref) {
                 if (!(nref = NOTICEREF_new()))
             NOTICEREF *nref;
             if (!not->noticeref) {
                 if (!(nref = NOTICEREF_new()))
@@ -324,7 +324,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
             if (!ASN1_STRING_set(nref->organization, cnf->value,
                                  strlen(cnf->value)))
                 goto merr;
             if (!ASN1_STRING_set(nref->organization, cnf->value,
                                  strlen(cnf->value)))
                 goto merr;
-        } else if (!strcmp(cnf->name, "noticeNumbers")) {
+        } else if (strcmp(cnf->name, "noticeNumbers") == 0) {
             NOTICEREF *nref;
             STACK_OF(CONF_VALUE) *nos;
             if (!not->noticeref) {
             NOTICEREF *nref;
             STACK_OF(CONF_VALUE) *nos;
             if (!not->noticeref) {
index 8ffcdd7733e655c1dd8438cf9265e2b8b50051b3..b72ae43f87a1b4126fafc4ccb3cbc4eac0ea3542 100644 (file)
@@ -117,11 +117,12 @@ static int set_dist_point_name(DIST_POINT_NAME **pdp, X509V3_CTX *ctx,
 {
     STACK_OF(GENERAL_NAME) *fnm = NULL;
     STACK_OF(X509_NAME_ENTRY) *rnm = NULL;
 {
     STACK_OF(GENERAL_NAME) *fnm = NULL;
     STACK_OF(X509_NAME_ENTRY) *rnm = NULL;
-    if (!strncmp(cnf->name, "fullname", 9)) {
+
+    if (strncmp(cnf->name, "fullname", 9) == 0) {
         fnm = gnames_from_sectname(ctx, cnf->value);
         if (!fnm)
             goto err;
         fnm = gnames_from_sectname(ctx, cnf->value);
         if (!fnm)
             goto err;
-    } else if (!strcmp(cnf->name, "relativename")) {
+    } else if (strcmp(cnf->name, "relativename") == 0) {
         int ret;
         STACK_OF(CONF_VALUE) *dnsect;
         X509_NAME *nm;
         int ret;
         STACK_OF(CONF_VALUE) *dnsect;
         X509_NAME *nm;
@@ -210,7 +211,7 @@ static int set_reasons(ASN1_BIT_STRING **preas, char *value)
                 goto err;
         }
         for (pbn = reason_flags; pbn->lname; pbn++) {
                 goto err;
         }
         for (pbn = reason_flags; pbn->lname; pbn++) {
-            if (!strcmp(pbn->sname, bnam)) {
+            if (strcmp(pbn->sname, bnam) == 0) {
                 if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1))
                     goto err;
                 break;
                 if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1))
                     goto err;
                 break;
@@ -265,10 +266,10 @@ static DIST_POINT *crldp_from_section(X509V3_CTX *ctx,
             continue;
         if (ret < 0)
             goto err;
             continue;
         if (ret < 0)
             goto err;
-        if (!strcmp(cnf->name, "reasons")) {
+        if (strcmp(cnf->name, "reasons") == 0) {
             if (!set_reasons(&point->reasons, cnf->value))
                 goto err;
             if (!set_reasons(&point->reasons, cnf->value))
                 goto err;
-        } else if (!strcmp(cnf->name, "CRLissuer")) {
+        } else if (strcmp(cnf->name, "CRLissuer") == 0) {
             point->CRLissuer = gnames_from_sectname(ctx, cnf->value);
             if (!point->CRLissuer)
                 goto err;
             point->CRLissuer = gnames_from_sectname(ctx, cnf->value);
             if (!point->CRLissuer)
                 goto err;
@@ -426,19 +427,19 @@ static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
             continue;
         if (ret < 0)
             goto err;
             continue;
         if (ret < 0)
             goto err;
-        if (!strcmp(name, "onlyuser")) {
+        if (strcmp(name, "onlyuser") == 0) {
             if (!X509V3_get_value_bool(cnf, &idp->onlyuser))
                 goto err;
             if (!X509V3_get_value_bool(cnf, &idp->onlyuser))
                 goto err;
-        } else if (!strcmp(name, "onlyCA")) {
+        } else if (strcmp(name, "onlyCA") == 0) {
             if (!X509V3_get_value_bool(cnf, &idp->onlyCA))
                 goto err;
             if (!X509V3_get_value_bool(cnf, &idp->onlyCA))
                 goto err;
-        } else if (!strcmp(name, "onlyAA")) {
+        } else if (strcmp(name, "onlyAA") == 0) {
             if (!X509V3_get_value_bool(cnf, &idp->onlyattr))
                 goto err;
             if (!X509V3_get_value_bool(cnf, &idp->onlyattr))
                 goto err;
-        } else if (!strcmp(name, "indirectCRL")) {
+        } else if (strcmp(name, "indirectCRL") == 0) {
             if (!X509V3_get_value_bool(cnf, &idp->indirectCRL))
                 goto err;
             if (!X509V3_get_value_bool(cnf, &idp->indirectCRL))
                 goto err;
-        } else if (!strcmp(name, "onlysomereasons")) {
+        } else if (strcmp(name, "onlysomereasons") == 0) {
             if (!set_reasons(&idp->onlysomereasons, val))
                 goto err;
         } else {
             if (!set_reasons(&idp->onlysomereasons, val))
                 goto err;
         } else {
index 1e6fae80814f6cf983f9688732cce6221b62c76f..9d48fb994b32888af53e1e9234b38fd917856d5f 100644 (file)
@@ -118,15 +118,16 @@ static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
     STACK_OF(GENERAL_SUBTREE) **ptree = NULL;
     NAME_CONSTRAINTS *ncons = NULL;
     GENERAL_SUBTREE *sub = NULL;
     STACK_OF(GENERAL_SUBTREE) **ptree = NULL;
     NAME_CONSTRAINTS *ncons = NULL;
     GENERAL_SUBTREE *sub = NULL;
+
     ncons = NAME_CONSTRAINTS_new();
     if (!ncons)
         goto memerr;
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         val = sk_CONF_VALUE_value(nval, i);
     ncons = NAME_CONSTRAINTS_new();
     if (!ncons)
         goto memerr;
     for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
         val = sk_CONF_VALUE_value(nval, i);
-        if (!strncmp(val->name, "permitted", 9) && val->name[9]) {
+        if (strncmp(val->name, "permitted", 9) == 0 && val->name[9]) {
             ptree = &ncons->permittedSubtrees;
             tval.name = val->name + 10;
             ptree = &ncons->permittedSubtrees;
             tval.name = val->name + 10;
-        } else if (!strncmp(val->name, "excluded", 8) && val->name[8]) {
+        } else if (strncmp(val->name, "excluded", 8) == 0 && val->name[8]) {
             ptree = &ncons->excludedSubtrees;
             tval.name = val->name + 9;
         } else {
             ptree = &ncons->excludedSubtrees;
             tval.name = val->name + 9;
         } else {
@@ -406,7 +407,7 @@ static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base)
     if (!baseat && (*baseptr == '.')) {
         if (eml->length > base->length) {
             emlptr += eml->length - base->length;
     if (!baseat && (*baseptr == '.')) {
         if (eml->length > base->length) {
             emlptr += eml->length - base->length;
-            if (!strcasecmp(baseptr, emlptr))
+            if (strcasecmp(baseptr, emlptr) == 0)
                 return X509_V_OK;
         }
         return X509_V_ERR_PERMITTED_VIOLATION;
                 return X509_V_OK;
         }
         return X509_V_ERR_PERMITTED_VIOLATION;
@@ -466,7 +467,7 @@ static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base)
     if (*baseptr == '.') {
         if (hostlen > base->length) {
             p = hostptr + hostlen - base->length;
     if (*baseptr == '.') {
         if (hostlen > base->length) {
             p = hostptr + hostlen - base->length;
-            if (!strncasecmp(p, baseptr, base->length))
+            if (strncasecmp(p, baseptr, base->length) == 0)
                 return X509_V_OK;
         }
         return X509_V_ERR_PERMITTED_VIOLATION;
                 return X509_V_OK;
         }
         return X509_V_ERR_PERMITTED_VIOLATION;
index cfccb97de6fb1405f328f2e4bb5aba909d840448..3349cef0271d4ebb56b9df7fa2d6985f06f7eb32 100644 (file)
@@ -114,10 +114,10 @@ static void *v2i_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method,
     }
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
     }
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         val = sk_CONF_VALUE_value(values, i);
-        if (!strcmp(val->name, "requireExplicitPolicy")) {
+        if (strcmp(val->name, "requireExplicitPolicy") == 0) {
             if (!X509V3_get_value_int(val, &pcons->requireExplicitPolicy))
                 goto err;
             if (!X509V3_get_value_int(val, &pcons->requireExplicitPolicy))
                 goto err;
-        } else if (!strcmp(val->name, "inhibitPolicyMapping")) {
+        } else if (strcmp(val->name, "inhibitPolicyMapping") == 0) {
             if (!X509V3_get_value_int(val, &pcons->inhibitPolicyMapping))
                 goto err;
         } else {
             if (!X509V3_get_value_int(val, &pcons->inhibitPolicyMapping))
                 goto err;
         } else {
index ed634cb2f5571a9e1d6f0be8eafeb4cd27d9eba0..beb8b2f870b8733188345db0b5ec896e63dbaa29 100644 (file)
@@ -172,7 +172,7 @@ int X509_PURPOSE_get_by_sname(char *sname)
     X509_PURPOSE *xptmp;
     for (i = 0; i < X509_PURPOSE_get_count(); i++) {
         xptmp = X509_PURPOSE_get0(i);
     X509_PURPOSE *xptmp;
     for (i = 0; i < X509_PURPOSE_get_count(); i++) {
         xptmp = X509_PURPOSE_get0(i);
-        if (!strcmp(xptmp->sname, sname))
+        if (strcmp(xptmp->sname, sname) == 0)
             return i;
     }
     return -1;
             return i;
     }
     return -1;
index a5fda6fd10c2b2e66e0f0b6f0edab8f8cd96003f..81227e0d01de406c4ba57ec04c9cb367e0a9c1da 100644 (file)
@@ -234,14 +234,21 @@ int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool)
     char *btmp;
     if (!(btmp = value->value))
         goto err;
     char *btmp;
     if (!(btmp = value->value))
         goto err;
-    if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true")
-        || !strcmp(btmp, "Y") || !strcmp(btmp, "y")
-        || !strcmp(btmp, "YES") || !strcmp(btmp, "yes")) {
+    if (strcmp(btmp, "TRUE") == 0
+        || strcmp(btmp, "true") == 0
+        || strcmp(btmp, "Y") == 0
+        || strcmp(btmp, "y") == 0
+        || strcmp(btmp, "YES") == 0
+        || strcmp(btmp, "yes") == 0) {
         *asn1_bool = 0xff;
         return 1;
         *asn1_bool = 0xff;
         return 1;
-    } else if (!strcmp(btmp, "FALSE") || !strcmp(btmp, "false")
-               || !strcmp(btmp, "N") || !strcmp(btmp, "n")
-               || !strcmp(btmp, "NO") || !strcmp(btmp, "no")) {
+    }
+    if (strcmp(btmp, "FALSE") == 0
+        || strcmp(btmp, "false") == 0
+        || strcmp(btmp, "N") == 0
+        || strcmp(btmp, "n") == 0
+        || strcmp(btmp, "NO") == 0
+        || strcmp(btmp, "no") == 0) {
         *asn1_bool = 0;
         return 1;
     }
         *asn1_bool = 0;
         return 1;
     }
index dc354cae06b50c9dea973c334795ae2b0f10c3d5..8507e04f497d8f3480992b29d2a0aa5d878deef6 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
         if (rv > 0)
             continue;
         /* Otherwise application specific argument processing */
         if (rv > 0)
             continue;
         /* Otherwise application specific argument processing */
-        if (!strcmp(*args, "-connect")) {
+        if (strcmp(*args, "-connect") == 0) {
             connect_str = args[1];
             if (connect_str == NULL) {
                 fprintf(stderr, "Missing -connect argument\n");
             connect_str = args[1];
             if (connect_str == NULL) {
                 fprintf(stderr, "Missing -connect argument\n");
index 150e7fcf835f4c1b66d174439b837f271889705a..b75088a7580f687c7eb00f2314af4c4775b0415b 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
             ERR_print_errors_fp(stderr);
             goto end;
         }
             ERR_print_errors_fp(stderr);
             goto end;
         }
-        if (!strcmp(cnf->name, "Connect")) {
+        if (strcmp(cnf->name, "Connect") == 0) {
             connect_str = cnf->value;
         } else {
             fprintf(stderr, "Unknown configuration option %s\n", cnf->name);
             connect_str = cnf->value;
         } else {
             fprintf(stderr, "Unknown configuration option %s\n", cnf->name);
index 4f65227e4064c05981df07bb9c584e521b4d9ed0..b188f6a4edebfa3f0e4de6deb4e6381c917c5574 100644 (file)
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
         if (rv > 0)
             continue;
         /* Otherwise application specific argument processing */
         if (rv > 0)
             continue;
         /* Otherwise application specific argument processing */
-        if (!strcmp(*args, "-port")) {
+        if (strcmp(*args, "-port") == 0) {
             port = args[1];
             if (port == NULL) {
                 fprintf(stderr, "Missing -port argument\n");
             port = args[1];
             if (port == NULL) {
                 fprintf(stderr, "Missing -port argument\n");
index 5355839f4fdc189a8ad9ecdab10d9e514206a3a6..cc9fe8a828751e204fb3f3a0c0ee8bc7f8b3f3c6 100644 (file)
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
             ERR_print_errors_fp(stderr);
             goto err;
         }
             ERR_print_errors_fp(stderr);
             goto err;
         }
-        if (!strcmp(cnf->name, "Port")) {
+        if (strcmp(cnf->name, "Port") == 0) {
             port = cnf->value;
         } else {
             fprintf(stderr, "Unknown configuration option %s\n", cnf->name);
             port = cnf->value;
         } else {
             fprintf(stderr, "Unknown configuration option %s\n", cnf->name);
index b37bcf52016a6364123f8b13601357a4bafadfc5..af1d29e35c55abf9772791e5ba67ccb0b6e65bd2 100644 (file)
@@ -130,7 +130,8 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx,
                                 const char *type, const char *value)
 {
     int param_nid = 0;
                                 const char *type, const char *value)
 {
     int param_nid = 0;
-    if (!strcmp(type, param_ctrl_string)) {
+
+    if (strcmp(type, param_ctrl_string) == 0) {
         if (!value) {
             return 0;
         }
         if (!value) {
             return 0;
         }
@@ -192,7 +193,8 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx,
                                 const char *type, const char *value)
 {
     int param_nid = 0;
                                 const char *type, const char *value)
 {
     int param_nid = 0;
-    if (!strcmp(type, param_ctrl_string)) {
+
+    if (strcmp(type, param_ctrl_string) == 0) {
         if (!value) {
             return 0;
         }
         if (!value) {
             return 0;
         }
@@ -497,7 +499,7 @@ static int pkey_gost_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
 static int pkey_gost_mac_ctrl_str(EVP_PKEY_CTX *ctx,
                                   const char *type, const char *value)
 {
 static int pkey_gost_mac_ctrl_str(EVP_PKEY_CTX *ctx,
                                   const char *type, const char *value)
 {
-    if (!strcmp(type, key_ctrl_string)) {
+    if (strcmp(type, key_ctrl_string) == 0) {
         if (strlen(value) != 32) {
             GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL_STR,
                     GOST_R_INVALID_MAC_KEY_LENGTH);
         if (strlen(value) != 32) {
             GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL_STR,
                     GOST_R_INVALID_MAC_KEY_LENGTH);
@@ -506,7 +508,7 @@ static int pkey_gost_mac_ctrl_str(EVP_PKEY_CTX *ctx,
         return pkey_gost_mac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY,
                                   32, (char *)value);
     }
         return pkey_gost_mac_ctrl(ctx, EVP_PKEY_CTRL_SET_MAC_KEY,
                                   32, (char *)value);
     }
-    if (!strcmp(type, hexkey_ctrl_string)) {
+    if (strcmp(type, hexkey_ctrl_string) == 0) {
         long keylen;
         int ret;
         unsigned char *keybuf = string_to_hex(value, &keylen);
         long keylen;
         int ret;
         unsigned char *keybuf = string_to_hex(value, &keylen);
index 1021848ef72c9421c668cc25d305cf763a02a4c4..252bd2cfed6a25c81efdb1f5997e9c0fe765f55e 100644 (file)
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
                 exit(2);
             }
             count++;
                 exit(2);
             }
             count++;
-            if (!strncmp(calcsum, inhash, 65)) {
+            if (strncmp(calcsum, inhash, 65) == 0) {
                 if (verbose) {
                     fprintf(stderr, "%s\tOK\n", filename);
                 }
                 if (verbose) {
                     fprintf(stderr, "%s\tOK\n", filename);
                 }
index 0d62de6aea4782e193b2f262573a54885f470558..9932dde7d2ca30ec32c51edb1bb5fd3c084491d8 100644 (file)
@@ -139,7 +139,8 @@ static int find_profile_by_name(char *profile_name,
 
     p = srtp_known_profiles;
     while (p->name) {
 
     p = srtp_known_profiles;
     while (p->name) {
-        if ((len == strlen(p->name)) && !strncmp(p->name, profile_name, len)) {
+        if ((len == strlen(p->name))
+            && strncmp(p->name, profile_name, len) == 0) {
             *pptr = p;
             return 0;
         }
             *pptr = p;
             return 0;
         }
@@ -157,7 +158,6 @@ static int ssl_ctx_make_profiles(const char *profiles_string,
 
     char *col;
     char *ptr = (char *)profiles_string;
 
     char *col;
     char *ptr = (char *)profiles_string;
-
     SRTP_PROTECTION_PROFILE *p;
 
     if (!(profiles = sk_SRTP_PROTECTION_PROFILE_new_null())) {
     SRTP_PROTECTION_PROFILE *p;
 
     if (!(profiles = sk_SRTP_PROTECTION_PROFILE_new_null())) {
index a81ab8555f1b99091d21a6fe1bd242227abfaf92..ed274e01a7ea6f3e061a1cf37b9312a41de30fd7 100644 (file)
@@ -1195,8 +1195,8 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
             j = found = 0;
             cipher_id = 0;
             while (ca_list[j]) {
             j = found = 0;
             cipher_id = 0;
             while (ca_list[j]) {
-                if (!strncmp(buf, ca_list[j]->name, buflen) &&
-                    (ca_list[j]->name[buflen] == '\0')) {
+                if (strncmp(buf, ca_list[j]->name, buflen) == 0
+                    && (ca_list[j]->name[buflen] == '\0')) {
                     found = 1;
                     break;
                 } else
                     found = 1;
                     break;
                 } else
@@ -1311,9 +1311,9 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
          */
         if (rule == CIPHER_SPECIAL) { /* special command */
             ok = 0;
          */
         if (rule == CIPHER_SPECIAL) { /* special command */
             ok = 0;
-            if ((buflen == 8) && !strncmp(buf, "STRENGTH", 8))
+            if ((buflen == 8) && strncmp(buf, "STRENGTH", 8) == 0)
                 ok = ssl_cipher_strength_sort(head_p, tail_p);
                 ok = ssl_cipher_strength_sort(head_p, tail_p);
-            else if (buflen == 10 && !strncmp(buf, "SECLEVEL=", 9)) {
+            else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
                 int level = buf[9] - '0';
                 if (level < 0 || level > 5) {
                     SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
                 int level = buf[9] - '0';
                 if (level < 0 || level > 5) {
                     SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
@@ -1356,14 +1356,14 @@ static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
                                     const char **prule_str)
 {
     unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
                                     const char **prule_str)
 {
     unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
-    if (!strcmp(*prule_str, "SUITEB128"))
+    if (strcmp(*prule_str, "SUITEB128") == 0)
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
-    else if (!strcmp(*prule_str, "SUITEB128ONLY"))
+    else if (strcmp(*prule_str, "SUITEB128ONLY") == 0)
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
-    else if (!strcmp(*prule_str, "SUITEB128C2")) {
+    else if (strcmp(*prule_str, "SUITEB128C2") == 0) {
         suiteb_comb2 = 1;
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
         suiteb_comb2 = 1;
         suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
-    } else if (!strcmp(*prule_str, "SUITEB192"))
+    } else if (strcmp(*prule_str, "SUITEB192") == 0)
         suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
 
     if (suiteb_flags) {
         suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
 
     if (suiteb_flags) {
index c920af59991f67f22bfd4012c995f21e4c55ce3e..881c351f8964d48b9ddd429ac04c7465496770ee 100644 (file)
@@ -251,13 +251,13 @@ static int cmd_ECDHParameters(SSL_CONF_CTX *cctx, const char *value)
             onoff = 0;
             value++;
         }
             onoff = 0;
             value++;
         }
-        if (!strcasecmp(value, "automatic")) {
+        if (strcasecmp(value, "automatic") == 0) {
             if (onoff == -1)
                 onoff = 1;
         } else if (onoff != -1)
             return 0;
     } else if (cctx->flags & SSL_CONF_FLAG_CMDLINE) {
             if (onoff == -1)
                 onoff = 1;
         } else if (onoff != -1)
             return 0;
     } else if (cctx->flags & SSL_CONF_FLAG_CMDLINE) {
-        if (!strcmp(value, "auto"))
+        if (strcmp(value, "auto") == 0)
             onoff = 1;
     }
 
             onoff = 1;
     }
 
@@ -546,11 +546,11 @@ static const ssl_conf_cmd_tbl *ssl_conf_cmd_lookup(SSL_CONF_CTX *cctx,
     for (i = 0, t = ssl_conf_cmds; i < OSSL_NELEM(ssl_conf_cmds); i++, t++) {
         if (ssl_conf_cmd_allowed(cctx, t)) {
             if (cctx->flags & SSL_CONF_FLAG_CMDLINE) {
     for (i = 0, t = ssl_conf_cmds; i < OSSL_NELEM(ssl_conf_cmds); i++, t++) {
         if (ssl_conf_cmd_allowed(cctx, t)) {
             if (cctx->flags & SSL_CONF_FLAG_CMDLINE) {
-                if (t->str_cmdline && !strcmp(t->str_cmdline, cmd))
+                if (t->str_cmdline && strcmp(t->str_cmdline, cmd) == 0)
                     return t;
             }
             if (cctx->flags & SSL_CONF_FLAG_FILE) {
                     return t;
             }
             if (cctx->flags & SSL_CONF_FLAG_FILE) {
-                if (t->str_file && !strcasecmp(t->str_file, cmd))
+                if (t->str_file && strcasecmp(t->str_file, cmd) == 0)
                     return t;
             }
         }
                     return t;
             }
         }
index 906819566898f95a95efeda90ec7b233f0f3d3f9..f8ed091f397ecfd6be8af4939abe1b905567b3b0 100644 (file)
@@ -3749,11 +3749,11 @@ static int sig_cb(const char *elem, int len, void *arg)
     if (!*p)
         return 0;
 
     if (!*p)
         return 0;
 
-    if (!strcmp(etmp, "RSA"))
+    if (strcmp(etmp, "RSA") == 0)
         sig_alg = EVP_PKEY_RSA;
         sig_alg = EVP_PKEY_RSA;
-    else if (!strcmp(etmp, "DSA"))
+    else if (strcmp(etmp, "DSA") == 0)
         sig_alg = EVP_PKEY_DSA;
         sig_alg = EVP_PKEY_DSA;
-    else if (!strcmp(etmp, "ECDSA"))
+    else if (strcmp(etmp, "ECDSA") == 0)
         sig_alg = EVP_PKEY_EC;
     else
         return 0;
         sig_alg = EVP_PKEY_EC;
     else
         return 0;
index 51fc6af6a4cc63c632652538b6721d2aba3f69dd..e682f43f468155b0a2cf2949bcf82eb2d3e80894 100644 (file)
@@ -231,8 +231,9 @@ static const struct evp_test_method *evp_test_list[] = {
 static const struct evp_test_method *evp_find_test(const char *name)
 {
     const struct evp_test_method **tt;
 static const struct evp_test_method *evp_find_test(const char *name)
 {
     const struct evp_test_method **tt;
+
     for (tt = evp_test_list; *tt; tt++) {
     for (tt = evp_test_list; *tt; tt++) {
-        if (!strcmp(name, (*tt)->name))
+        if (strcmp(name, (*tt)->name) == 0)
             return *tt;
     }
     return NULL;
             return *tt;
     }
     return NULL;
@@ -281,7 +282,7 @@ static int check_test_error(struct evp_test *t)
                 t->start_line, t->expected_err);
         return 0;
     }
                 t->start_line, t->expected_err);
         return 0;
     }
-    if (!strcmp(t->err, t->expected_err))
+    if (strcmp(t->err, t->expected_err) == 0)
         return 1;
 
     fprintf(stderr, "Test line %d: expecting %s got %s\n",
         return 1;
 
     fprintf(stderr, "Test line %d: expecting %s got %s\n",
@@ -327,7 +328,7 @@ static int setup_test(struct evp_test *t, const struct evp_test_method *tmeth)
 static int find_key(EVP_PKEY **ppk, const char *name, struct key_list *lst)
 {
     for (; lst; lst = lst->next) {
 static int find_key(EVP_PKEY **ppk, const char *name, struct key_list *lst)
 {
     for (; lst; lst = lst->next) {
-        if (!strcmp(lst->name, name)) {
+        if (strcmp(lst->name, name) == 0) {
             if (ppk)
                 *ppk = lst->key;
             return 1;
             if (ppk)
                 *ppk = lst->key;
             return 1;
@@ -371,7 +372,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
         fputs(buf, stdout);
     if (!parse_line(&keyword, &value, buf))
         return 1;
         fputs(buf, stdout);
     if (!parse_line(&keyword, &value, buf))
         return 1;
-    if (!strcmp(keyword, "PrivateKey")) {
+    if (strcmp(keyword, "PrivateKey") == 0) {
         save_pos = ftell(t->in);
         pk = PEM_read_PrivateKey(t->in, NULL, 0, NULL);
         if (pk == NULL && !check_unsupported()) {
         save_pos = ftell(t->in);
         pk = PEM_read_PrivateKey(t->in, NULL, 0, NULL);
         if (pk == NULL && !check_unsupported()) {
@@ -382,7 +383,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
         lst = &t->private;
         add_key = 1;
     }
         lst = &t->private;
         add_key = 1;
     }
-    if (!strcmp(keyword, "PublicKey")) {
+    if (strcmp(keyword, "PublicKey") == 0) {
         save_pos = ftell(t->in);
         pk = PEM_read_PUBKEY(t->in, NULL, 0, NULL);
         if (pk == NULL && !check_unsupported()) {
         save_pos = ftell(t->in);
         pk = PEM_read_PUBKEY(t->in, NULL, 0, NULL);
         if (pk == NULL && !check_unsupported()) {
@@ -411,7 +412,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
         fseek(t->in, save_pos, SEEK_SET);
         while (fgets(tmpbuf, sizeof(tmpbuf), t->in)) {
             t->line++;
         fseek(t->in, save_pos, SEEK_SET);
         while (fgets(tmpbuf, sizeof(tmpbuf), t->in)) {
             t->line++;
-            if (!strncmp(tmpbuf, "-----END", 8))
+            if (strncmp(tmpbuf, "-----END", 8) == 0)
                 return 1;
         }
         fprintf(stderr, "Can't find key end\n");
                 return 1;
         }
         fprintf(stderr, "Can't find key end\n");
@@ -432,7 +433,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
         return 1;
     } else if (t->skip) {
         return 1;
         return 1;
     } else if (t->skip) {
         return 1;
-    } else if (!strcmp(keyword, "Result")) {
+    } else if (strcmp(keyword, "Result") == 0) {
         if (t->expected_err) {
             fprintf(stderr, "Line %d: multiple result lines\n", t->line);
             return 0;
         if (t->expected_err) {
             fprintf(stderr, "Line %d: multiple result lines\n", t->line);
             return 0;
@@ -579,11 +580,11 @@ static int digest_test_parse(struct evp_test *t,
                              const char *keyword, const char *value)
 {
     struct digest_data *mdata = t->data;
                              const char *keyword, const char *value)
 {
     struct digest_data *mdata = t->data;
-    if (!strcmp(keyword, "Input"))
+    if (strcmp(keyword, "Input") == 0)
         return test_bin(value, &mdata->input, &mdata->input_len);
         return test_bin(value, &mdata->input, &mdata->input_len);
-    if (!strcmp(keyword, "Output"))
+    if (strcmp(keyword, "Output") == 0)
         return test_bin(value, &mdata->output, &mdata->output_len);
         return test_bin(value, &mdata->output, &mdata->output_len);
-    if (!strcmp(keyword, "Count")) {
+    if (strcmp(keyword, "Count") == 0) {
         long nrpt = atoi(value);
         if (nrpt <= 0)
             return 0;
         long nrpt = atoi(value);
         if (nrpt <= 0)
             return 0;
@@ -706,25 +707,25 @@ static int cipher_test_parse(struct evp_test *t, const char *keyword,
                              const char *value)
 {
     struct cipher_data *cdat = t->data;
                              const char *value)
 {
     struct cipher_data *cdat = t->data;
-    if (!strcmp(keyword, "Key"))
+    if (strcmp(keyword, "Key") == 0)
         return test_bin(value, &cdat->key, &cdat->key_len);
         return test_bin(value, &cdat->key, &cdat->key_len);
-    if (!strcmp(keyword, "IV"))
+    if (strcmp(keyword, "IV") == 0)
         return test_bin(value, &cdat->iv, &cdat->iv_len);
         return test_bin(value, &cdat->iv, &cdat->iv_len);
-    if (!strcmp(keyword, "Plaintext"))
+    if (strcmp(keyword, "Plaintext") == 0)
         return test_bin(value, &cdat->plaintext, &cdat->plaintext_len);
         return test_bin(value, &cdat->plaintext, &cdat->plaintext_len);
-    if (!strcmp(keyword, "Ciphertext"))
+    if (strcmp(keyword, "Ciphertext") == 0)
         return test_bin(value, &cdat->ciphertext, &cdat->ciphertext_len);
     if (cdat->aead) {
         return test_bin(value, &cdat->ciphertext, &cdat->ciphertext_len);
     if (cdat->aead) {
-        if (!strcmp(keyword, "AAD"))
+        if (strcmp(keyword, "AAD") == 0)
             return test_bin(value, &cdat->aad, &cdat->aad_len);
             return test_bin(value, &cdat->aad, &cdat->aad_len);
-        if (!strcmp(keyword, "Tag"))
+        if (strcmp(keyword, "Tag") == 0)
             return test_bin(value, &cdat->tag, &cdat->tag_len);
     }
 
             return test_bin(value, &cdat->tag, &cdat->tag_len);
     }
 
-    if (!strcmp(keyword, "Operation")) {
-        if (!strcmp(value, "ENCRYPT"))
+    if (strcmp(keyword, "Operation") == 0) {
+        if (strcmp(value, "ENCRYPT") == 0)
             cdat->enc = 1;
             cdat->enc = 1;
-        else if (!strcmp(value, "DECRYPT"))
+        else if (strcmp(value, "DECRYPT") == 0)
             cdat->enc = 0;
         else
             return 0;
             cdat->enc = 0;
         else
             return 0;
@@ -928,9 +929,9 @@ static int mac_test_init(struct evp_test *t, const char *alg)
 {
     int type;
     struct mac_data *mdat;
 {
     int type;
     struct mac_data *mdat;
-    if (!strcmp(alg, "HMAC"))
+    if (strcmp(alg, "HMAC") == 0)
         type = EVP_PKEY_HMAC;
         type = EVP_PKEY_HMAC;
-    else if (!strcmp(alg, "CMAC"))
+    else if (strcmp(alg, "CMAC") == 0)
         type = EVP_PKEY_CMAC;
     else
         return 0;
         type = EVP_PKEY_CMAC;
     else
         return 0;
@@ -958,17 +959,17 @@ static int mac_test_parse(struct evp_test *t,
                           const char *keyword, const char *value)
 {
     struct mac_data *mdata = t->data;
                           const char *keyword, const char *value)
 {
     struct mac_data *mdata = t->data;
-    if (!strcmp(keyword, "Key"))
+    if (strcmp(keyword, "Key") == 0)
         return test_bin(value, &mdata->key, &mdata->key_len);
         return test_bin(value, &mdata->key, &mdata->key_len);
-    if (!strcmp(keyword, "Algorithm")) {
+    if (strcmp(keyword, "Algorithm") == 0) {
         mdata->alg = BUF_strdup(value);
         if (!mdata->alg)
             return 0;
         return 1;
     }
         mdata->alg = BUF_strdup(value);
         if (!mdata->alg)
             return 0;
         return 1;
     }
-    if (!strcmp(keyword, "Input"))
+    if (strcmp(keyword, "Input") == 0)
         return test_bin(value, &mdata->input, &mdata->input_len);
         return test_bin(value, &mdata->input, &mdata->input_len);
-    if (!strcmp(keyword, "Output"))
+    if (strcmp(keyword, "Output") == 0)
         return test_bin(value, &mdata->output, &mdata->output_len);
     return 0;
 }
         return test_bin(value, &mdata->output, &mdata->output_len);
     return 0;
 }
@@ -1134,11 +1135,11 @@ static int pkey_test_parse(struct evp_test *t,
                            const char *keyword, const char *value)
 {
     struct pkey_data *kdata = t->data;
                            const char *keyword, const char *value)
 {
     struct pkey_data *kdata = t->data;
-    if (!strcmp(keyword, "Input"))
+    if (strcmp(keyword, "Input") == 0)
         return test_bin(value, &kdata->input, &kdata->input_len);
         return test_bin(value, &kdata->input, &kdata->input_len);
-    if (!strcmp(keyword, "Output"))
+    if (strcmp(keyword, "Output") == 0)
         return test_bin(value, &kdata->output, &kdata->output_len);
         return test_bin(value, &kdata->output, &kdata->output_len);
-    if (!strcmp(keyword, "Ctrl")) {
+    if (strcmp(keyword, "Ctrl") == 0) {
         char *p = strchr(value, ':');
         if (p)
             *p++ = 0;
         char *p = strchr(value, ':');
         if (p)
             *p++ = 0;
index 35df0f7881a3179f712ad23df5944eda637a663f..39f1d80509559c0b284626704b34cf0ec984a3aa 100644 (file)
@@ -1059,7 +1059,7 @@ int main(int argc, char *argv[])
     argv++;
 
     while (argc >= 1) {
     argv++;
 
     while (argc >= 1) {
-        if (!strcmp(*argv, "-F")) {
+        if (strcmp(*argv, "-F") == 0) {
 #ifdef OPENSSL_FIPS
             fips_mode = 1;
 #else
 #ifdef OPENSSL_FIPS
             fips_mode = 1;
 #else