mirror of
https://github.com/curl/curl.git
synced 2026-07-16 06:07:16 +03:00
schannel: use Win8 CERT_NAME_SEARCH_ALL_NAMES_FLAG with old SDKs
Define `CERT_NAME_SEARCH_ALL_NAMES_FLAG` macro if missing. To allow using a runtime branch regardless of build-time SDK version, when running on Windows 8+. In practice it enables this branch for builds using mingw-w64 v3, and MSVC with Windows SDK <8. Also reducing build variations. Follow-up to29e40a6d8a#4761 #3711 Follow-up to8996300211#1325 Follow-up to172b2beba6#264 (comment) Closes #20000
This commit is contained in:
parent
5196abad73
commit
8dadff9434
1 changed files with 4 additions and 6 deletions
|
|
@ -371,10 +371,12 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
|
|||
LPTSTR current_pos = NULL;
|
||||
DWORD i;
|
||||
|
||||
/* Offered by mingw-w64 v4+. MS SDK ~10+/~VS2017+. */
|
||||
#ifdef CERT_NAME_SEARCH_ALL_NAMES_FLAG
|
||||
/* CERT_NAME_SEARCH_ALL_NAMES_FLAG is available from Windows 8 onwards. */
|
||||
if(Win8_compat) {
|
||||
/* Offered by mingw-w64 v4+. MS SDK ~10+/~VS2017+. */
|
||||
#ifndef CERT_NAME_SEARCH_ALL_NAMES_FLAG
|
||||
#define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x2
|
||||
#endif
|
||||
/* CertGetNameString will provide the 8-bit character string without
|
||||
* any decoding */
|
||||
DWORD name_flags =
|
||||
|
|
@ -387,10 +389,6 @@ static DWORD cert_get_name_string(struct Curl_easy *data,
|
|||
length);
|
||||
return actual_length;
|
||||
}
|
||||
#else
|
||||
(void)cert_context;
|
||||
(void)Win8_compat;
|
||||
#endif
|
||||
|
||||
if(!alt_name_info)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue