summaryrefslogtreecommitdiff
path: root/lib/curl_sspi.c
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2012-04-15 04:12:26 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-06-11 19:00:35 +0200
commit7047e2ed725d24f7fe4ce7c566ef0a9342e3be9c (patch)
treead5381e1012ce358089bb9b6dc932034cc6989f1 /lib/curl_sspi.c
parentc1311c2b8f34c352d771f1d5810e64141aa802b1 (diff)
downloadgnurl-7047e2ed725d24f7fe4ce7c566ef0a9342e3be9c.tar.gz
gnurl-7047e2ed725d24f7fe4ce7c566ef0a9342e3be9c.tar.bz2
gnurl-7047e2ed725d24f7fe4ce7c566ef0a9342e3be9c.zip
schannel: Code cleanup and bug fixes
curl_sspi.c: Fixed mingw32-gcc compiler warnings curl_sspi.c: Fixed length of error code hex output The hex value was printed as signed 64-bit value on 64-bit systems: SEC_E_WRONG_PRINCIPAL (0xFFFFFFFF80090322) It is now correctly printed as the following: SEC_E_WRONG_PRINCIPAL (0x80090322) curl_sspi.c: Fallback to security function table version number Instead of reporting an unknown version, the interface version is used. curl_sspi.c: Removed SSPI/ version prefix from Curl_sspi_version curl_schannel: Replaced static buffer sizes with defined names curl_schannel.c: First brace when declaring functions on column 0 curl_schannel.c: Put the pointer sign directly at variable name curl_schannel.c: Use structs directly instead of typedef'ed structs curl_schannel.c: Removed space before opening brace curl_schannel.c: Fixed lines being longer than 80 chars
Diffstat (limited to 'lib/curl_sspi.c')
-rw-r--r--lib/curl_sspi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c
index d3533a293..29f8a436d 100644
--- a/lib/curl_sspi.c
+++ b/lib/curl_sspi.c
@@ -133,6 +133,7 @@ Curl_sspi_version()
LPTSTR path = NULL;
LPVOID data = NULL;
DWORD size, handle;
+ UINT length;
if(s_hSecDll) {
path = malloc(MAX_PATH);
@@ -143,8 +144,8 @@ Curl_sspi_version()
data = malloc(size);
if(data) {
if(GetFileVersionInfo(path, handle, size, data)) {
- if(VerQueryValue(data, "\\", &version_info, &handle)) {
- version = curl_maprintf("SSPI/%d.%d.%d.%d",
+ if(VerQueryValue(data, "\\", (LPVOID*)&version_info, &length)) {
+ version = curl_maprintf("%d.%d.%d.%d",
(version_info->dwProductVersionMS>>16)&0xffff,
(version_info->dwProductVersionMS>>0)&0xffff,
(version_info->dwProductVersionLS>>16)&0xffff,
@@ -158,7 +159,7 @@ Curl_sspi_version()
free(path);
}
if(!version)
- version = strdup("SSPI/Unknown");
+ version = curl_maprintf("%d", s_pSecFn ? s_pSecFn->dwVersion : 0);
}
if(!version)
@@ -265,7 +266,8 @@ Curl_sspi_status(SECURITY_STATUS status)
status_const = "Unknown error";
}
- return curl_maprintf("%s (0x%08X)", status_const, status);
+ return curl_maprintf("%s (0x%04X%04X)", status_const,
+ (status>>16)&0xffff, status&0xffff);
}