From: Peter Powell Date: Wed, 2 Sep 2015 03:51:28 +0000 (+0100) Subject: Update another password check to use InspIRCd::TimingSafeCompare. X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=8c90682adc3c67b0779db4f57686e4c10778a36d;hp=-c;p=user%2Fhenk%2Fcode%2Finspircd.git Update another password check to use InspIRCd::TimingSafeCompare. --- 8c90682adc3c67b0779db4f57686e4c10778a36d diff --git a/src/channels.cpp b/src/channels.cpp index f79b5b89f..d99a57723 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -241,7 +241,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co if (!ckey.empty()) { FIRST_MOD_RESULT(OnCheckKey, MOD_RESULT, (user, chan, key)); - if (!MOD_RESULT.check((ckey == key) || can_bypass)) + if (!MOD_RESULT.check(InspIRCd::TimingSafeCompare(ckey, key) || can_bypass)) { // If no key provided, or key is not the right one, and can't bypass +k (not invited or option not enabled) user->WriteNumeric(ERR_BADCHANNELKEY, "%s :Cannot join channel (Incorrect channel key)", chan->name.c_str());