forked from wolfSSL/wolfssl
fix tolower typecast on CYGWIN, gcc-arm-none-eabi (gnuarmeclipse toolchain) and possible future ports.
This commit is contained in:
@ -3837,18 +3837,19 @@ static int MatchDomainName(const char* pattern, int len, const char* str)
|
|||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
|
|
||||||
p = (char)XTOLOWER(*pattern++);
|
p = (char)XTOLOWER((unsigned char)*pattern++);
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (p == '*') {
|
if (p == '*') {
|
||||||
while (--len > 0 && (p = (char)XTOLOWER(*pattern++)) == '*')
|
while (--len > 0 &&
|
||||||
|
(p = (char)XTOLOWER((unsigned char)*pattern++)) == '*')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
p = '\0';
|
p = '\0';
|
||||||
|
|
||||||
while ( (s = (char)XTOLOWER(*str)) != '\0') {
|
while ( (s = (char)XTOLOWER((unsigned char) *str)) != '\0') {
|
||||||
if (s == p)
|
if (s == p)
|
||||||
break;
|
break;
|
||||||
if (s == '.')
|
if (s == '.')
|
||||||
@ -3857,7 +3858,7 @@ static int MatchDomainName(const char* pattern, int len, const char* str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (p != (char)XTOLOWER(*str))
|
if (p != (char)XTOLOWER((unsigned char) *str))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3238,7 +3238,8 @@ static int MatchBaseName(int type, const char* name, int nameSz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (nameSz > 0) {
|
while (nameSz > 0) {
|
||||||
if (XTOLOWER(*name++) != XTOLOWER(*base++))
|
if (XTOLOWER((unsigned char)*name++) !=
|
||||||
|
XTOLOWER((unsigned char)*base++))
|
||||||
return 0;
|
return 0;
|
||||||
nameSz--;
|
nameSz--;
|
||||||
}
|
}
|
||||||
|
@ -217,11 +217,6 @@
|
|||||||
#define XISALPHA(c) isalpha((c))
|
#define XISALPHA(c) isalpha((c))
|
||||||
#endif
|
#endif
|
||||||
/* needed by wolfSSL_check_domain_name() */
|
/* 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))
|
#define XTOLOWER(c) tolower((c))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user