curl_ntlm_core: merge two #if blocks

Cherry-picked from #20593

Closes #20620
This commit is contained in:
Viktor Szakats 2026-02-18 21:47:31 +01:00
parent dc08922a61
commit 633ec719d5
No known key found for this signature in database

View file

@ -405,20 +405,6 @@ static void ascii_to_unicode_le(unsigned char *dest, const char *src,
}
}
#ifndef USE_WINDOWS_SSPI
static void ascii_uppercase_to_unicode_le(unsigned char *dest,
const char *src, size_t srclen)
{
size_t i;
for(i = 0; i < srclen; i++) {
dest[2 * i] = (unsigned char)(Curl_raw_toupper(src[i]));
dest[2 * i + 1] = '\0';
}
}
#endif /* !USE_WINDOWS_SSPI */
/*
* Set up nt hashed passwords
* @unittest: 1600
@ -502,6 +488,16 @@ static void time2filetime(struct ms_filetime *ft, time_t t)
#endif
}
static void ascii_uppercase_to_unicode_le(unsigned char *dest,
const char *src, size_t srclen)
{
size_t i;
for(i = 0; i < srclen; i++) {
dest[2 * i] = (unsigned char)(Curl_raw_toupper(src[i]));
dest[2 * i + 1] = '\0';
}
}
/* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode
* (uppercase UserName + Domain) as the data
*/