From fba140c73541c03e22b4fdb219a05d129bf0406d Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Tue, 12 Apr 2022 12:30:08 +0200 Subject: str[n]casecmp => OPENSSL_strncasecmp Reviewed-by: Tim Hudson Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18069) --- crypto/encode_decode/decoder_lib.c | 10 ++++++---- crypto/encode_decode/decoder_pkey.c | 1 - crypto/encode_decode/encoder_lib.c | 9 ++++----- crypto/encode_decode/encoder_pkey.c | 1 - 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'crypto/encode_decode') diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c index 6781c61c6c..768c58c310 100644 --- a/crypto/encode_decode/decoder_lib.c +++ b/crypto/encode_decode/decoder_lib.c @@ -796,7 +796,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg) */ trace_data_structure = data_structure; if (data_type != NULL && data_structure != NULL - && strcasecmp(data_structure, "type-specific") == 0) + && OPENSSL_strcasecmp(data_structure, "type-specific") == 0) data_structure = NULL; OSSL_TRACE_BEGIN(DECODER) { @@ -857,7 +857,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg) * that's the case, we do this extra check. */ if (decoder == NULL && ctx->start_input_type != NULL - && strcasecmp(ctx->start_input_type, new_input_type) != 0) { + && OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) { OSSL_TRACE_BEGIN(DECODER) { BIO_printf(trc_out, "(ctx %p) %s [%u] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n", @@ -904,7 +904,8 @@ static int decoder_process(const OSSL_PARAM params[], void *arg) */ if (data_structure != NULL && (new_input_structure == NULL - || strcasecmp(data_structure, new_input_structure) != 0)) { + || OPENSSL_strcasecmp(data_structure, + new_input_structure) != 0)) { OSSL_TRACE_BEGIN(DECODER) { BIO_printf(trc_out, "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the considered decoder, skipping...\n", @@ -923,7 +924,8 @@ static int decoder_process(const OSSL_PARAM params[], void *arg) && ctx->input_structure != NULL && new_input_structure != NULL) { data->flag_input_structure_checked = 1; - if (strcasecmp(new_input_structure, ctx->input_structure) != 0) { + if (OPENSSL_strcasecmp(new_input_structure, + ctx->input_structure) != 0) { OSSL_TRACE_BEGIN(DECODER) { BIO_printf(trc_out, "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by the user, skipping...\n", diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 8cb320a5ce..268c05ce2d 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -19,7 +19,6 @@ #include "crypto/decoder.h" #include "crypto/evp/evp_local.h" #include "encoder_local.h" -#include "internal/e_os.h" /* strcasecmp on Windows */ #include "internal/namemap.h" int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx, diff --git a/crypto/encode_decode/encoder_lib.c b/crypto/encode_decode/encoder_lib.c index 52cc404097..ded8bae8af 100644 --- a/crypto/encode_decode/encoder_lib.c +++ b/crypto/encode_decode/encoder_lib.c @@ -7,7 +7,6 @@ * https://www.openssl.org/source/license.html */ -#include "internal/e_os.h" /* strcasecmp on Windows */ #include #include #include @@ -453,8 +452,8 @@ static int encoder_process(struct encoder_process_data_st *data) */ if (top) { if (data->ctx->output_type != NULL - && strcasecmp(current_output_type, - data->ctx->output_type) != 0) { + && OPENSSL_strcasecmp(current_output_type, + data->ctx->output_type) != 0) { OSSL_TRACE_BEGIN(ENCODER) { BIO_printf(trc_out, "[%d] Skipping because current encoder output type (%s) != desired output type (%s)\n", @@ -482,8 +481,8 @@ static int encoder_process(struct encoder_process_data_st *data) */ if (data->ctx->output_structure != NULL && current_output_structure != NULL) { - if (strcasecmp(data->ctx->output_structure, - current_output_structure) != 0) { + if (OPENSSL_strcasecmp(data->ctx->output_structure, + current_output_structure) != 0) { OSSL_TRACE_BEGIN(ENCODER) { BIO_printf(trc_out, "[%d] Skipping because current encoder output structure (%s) != ctx output structure (%s)\n", diff --git a/crypto/encode_decode/encoder_pkey.c b/crypto/encode_decode/encoder_pkey.c index 74765a58ea..e39ec275da 100644 --- a/crypto/encode_decode/encoder_pkey.c +++ b/crypto/encode_decode/encoder_pkey.c @@ -7,7 +7,6 @@ * https://www.openssl.org/source/license.html */ -#include "internal/e_os.h" /* strcasecmp on Windows */ #include #include #include -- cgit v1.2.1