diff options
author | Andy Polyakov <appro@openssl.org> | 2012-01-12 16:37:20 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2012-01-12 16:37:20 +0000 |
commit | 27b1f137ff76def14a1b71c8867ab7ffed3ce69e (patch) | |
tree | dc00965ed027da80624c0fdf30c755f48bb3e2b6 /engines | |
parent | f63c927e8e47f46f52f84d5935daf0122bd2d9a5 (diff) |
Sanitize usage of <ctype.h> functions. It's important that characters
are passed zero-extended, not sign-extended [from HEAD].
PR: 2682
Diffstat (limited to 'engines')
-rw-r--r-- | engines/ccgost/gost_pmeth.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index caaea99d36..4a05853e55 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -123,7 +123,7 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx, } if (strlen(value) == 1) { - switch(toupper(value[0])) + switch(toupper((unsigned char)value[0])) { case 'A': param_nid = NID_id_GostR3410_94_CryptoPro_A_ParamSet; @@ -142,9 +142,9 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx, break; } } - else if ((strlen(value) == 2) && (toupper(value[0]) == 'X')) + else if ((strlen(value) == 2) && (toupper((unsigned char)value[0]) == 'X')) { - switch (toupper(value[1])) + switch (toupper((unsigned char)value[1])) { case 'A': param_nid = NID_id_GostR3410_94_CryptoPro_XchA_ParamSet; @@ -198,7 +198,7 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx, } if (strlen(value) == 1) { - switch(toupper(value[0])) + switch(toupper((unsigned char)value[0])) { case 'A': param_nid = NID_id_GostR3410_2001_CryptoPro_A_ParamSet; @@ -217,9 +217,9 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx, break; } } - else if ((strlen(value) == 2) && (toupper(value[0]) == 'X')) + else if ((strlen(value) == 2) && (toupper((unsigned char)value[0]) == 'X')) { - switch (toupper(value[1])) + switch (toupper((unsigned char)value[1])) { case 'A': param_nid = NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet; |