diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2022-04-12 12:30:08 +0200 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2022-04-22 11:34:41 +0200 |
commit | fba140c73541c03e22b4fdb219a05d129bf0406d (patch) | |
tree | b5c692f73ff063c2f071ef2383979fb8aa572164 /crypto/evp | |
parent | 4b2bd2722b8294a6b27c9e1fcf7d76f7d9de9b44 (diff) |
str[n]casecmp => OPENSSL_strncasecmp
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18069)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/ctrl_params_translate.c | 12 | ||||
-rw-r--r-- | crypto/evp/ec_support.c | 4 | ||||
-rw-r--r-- | crypto/evp/evp_lib.c | 13 | ||||
-rw-r--r-- | crypto/evp/p_lib.c | 4 |
4 files changed, 15 insertions, 18 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index 33e5e7f189..74df2fd1a3 100644 --- a/crypto/evp/ctrl_params_translate.c +++ b/crypto/evp/ctrl_params_translate.c @@ -37,8 +37,6 @@ #include "crypto/dh.h" #include "crypto/ec.h" -#include "internal/e_os.h" /* strcasecmp() for Windows */ - struct translation_ctx_st; /* Forwarding */ struct translation_st; /* Forwarding */ @@ -905,7 +903,7 @@ static int fix_kdf_type(enum state state, /* Convert KDF type strings to numbers */ for (; kdf_type_map->kdf_type_str != NULL; kdf_type_map++) - if (strcasecmp(ctx->p2, kdf_type_map->kdf_type_str) == 0) { + if (OPENSSL_strcasecmp(ctx->p2, kdf_type_map->kdf_type_str) == 0) { ctx->p1 = kdf_type_map->kdf_type_num; ret = 1; break; @@ -2469,10 +2467,11 @@ lookup_translation(struct translation_st *tmpl, * cmd name in the template. */ if (item->ctrl_str != NULL - && strcasecmp(tmpl->ctrl_str, item->ctrl_str) == 0) + && OPENSSL_strcasecmp(tmpl->ctrl_str, item->ctrl_str) == 0) ctrl_str = tmpl->ctrl_str; else if (item->ctrl_hexstr != NULL - && strcasecmp(tmpl->ctrl_hexstr, item->ctrl_hexstr) == 0) + && OPENSSL_strcasecmp(tmpl->ctrl_hexstr, + item->ctrl_hexstr) == 0) ctrl_hexstr = tmpl->ctrl_hexstr; else continue; @@ -2500,7 +2499,8 @@ lookup_translation(struct translation_st *tmpl, if ((item->action_type != NONE && tmpl->action_type != item->action_type) || (item->param_key != NULL - && strcasecmp(tmpl->param_key, item->param_key) != 0)) + && OPENSSL_strcasecmp(tmpl->param_key, + item->param_key) != 0)) continue; } else { return NULL; diff --git a/crypto/evp/ec_support.c b/crypto/evp/ec_support.c index 979e861cff..aa3c7fa4ef 100644 --- a/crypto/evp/ec_support.c +++ b/crypto/evp/ec_support.c @@ -10,7 +10,7 @@ #include <string.h> #include <openssl/ec.h> #include "crypto/ec.h" -#include "internal/e_os.h" /* strcasecmp required by windows */ +#include "internal/nelem.h" typedef struct ec_name2nid_st { const char *name; @@ -139,7 +139,7 @@ int ossl_ec_curve_name2nid(const char *name) return nid; for (i = 0; i < OSSL_NELEM(curve_list); i++) { - if (strcasecmp(curve_list[i].name, name) == 0) + if (OPENSSL_strcasecmp(curve_list[i].name, name) == 0) return curve_list[i].nid; } } diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 7e03d03bf6..85a3c4f7cd 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -15,7 +15,6 @@ #include <stdio.h> #include <string.h> -#include "internal/e_os.h" /* strcasecmp */ #include "internal/cryptlib.h" #include <openssl/evp.h> #include <openssl/objects.h> @@ -1194,17 +1193,17 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq, va_start(args, type); - if (strcasecmp(type, "RSA") == 0) { + if (OPENSSL_strcasecmp(type, "RSA") == 0) { bits = va_arg(args, size_t); params[0] = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits); - } else if (strcasecmp(type, "EC") == 0) { + } else if (OPENSSL_strcasecmp(type, "EC") == 0) { name = va_arg(args, char *); params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, name, 0); - } else if (strcasecmp(type, "ED25519") != 0 - && strcasecmp(type, "X25519") != 0 - && strcasecmp(type, "ED448") != 0 - && strcasecmp(type, "X448") != 0) { + } else if (OPENSSL_strcasecmp(type, "ED25519") != 0 + && OPENSSL_strcasecmp(type, "X25519") != 0 + && OPENSSL_strcasecmp(type, "ED448") != 0 + && OPENSSL_strcasecmp(type, "X448") != 0) { ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT); goto end; } diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index be15f105b7..668607a723 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -50,8 +50,6 @@ #include "internal/provider.h" #include "evp_local.h" -#include "internal/e_os.h" /* strcasecmp on Windows */ - static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str, int len, EVP_KEYMGMT *keymgmt); static void evp_pkey_free_it(EVP_PKEY *key); @@ -1018,7 +1016,7 @@ int evp_pkey_name2type(const char *name) size_t i; for (i = 0; i < OSSL_NELEM(standard_name2type); i++) { - if (strcasecmp(name, standard_name2type[i].ptr) == 0) + if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0) return (int)standard_name2type[i].id; } |