aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-06 14:56:14 -0400
committerRich Salz <rsalz@openssl.org>2015-05-06 22:37:53 -0400
commit86885c289580066792415218754bd935b449f170 (patch)
tree8cab1bdeb50bfee21ce6677d9150c8d385379321 /engines
parentdab18ab596acb35eff2545643e25757e4f9cd777 (diff)
downloadopenssl-86885c289580066792415218754bd935b449f170.zip
openssl-86885c289580066792415218754bd935b449f170.tar.gz
openssl-86885c289580066792415218754bd935b449f170.tar.bz2
Use "==0" instead of "!strcmp" etc
For the various string-compare routines (strcmp, strcasecmp, str.*cmp) use "strcmp()==0" instead of "!strcmp()" Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r--engines/ccgost/gost_pmeth.c10
-rw-r--r--engines/ccgost/gostsum.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c
index b37bcf5..af1d29e 100644
--- a/engines/ccgost/gost_pmeth.c
+++ b/engines/ccgost/gost_pmeth.c
@@ -130,7 +130,8 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx,
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;
}
@@ -192,7 +193,8 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx,
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;
}
@@ -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)
{
- 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);
@@ -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);
}
- 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);
diff --git a/engines/ccgost/gostsum.c b/engines/ccgost/gostsum.c
index 1021848..252bd2c 100644
--- a/engines/ccgost/gostsum.c
+++ b/engines/ccgost/gostsum.c
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
exit(2);
}
count++;
- if (!strncmp(calcsum, inhash, 65)) {
+ if (strncmp(calcsum, inhash, 65) == 0) {
if (verbose) {
fprintf(stderr, "%s\tOK\n", filename);
}