summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-12 21:46:19 -0400
committerAttila Molnar <attilamolnar@hush.com>2014-04-13 16:07:58 +0200
commit88dccdd5f04e9244323de0eb197590ab8e7292fd (patch)
tree27a9d4e71ebec0a58072ce68a90ba0d295ae4d14 /src/modules/extra
parent6d075c9c2ba9c71223c51357751cbead87fb71d3 (diff)
Change Windows libraries to be dynamically linked
Diffstat (limited to 'src/modules/extra')
-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
5 files changed, 23 insertions, 22 deletions
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