summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/caller.h18
-rw-r--r--include/modules.h2
-rw-r--r--src/modules/extra/m_ldapauth.cpp4
-rw-r--r--src/modules/extra/m_ldapoper.cpp4
-rw-r--r--src/modules/extra/m_mysql.cpp4
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp24
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp9
-rw-r--r--win/CMakeLists.txt2
-rw-r--r--win/inspircd_win32wrapper.h2
9 files changed, 36 insertions, 33 deletions
diff --git a/include/caller.h b/include/caller.h
index 64b37611f..05049df8b 100644
--- a/include/caller.h
+++ b/include/caller.h
@@ -136,7 +136,7 @@ template <typename ReturnType> class CoreExport caller0 : public caller< Handler
: caller< HandlerBase0<ReturnType> >::caller(initial)
{ }
- virtual ReturnType operator() ()
+ ReturnType operator() ()
{
return this->target->Call();
}
@@ -149,7 +149,7 @@ template <typename ReturnType, typename Param1> class CoreExport caller1 : publi
: caller< HandlerBase1<ReturnType, Param1> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1)
+ ReturnType operator() (Param1 param1)
{
return this->target->Call(param1);
}
@@ -162,7 +162,7 @@ template <typename ReturnType, typename Param1, typename Param2> class CoreExpor
: caller< HandlerBase2<ReturnType, Param1, Param2> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2)
+ ReturnType operator() (Param1 param1, Param2 param2)
{
return this->target->Call(param1, param2);
}
@@ -175,7 +175,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase3<ReturnType, Param1, Param2, Param3> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3)
{
return this->target->Call(param1, param2, param3);
}
@@ -188,7 +188,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase4<ReturnType, Param1, Param2, Param3, Param4> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4)
{
return this->target->Call(param1, param2, param3, param4);
}
@@ -201,7 +201,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase5<ReturnType, Param1, Param2, Param3, Param4, Param5> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5)
{
return this->target->Call(param1, param2, param3, param4, param5);
}
@@ -214,7 +214,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase6<ReturnType, Param1, Param2, Param3, Param4, Param5, Param6> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6)
{
return this->target->Call(param1, param2, param3, param4, param5, param6);
}
@@ -227,7 +227,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase7<ReturnType, Param1, Param2, Param3, Param4, Param5, Param6, Param7> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6, Param7 param7)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6, Param7 param7)
{
return this->target->Call(param1, param2, param3, param4, param5, param6, param7);
}
@@ -240,7 +240,7 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
: caller< HandlerBase8<ReturnType, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8> >(initial)
{ }
- virtual ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6, Param7 param7, Param8 param8)
+ ReturnType operator() (Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6, Param7 param7, Param8 param8)
{
return this->target->Call(param1, param2, param3, param4, param5, param6, param7, param8);
}
diff --git a/include/modules.h b/include/modules.h
index c0d852b09..eef8c61c9 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -116,7 +116,7 @@ struct ModResult {
* and numerical comparisons in preprocessor macros if they wish to support
* multiple versions of InspIRCd in one file.
*/
-#define INSPIRCD_VERSION_API 7
+#define INSPIRCD_VERSION_API 8
/**
* This #define allows us to call a method in all
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp
index 5b3f1e7cc..6c765fb2e 100644
--- a/src/modules/extra/m_ldapauth.cpp
+++ b/src/modules/extra/m_ldapauth.cpp
@@ -31,8 +31,8 @@
#include <ldap.h>
#ifdef _WIN32
-# pragma comment(lib, "ldap.lib")
-# pragma comment(lib, "lber.lib")
+# pragma comment(lib, "libldap.lib")
+# pragma comment(lib, "liblber.lib")
#endif
/* $ModDesc: Allow/Deny connections based upon answer from LDAP server */
diff --git a/src/modules/extra/m_ldapoper.cpp b/src/modules/extra/m_ldapoper.cpp
index 53896878c..1f46361d4 100644
--- a/src/modules/extra/m_ldapoper.cpp
+++ b/src/modules/extra/m_ldapoper.cpp
@@ -28,8 +28,8 @@
#include <ldap.h>
#ifdef _WIN32
-# pragma comment(lib, "ldap.lib")
-# pragma comment(lib, "lber.lib")
+# pragma comment(lib, "libldap.lib")
+# pragma comment(lib, "liblber.lib")
#endif
/* $ModDesc: Adds the ability to authenticate opers via LDAP */
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 22cf5f3f4..01b1553b0 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -28,9 +28,7 @@
#include "sql.h"
#ifdef _WIN32
-# pragma comment(lib, "mysqlclient.lib")
-# pragma comment(lib, "advapi32.lib")
-# pragma comment(linker, "/NODEFAULTLIB:LIBCMT")
+# pragma comment(lib, "libmysql.lib")
#endif
/* VERSION 3 API: With nonblocking (threaded) requests */
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 1f1297ef9..03673d7a0 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -22,21 +22,16 @@
#include "inspircd.h"
+#ifndef _WIN32
#include <gcrypt.h>
+#endif
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "ssl.h"
#include "m_cap.h"
#ifdef _WIN32
-# pragma comment(lib, "libgnutls.lib")
-# pragma comment(lib, "libgcrypt.lib")
-# pragma comment(lib, "libgpg-error.lib")
-# pragma comment(lib, "user32.lib")
-# pragma comment(lib, "advapi32.lib")
-# pragma comment(lib, "libgcc.lib")
-# pragma comment(lib, "libmingwex.lib")
-# pragma comment(lib, "gdi32.lib")
+# pragma comment(lib, "libgnutls-28.lib")
#endif
/* $ModDesc: Provides SSL support for clients */
@@ -60,6 +55,13 @@ typedef gnutls_certificate_credentials_t gnutls_certificate_credentials;
typedef gnutls_dh_params_t gnutls_dh_params;
#endif
+#if (defined(_WIN32) && (GNUTLS_VERSION_MAJOR > 2 || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR >= 12)))
+# define GNUTLS_HAS_RND
+# include <gnutls/crypto.h>
+#else
+# include <gcrypt.h>
+#endif
+
enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED };
static std::vector<gnutls_x509_crt_t> x509_certs;
@@ -89,7 +91,11 @@ class RandGen : public HandlerBase2<void, char*, size_t>
RandGen() {}
void Call(char* buffer, size_t len)
{
+#ifdef GNUTLS_HAS_RND
+ gnutls_rnd(GNUTLS_RND_RANDOM, buffer, len);
+#else
gcry_randomize(buffer, len, GCRY_STRONG_RANDOM);
+#endif
}
};
@@ -250,7 +256,9 @@ class ModuleSSLGnuTLS : public Module
ModuleSSLGnuTLS()
: starttls(this), capHandler(this, "tls"), iohook(this, "ssl/gnutls", SERVICE_IOHOOK)
{
+#ifndef GNUTLS_HAS_RND
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+#endif
sessions = new issl_session[ServerInstance->SE->GetMaxFds()];
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 91a3d7269..60c90988a 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -36,13 +36,8 @@
#include "ssl.h"
#ifdef _WIN32
-# pragma comment(lib, "libcrypto.lib")
-# pragma comment(lib, "libssl.lib")
-# pragma comment(lib, "user32.lib")
-# pragma comment(lib, "advapi32.lib")
-# pragma comment(lib, "libgcc.lib")
-# pragma comment(lib, "libmingwex.lib")
-# pragma comment(lib, "gdi32.lib")
+# pragma comment(lib, "ssleay32.lib")
+# pragma comment(lib, "libeay32.lib")
# undef MAX_DESCRIPTORS
# define MAX_DESCRIPTORS 10000
#endif
diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt
index e6a854d99..087bd7970 100644
--- a/win/CMakeLists.txt
+++ b/win/CMakeLists.txt
@@ -99,7 +99,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_NSIS_MUI_UNIICON "${INSPIRCD_BASE}/win\\\\inspircd.ico")
set(CPACK_NSIS_INSTALLED_ICON_NAME "inspircd.exe")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.inspircd.org/")
- set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
+ set(CPACK_NSIS_COMPRESSOR "/SOLID zlib")
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h
index 75404ef8b..be437d4a3 100644
--- a/win/inspircd_win32wrapper.h
+++ b/win/inspircd_win32wrapper.h
@@ -78,6 +78,8 @@
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
+typedef int ssize_t;
+
/* Convert formatted (xxx.xxx.xxx.xxx) string to in_addr struct */
CoreExport int insp_inet_pton(int af, const char * src, void * dst);