Add --enable-unspecified_server

Add --enable-unspecified_server configure option to set to "Unspecified"
the OS name, OS version, product name and product version normally
contained in the SERVER header as this could be used by an attacker.
This commit is contained in:
Fabrice Fontaine 2012-03-30 21:52:37 +02:00
parent df27ba505f
commit 49af91fe48
6 changed files with 28 additions and 0 deletions

View File

@ -2,6 +2,14 @@
Version 1.6.17
*******************************************************************************
2012-03-30 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Add --enable-unspecified_server
Add --enable-unspecified_server configure option to set to "Unspecified"
the OS name, OS version, product name and product version normally
contained in the SERVER header as this could be used by an attacker.
2012-03-29 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Removing implicit casts in miniserver.c

View File

@ -129,6 +129,9 @@
/* see upnpconfig.h */
/* #undef UPNP_ENABLE_IPV6 */
/* see upnpconfig.h */
/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */
/* see upnpconfig.h */
#define UPNP_ENABLE_NOTIFICATION_REORDERING 1

View File

@ -128,5 +128,9 @@
* (i.e. configure --enable-ipv6) */
/* #undef UPNP_ENABLE_IPV6 */
/** Defined to 1 if the library has been compiled with unspecified SERVER
* header (i.e. configure --enable-unspecified_server) */
/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */
#endif /* UPNP_CONFIG_H */

View File

@ -434,6 +434,11 @@ if test "x$enable_ipv6" = xyes ; then
AC_DEFINE(UPNP_ENABLE_IPV6, 1, [see upnpconfig.h])
fi
RT_BOOL_ARG_ENABLE([unspecified_server], [no], [unspecified SERVER header])
if test "x$enable_unspecified_server" = xyes ; then
AC_DEFINE(UPNP_ENABLE_UNSPECIFIED_SERVER, 1, [see upnpconfig.h])
fi
RT_BOOL_ARG_ENABLE([notification_reordering], [yes], [GENA notification reordering in gena_device.c])
if test "x$enable_notification_reordering" = xyes ; then
AC_DEFINE(UPNP_ENABLE_NOTIFICATION_REORDERING, 1, [see upnpconfig.h])

View File

@ -127,5 +127,9 @@
* (i.e. configure --enable-ipv6) */
#undef UPNP_ENABLE_IPV6
/** Defined to 1 if the library has been compiled with unspecified SERVER
* header (i.e. configure --enable-unspecified_server) */
#undef UPNP_ENABLE_UNSPECIFIED_SERVER
#endif /* UPNP_CONFIG_H */

View File

@ -2118,6 +2118,9 @@ int http_OpenHttpGetEx(
/* 'info' should have a size of at least 100 bytes */
void get_sdk_info(OUT char *info, IN size_t infoSize)
{
#ifdef UPNP_ENABLE_UNSPECIFIED_SERVER
snprintf(info, infoSize, "Unspecified, UPnP/1.0, Unspecified\r\n");
#else /* UPNP_ENABLE_UNSPECIFIED_SERVER */
#ifdef WIN32
OSVERSIONINFO versioninfo;
versioninfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@ -2141,5 +2144,6 @@ void get_sdk_info(OUT char *info, IN size_t infoSize)
"%s/%s, UPnP/1.0, Portable SDK for UPnP devices/"
PACKAGE_VERSION "\r\n", sys_info.sysname, sys_info.release);
#endif
#endif /* UPNP_ENABLE_UNSPECIFIED_SERVER */
}