summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp5
-rw-r--r--src/coremods/core_user/cmd_user.cpp12
-rw-r--r--src/inspircd.cpp6
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp5
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp16
5 files changed, 16 insertions, 28 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 1151fe0a5..118a413a8 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -402,7 +402,10 @@ ModResult Channel::GetExtBanStatus(User *user, char type)
{
for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); ++it)
{
- if (CheckBan(user, it->mask))
+ if (it->mask[0] != type || it->mask[1] != ':')
+ continue;
+
+ if (CheckBan(user, it->mask.substr(2)))
return MOD_RES_DENY;
}
}
diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp
index 8bf34665d..c4cdd9b37 100644
--- a/src/coremods/core_user/cmd_user.cpp
+++ b/src/coremods/core_user/cmd_user.cpp
@@ -21,6 +21,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From ircu.
+ ERR_INVALIDUSERNAME = 468
+};
+
CommandUser::CommandUser(Module* parent)
: SplitCommand(parent, "USER", 4, 4)
{
@@ -36,11 +42,7 @@ CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, L
{
if (!ServerInstance->IsIdent(parameters[0]))
{
- /*
- * RFC says we must use this numeric, so we do. Let's make it a little more nub friendly though. :)
- * -- Craig, and then w00t.
- */
- user->WriteNumeric(ERR_NEEDMOREPARAMS, name, "Your username is not valid");
+ user->WriteNumeric(ERR_INVALIDUSERNAME, name, "Your username is not valid");
return CMD_FAILURE;
}
else
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index d7b616ecc..0068a6fee 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -35,12 +35,6 @@
#include <sys/resource.h>
#include <dlfcn.h>
#include <getopt.h>
-
- /* Some systems don't define RUSAGE_SELF. This should fix them. */
- #ifndef RUSAGE_SELF
- #define RUSAGE_SELF 0
- #endif
-
#include <pwd.h> // setuid
#include <grp.h> // setgid
#else
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 97fdf504c..56b60de26 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -79,11 +79,6 @@
#define GNUTLS_NEW_PRIO_API
#endif
-#if (!INSPIRCD_GNUTLS_HAS_VERSION(2, 0, 0))
-typedef gnutls_certificate_credentials_t gnutls_certificate_credentials;
-typedef gnutls_dh_params_t gnutls_dh_params;
-#endif
-
enum issl_status { ISSL_NONE, ISSL_HANDSHAKING, ISSL_HANDSHAKEN };
#if INSPIRCD_GNUTLS_HAS_VERSION(2, 12, 0)
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index ae5e213b7..d203ad2f3 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -54,11 +54,6 @@
# pragma comment(lib, "libeay32.lib")
#endif
-#if ((OPENSSL_VERSION_NUMBER >= 0x10000000L) && (!(defined(OPENSSL_NO_ECDH))))
-// OpenSSL 0.9.8 includes some ECC support, but it's unfinished. Enable only for 1.0.0 and later.
-#define INSPIRCD_OPENSSL_ENABLE_ECDH
-#endif
-
// BIO is opaque in OpenSSL 1.1 but the access API does not exist in 1.0 and older.
#if ((defined LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x10100000L))
# define BIO_get_data(BIO) BIO->ptr
@@ -130,7 +125,7 @@ namespace OpenSSL
{
// Sane default options for OpenSSL see https://www.openssl.org/docs/ssl/SSL_CTX_set_options.html
// and when choosing a cipher, use the server's preferences instead of the client preferences.
- long opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_SINGLE_DH_USE;
+ long opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_SINGLE_DH_USE;
// Only turn options on if they exist
#ifdef SSL_OP_SINGLE_ECDH_USE
opts |= SSL_OP_SINGLE_ECDH_USE;
@@ -162,7 +157,7 @@ namespace OpenSSL
return (SSL_CTX_set_tmp_dh(ctx, dh.get()) >= 0);
}
-#ifdef INSPIRCD_OPENSSL_ENABLE_ECDH
+#ifndef OPENSSL_NO_ECDH
void SetECDH(const std::string& curvename)
{
int nid = OBJ_sn2nid(curvename.c_str());
@@ -291,9 +286,8 @@ namespace OpenSSL
if (!tag->getBool("compression", false)) // Disable compression by default
setoptions |= SSL_OP_NO_COMPRESSION;
#endif
- if (!tag->getBool("sslv3", false)) // Disable SSLv3 by default
- setoptions |= SSL_OP_NO_SSLv3;
- if (!tag->getBool("tlsv1", true))
+ // Disable TLSv1.0 by default.
+ if (!tag->getBool("tlsv1", false))
setoptions |= SSL_OP_NO_TLSv1;
if (!setoptions && !clearoptions)
@@ -331,7 +325,7 @@ namespace OpenSSL
}
}
-#ifdef INSPIRCD_OPENSSL_ENABLE_ECDH
+#ifndef OPENSSL_NO_ECDH
std::string curvename = tag->getString("ecdhcurve", "prime256v1");
if (!curvename.empty())
ctx.SetECDH(curvename);