schannel: deduplicate Windows Vista detection

curl detects Vista as part of its global initialization. Use that result
instead of detecting it again in Schannel, to save some cycles and API
calls.

Follow-up to 46e97b10ba #16400
Closes #16408
This commit is contained in:
Viktor Szakats 2025-02-20 17:46:57 +01:00
parent 5693e3fa88
commit 540d341b38
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -53,6 +53,7 @@
#include "x509asn1.h" #include "x509asn1.h"
#include "curl_printf.h" #include "curl_printf.h"
#include "multiif.h" #include "multiif.h"
#include "system_win32.h"
#include "version_win32.h" #include "version_win32.h"
#include "rand.h" #include "rand.h"
#include "strparse.h" #include "strparse.h"
@ -651,8 +652,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
else else
pszPassword[0] = 0; pszPassword[0] = 0;
if(curlx_verify_windows_version(6, 0, 0, PLATFORM_WINNT, if(Curl_isVistaOrGreater)
VERSION_GREATER_THAN_EQUAL))
cert_store = PFXImportCertStore(&datablob, pszPassword, cert_store = PFXImportCertStore(&datablob, pszPassword,
PKCS12_NO_PERSIST_KEY); PKCS12_NO_PERSIST_KEY);
else else