diff --git a/src/internal.c b/src/internal.c index 067a0e75c..e43d35820 100644 --- a/src/internal.c +++ b/src/internal.c @@ -3837,18 +3837,19 @@ static int MatchDomainName(const char* pattern, int len, const char* str) while (len > 0) { - p = (char)XTOLOWER(*pattern++); + p = (char)XTOLOWER((unsigned char)*pattern++); if (p == 0) break; if (p == '*') { - while (--len > 0 && (p = (char)XTOLOWER(*pattern++)) == '*') + while (--len > 0 && + (p = (char)XTOLOWER((unsigned char)*pattern++)) == '*') ; if (len == 0) p = '\0'; - while ( (s = (char)XTOLOWER(*str)) != '\0') { + while ( (s = (char)XTOLOWER((unsigned char) *str)) != '\0') { if (s == p) break; if (s == '.') @@ -3857,7 +3858,7 @@ static int MatchDomainName(const char* pattern, int len, const char* str) } } else { - if (p != (char)XTOLOWER(*str)) + if (p != (char)XTOLOWER((unsigned char) *str)) return 0; } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 9c79e13de..094629c6d 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -3238,7 +3238,8 @@ static int MatchBaseName(int type, const char* name, int nameSz, } while (nameSz > 0) { - if (XTOLOWER(*name++) != XTOLOWER(*base++)) + if (XTOLOWER((unsigned char)*name++) != + XTOLOWER((unsigned char)*base++)) return 0; nameSz--; } diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 51a8d5f63..d729ce31b 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -217,11 +217,6 @@ #define XISALPHA(c) isalpha((c)) #endif /* needed by wolfSSL_check_domain_name() */ - #ifdef __CYGWIN__ - /* Cygwin uses a macro version of tolower() by default, use the - * function version. */ - #undef tolower - #endif #define XTOLOWER(c) tolower((c)) #endif