summaryrefslogtreecommitdiff
path: root/modules/extra/m_sasl_dh-blowfish.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-01-05 16:31:09 -0500
committerAdam <Adam@anope.org>2015-01-05 19:00:51 -0500
commitd79d8e2608e304760c42bdf87502e3bc51781b88 (patch)
tree179913b8b328f88d52d84c3453fceb28a2d63422 /modules/extra/m_sasl_dh-blowfish.cpp
parent8ab1c71d7dc7a0d47e5711dc72e3fc9c3ee850bb (diff)
parentc46ec39e5088119cd21f5f7e16e64e61a876ca20 (diff)
Merge branch '2.0' into 2.1
Conflicts: CMakeLists.txt include/modules.h include/serialize.h modules/commands/bs_assign.cpp modules/commands/bs_badwords.cpp modules/commands/bs_bot.cpp modules/commands/bs_control.cpp modules/commands/bs_kick.cpp modules/commands/cs_access.cpp modules/commands/cs_akick.cpp modules/commands/cs_drop.cpp modules/commands/cs_entrymsg.cpp modules/commands/cs_flags.cpp modules/commands/cs_info.cpp modules/commands/cs_invite.cpp modules/commands/cs_kick.cpp modules/commands/cs_mode.cpp modules/commands/cs_register.cpp modules/commands/cs_seen.cpp modules/commands/cs_set.cpp modules/commands/cs_suspend.cpp modules/commands/cs_topic.cpp modules/commands/cs_unban.cpp modules/commands/cs_xop.cpp modules/commands/hs_del.cpp modules/commands/hs_list.cpp modules/commands/hs_request.cpp modules/commands/ms_ignore.cpp modules/commands/ms_send.cpp modules/commands/ns_recover.cpp modules/commands/ns_register.cpp modules/commands/ns_suspend.cpp modules/commands/os_dns.cpp modules/commands/os_noop.cpp modules/commands/os_oper.cpp modules/commands/os_session.cpp modules/database/db_sql_live.cpp modules/encryption/enc_bcrypt.cpp modules/extra/m_ldap_authentication.cpp modules/extra/m_ldap_oper.cpp modules/fantasy.cpp modules/m_dnsbl.cpp modules/m_sasl.cpp modules/protocol/hybrid.cpp modules/protocol/inspircd20.cpp modules/protocol/unreal.cpp modules/pseudoclients/chanserv.cpp modules/pseudoclients/nickserv.cpp modules/webcpanel/pages/chanserv/access.cpp modules/webcpanel/webcpanel.cpp modules/webcpanel/webcpanel.h src/command.cpp src/messages.cpp src/modulemanager.cpp src/regchannel.cpp src/serialize.cpp
Diffstat (limited to 'modules/extra/m_sasl_dh-blowfish.cpp')
-rw-r--r--modules/extra/m_sasl_dh-blowfish.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/extra/m_sasl_dh-blowfish.cpp b/modules/extra/m_sasl_dh-blowfish.cpp
index bd0fb97db..f6e4b27b3 100644
--- a/modules/extra/m_sasl_dh-blowfish.cpp
+++ b/modules/extra/m_sasl_dh-blowfish.cpp
@@ -152,7 +152,7 @@ class DHBS : public Mechanism
const Anope::string username = reinterpret_cast<const char*>(&data[pos]);
// Check that the username is valid, and that we have at least one block of data
// 2 + 1 + 8 = uint16_t size for keylen, \0 for username, 8 for one block of data
- if (username.empty() || username.length() + keysize + 2 + 1 + 8 > decodedlen)
+ if (username.empty() || username.length() + keysize + 2 + 1 + 8 > decodedlen || !IRCD->IsNickValid(username))
return Err(sess, pubkey);
pos += username.length() + 1;
@@ -167,7 +167,7 @@ class DHBS : public Mechanism
BF_ecb_encrypt(&data[pos + i], reinterpret_cast<unsigned char*>(&decrypted[i]), &BFKey, BF_DECRYPT);
std::string password = &decrypted[0];
- if (password.empty())
+ if (password.empty() || password.find_first_of("\r\n") != Anope::string::npos)
return Err(sess, pubkey);
SASL::IdentifyRequest* req = new SASL::IdentifyRequest(this->owner, m.source, username, password);