aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2012-06-11 08:36:48 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-06-11 19:00:36 +0200
commit634f7cfee40d4658bc19dc9f23b5628c644c1848 (patch)
tree162b2683d4659ad859daf43e99d2cec813056275
parent70d56bfe3cf2ae995ca715518c78f455c45ab95b (diff)
version: Replaced SSPI feature information with version string details
Added Windows SSPI version information to the curl version string when SCHANNEL SSL is not enabled, as the version of the library should also be included when SSPI is used to generate security contexts. Removed SSPI from the feature list as the features are GSS-Negotiate, NTLM and SSL depending on the usage of the SSPI library.
-rw-r--r--include/curl/curl.h2
-rw-r--r--lib/version.c28
-rw-r--r--src/tool_getparam.c1
3 files changed, 23 insertions, 8 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 2cad28298..2c743b454 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -2144,7 +2144,7 @@ typedef struct {
#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */
#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
-#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
+#define CURL_VERSION_OBSOLETE11 (1<<11) /* NOT USED - removed in 7.27.0 */
#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
diff --git a/lib/version.c b/lib/version.c
index c56ad3962..2a2c5c0d2 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -64,10 +64,16 @@
char *curl_version(void)
{
static char version[200];
- char *ptr=version;
+ char *ptr = version;
size_t len;
size_t left = sizeof(version);
- strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION );
+#ifdef USE_WINDOWS_SSPI
+#ifndef USE_SCHANNEL
+ int sspi_major = 0, sspi_minor = 0, sspi_build = 0;
+#endif
+#endif
+
+ strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION);
len = strlen(ptr);
left -= len;
ptr += len;
@@ -82,6 +88,19 @@ char *curl_version(void)
}
}
+#ifdef USE_WINDOWS_SSPI
+#ifndef USE_SCHANNEL
+ if(CURLE_OK == Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build,
+ NULL))
+ len = snprintf(ptr, left, " WinSSPI/%d.%d.%d", sspi_major, sspi_minor,
+ sspi_build);
+ else
+ len = snprintf(ptr, left, " WinSSPI/unknown");
+
+ left -= len;
+ ptr += len;
+#endif
+#endif
#ifdef HAVE_LIBZ
len = snprintf(ptr, left, " zlib/%s", zlibVersion());
left -= len;
@@ -243,9 +262,6 @@ static curl_version_info_data version_info = {
#if defined(USE_NTLM) && defined(NTLM_WB_ENABLED)
| CURL_VERSION_NTLM_WB
#endif
-#ifdef USE_WINDOWS_SSPI
- | CURL_VERSION_SSPI
-#endif
#ifdef HAVE_LIBZ
| CURL_VERSION_LIBZ
#endif
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index ab8ed1d5e..fb42d0acc 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -277,7 +277,6 @@ static const struct feat feats[] = {
{"NTLM_WB", CURL_VERSION_NTLM_WB},
{"SPNEGO", CURL_VERSION_SPNEGO},
{"SSL", CURL_VERSION_SSL},
- {"SSPI", CURL_VERSION_SSPI},
{"krb4", CURL_VERSION_KERBEROS4},
{"libz", CURL_VERSION_LIBZ},
{"CharConv", CURL_VERSION_CONV},