mirror of
https://github.com/curl/curl.git
synced 2025-09-17 09:32:48 +03:00
schannel: preserve original certificate path parameter
Fixes #3480 Closes #3487
This commit is contained in:
parent
458e898911
commit
ce6f73b912
|
@ -356,6 +356,7 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path,
|
||||||
TCHAR **thumbprint)
|
TCHAR **thumbprint)
|
||||||
{
|
{
|
||||||
TCHAR *sep;
|
TCHAR *sep;
|
||||||
|
TCHAR *store_path_start;
|
||||||
size_t store_name_len;
|
size_t store_name_len;
|
||||||
|
|
||||||
sep = _tcschr(path, TEXT('\\'));
|
sep = _tcschr(path, TEXT('\\'));
|
||||||
|
@ -386,13 +387,17 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path,
|
||||||
else
|
else
|
||||||
return CURLE_SSL_CERTPROBLEM;
|
return CURLE_SSL_CERTPROBLEM;
|
||||||
|
|
||||||
*store_path = sep + 1;
|
store_path_start = sep + 1;
|
||||||
|
|
||||||
sep = _tcschr(*store_path, TEXT('\\'));
|
sep = _tcschr(store_path_start, TEXT('\\'));
|
||||||
if(sep == NULL)
|
if(sep == NULL)
|
||||||
return CURLE_SSL_CERTPROBLEM;
|
return CURLE_SSL_CERTPROBLEM;
|
||||||
|
|
||||||
*sep = 0;
|
*sep = TEXT('\0');
|
||||||
|
*store_path = _tcsdup(store_path_start);
|
||||||
|
*sep = TEXT('\\');
|
||||||
|
if(*store_path == NULL)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
*thumbprint = sep + 1;
|
*thumbprint = sep + 1;
|
||||||
if(_tcslen(*thumbprint) != CERT_THUMBPRINT_STR_LEN)
|
if(_tcslen(*thumbprint) != CERT_THUMBPRINT_STR_LEN)
|
||||||
|
@ -608,9 +613,11 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
|
||||||
failf(data, "schannel: Failed to open cert store %x %s, "
|
failf(data, "schannel: Failed to open cert store %x %s, "
|
||||||
"last error is %x",
|
"last error is %x",
|
||||||
cert_store_name, cert_store_path, GetLastError());
|
cert_store_name, cert_store_path, GetLastError());
|
||||||
|
free(cert_store_path);
|
||||||
Curl_unicodefree(cert_path);
|
Curl_unicodefree(cert_path);
|
||||||
return CURLE_SSL_CERTPROBLEM;
|
return CURLE_SSL_CERTPROBLEM;
|
||||||
}
|
}
|
||||||
|
free(cert_store_path);
|
||||||
|
|
||||||
cert_thumbprint.pbData = cert_thumbprint_data;
|
cert_thumbprint.pbData = cert_thumbprint_data;
|
||||||
cert_thumbprint.cbData = CERT_THUMBPRINT_DATA_LEN;
|
cert_thumbprint.cbData = CERT_THUMBPRINT_DATA_LEN;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user