schannel: remove version number and identify its use with 'schannel' literal

Version number is removed in order to make this info consistent with
how we do it with other MS and Linux system libraries for which we don't
provide this info.

Identifier changed from 'WinSSPI' to 'schannel' given that this is the
actual provider of the SSL/TLS support. libcurl can still be built with
SSPI and without SCHANNEL support.
This commit is contained in:
Yang Tse 2012-06-13 15:53:51 +02:00
Родитель c13af84372
Коммит 819afe46ee
13 изменённых файлов: 23 добавлений и 133 удалений

Просмотреть файл

@ -18,7 +18,6 @@ This release includes the following changes:
o pop3: Added support for sasl digest-md5 authentication
o pop3: Added support for apop authentication
o sspi: Added support for Schannel SSL/TLS encryption
o sspi: Changed curl version information output
This release includes the following bugfixes:

Просмотреть файл

@ -3044,7 +3044,6 @@ AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
AC_SUBST(USE_WINDOWS_SSPI, [1])
curl_sspi_msg="enabled"
LIBS="$LIBS -lversion"
else
AC_MSG_RESULT(no)
AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])

Просмотреть файл

@ -125,7 +125,7 @@ FILE
FOOTNOTES
=========
*1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL or Windows SSPI
*1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL or schannel
*2 = requires OpenLDAP
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
*4 = requires FBopenssl

Просмотреть файл

@ -185,7 +185,6 @@ endif
endif
ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI
DLL_LIBS += -lversion
ifdef SCHANNEL
CFLAGS += -DUSE_SCHANNEL
endif

Просмотреть файл

@ -123,7 +123,6 @@ CFGSET = FALSE
!IFDEF WINDOWS_SSPI
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!IFDEF USE_IPV6

Просмотреть файл

@ -54,9 +54,12 @@
#include "setup.h"
#ifdef USE_WINDOWS_SSPI
#ifdef USE_SCHANNEL
#ifndef USE_WINDOWS_SSPI
# error "Can't compile SCHANNEL support without SSPI."
#endif
#include "curl_sspi.h"
#include "curl_schannel.h"
#include "sslgen.h"
@ -974,16 +977,9 @@ void Curl_schannel_cleanup()
size_t Curl_schannel_version(char *buffer, size_t size)
{
int sspi_major = 0, sspi_minor = 0, sspi_build = 0;
if(!Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build, NULL))
size = snprintf(buffer, size, "WinSSPI/%d.%d.%d", sspi_major, sspi_minor,
sspi_build);
else
size = snprintf(buffer, size, "WinSSPI/unknown");
size = snprintf(buffer, size, "schannel");
return size;
}
#endif /* USE_SCHANNEL */
#endif /* USE_WINDOWS_SSPI */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef HEADER_SCHANNEL_H
#define HEADER_SCHANNEL_H
#ifndef HEADER_CURL_SCHANNEL_H
#define HEADER_CURL_SCHANNEL_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@ -8,6 +8,7 @@
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2012, Marc Hoersken, <info@marc-hoersken.de>, et al.
* Copyright (C) 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
@ -23,7 +24,6 @@
***************************************************************************/
#include "setup.h"
#ifdef USE_WINDOWS_SSPI
#ifdef USE_SCHANNEL
#include "urldata.h"
@ -129,5 +129,4 @@ size_t Curl_schannel_version(char *buffer, size_t size);
#define curlssl_data_pending Curl_schannel_data_pending
#endif /* USE_SCHANNEL */
#endif /* USE_WINDOWS_SSPI */
#endif /* HEADER_SCHANNEL_H */
#endif /* HEADER_CURL_SCHANNEL_H */

Просмотреть файл

@ -112,67 +112,4 @@ void Curl_sspi_global_cleanup(void)
}
}
/*
* Curl_sspi_version()
*
* This function returns the SSPI library version information.
*/
CURLcode Curl_sspi_version(int *major, int *minor, int *build, int *special)
{
CURLcode result = CURLE_OK;
VS_FIXEDFILEINFO *version_info = NULL;
LPTSTR path = NULL;
LPVOID data = NULL;
DWORD size, handle;
UINT length;
if(!s_hSecDll)
return CURLE_FAILED_INIT;
path = (char *) malloc(MAX_PATH);
if(!path)
return CURLE_OUT_OF_MEMORY;
if(GetModuleFileName(s_hSecDll, path, MAX_PATH)) {
size = GetFileVersionInfoSize(path, &handle);
if(size) {
data = malloc(size);
if(data) {
if(GetFileVersionInfo(path, handle, size, data)) {
if(!VerQueryValue(data, "\\", (LPVOID*) &version_info, &length))
result = CURLE_OUT_OF_MEMORY;
}
else
result = CURLE_OUT_OF_MEMORY;
}
else
result = CURLE_OUT_OF_MEMORY;
}
else
result = CURLE_OUT_OF_MEMORY;
}
else
result = CURLE_OUT_OF_MEMORY;
/* Set the out parameters */
if(!result) {
if(major)
*major = (version_info->dwProductVersionMS >> 16) & 0xffff;
if(minor)
*minor = (version_info->dwProductVersionMS >> 0) & 0xffff;
if(build)
*build = (version_info->dwProductVersionLS >> 16) & 0xffff;
if(special)
*special = (version_info->dwProductVersionLS >> 0) & 0xffff;
}
Curl_safefree(data);
Curl_safefree(path);
return result;
}
#endif /* USE_WINDOWS_SSPI */

Просмотреть файл

@ -42,7 +42,6 @@
CURLcode Curl_sspi_global_init(void);
void Curl_sspi_global_cleanup(void);
CURLcode Curl_sspi_version(int *major, int *minor, int *build, int *special);
/* Forward-declaration of global variables defined in curl_sspi.c */

Просмотреть файл

@ -67,11 +67,6 @@ char *curl_version(void)
char *ptr = version;
size_t len;
size_t left = sizeof(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);
@ -88,19 +83,6 @@ 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;

Просмотреть файл

@ -194,7 +194,6 @@ ifdef METALINK
endif
ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI
curl_LDADD += -lversion
ifdef SCHANNEL
CFLAGS += -DUSE_SCHANNEL
endif

Просмотреть файл

@ -101,8 +101,6 @@ SSL_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32"
SSL_IMP_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32dll"
SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib advapi32.lib
WINLIBS = ws2_32.lib wldap32.lib
# Runtime library configuration
RTLIB = /MD
RTLIBD = /MDd
@ -229,9 +227,6 @@ DEBUG_OBJS= \
CFLAGS = $(CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
#################################################
# release dynamic library
@ -249,9 +244,6 @@ CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(ZLIB_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(ZLIB_LIBS)
LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -262,9 +254,6 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS)
LFLAGS = $(LFLAGS) $(SSL_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -285,9 +274,6 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS) $(ZLIB_LIBS)
LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -298,9 +284,6 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS)
LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -311,9 +294,6 @@ CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(ZLIB_IMP_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(ZLIB_IMP_LIBS)
LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -334,9 +314,6 @@ CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS)
LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS) $(ZLIB_IMP_LIBS)
LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS)
!IFDEF WINDOWS_SSPI
WINLIBS = $(WINLIBS) version.lib
!ENDIF
!ENDIF
#################################################
@ -350,8 +327,8 @@ LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS)
!ENDIF
LINKLIBS = $(LINKLIBS) $(WINLIBS)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(WINLIBS)
LINKLIBS = $(LINKLIBS) ws2_32.lib wldap32.lib
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) ws2_32.lib wldap32.lib
all : release

Просмотреть файл

@ -143,17 +143,19 @@ SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(WITH_DEVEL)/include/libssh2
!ENDIF
!IFNDEF USE_SSL
CFLAGS_SSPI = /DUSE_SCHANNEL
USE_SCHANNEL = true
USE_SSPI = yes
!ENDIF
!IFNDEF USE_SSPI
USE_SSPI = yes
!ENDIF
!IF "$(USE_SSPI)"=="yes"
CFLAGS_SSPI = /DUSE_WINDOWS_SSPI
LFLAGS_SSPI = version.lib
CFLAGS_SSPI = $(CFLAGS_SSPI) /DUSE_WINDOWS_SSPI
USE_SSPI = true
!IFNDEF USE_SSL
CFLAGS_SSPI = $(CFLAGS_SSPI) /DUSE_SCHANNEL
!ENDIF
!ENDIF
@ -296,9 +298,12 @@ CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
!IF "$(USE_SSPI)"=="true"
CFLAGS = $(CFLAGS) $(CFLAGS_SSPI)
LFLAGS = $(LFLAGS) $(LFLAGS_SSPI)
!IF "$(USE_SCHANNEL)"=="true"
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi-schannel
!ELSE
CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
!ENDIF
!ENDIF
!IF "$(GEN_PDB)"=="true"
CFLAGS = $(CFLAGS) $(CFLAGS_PDB)