X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sasl.cpp;h=f8d8c5322d26788da4d6aae37bf3a478c5a39010;hb=dc4c8c85f383567aef9325a08515c9890bd89ab8;hp=72d547c7c2b2a79f3d3a62c4f9adc416a88c6441;hpb=8cb1935360087b4e38802b837981e5f41e9b87d7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 72d547c7c..f8d8c5322 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -1,20 +1,28 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2008 Craig Edwards * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" #include "m_cap.h" #include "account.h" #include "sasl.h" +#include "ssl.h" /* $ModDesc: Provides support for IRC Authentication Layer (aka: atheme SASL) via AUTHENTICATE. */ @@ -55,6 +63,15 @@ class SaslAuthenticator params.push_back("S"); params.push_back(method); + if (method == "EXTERNAL" && IS_LOCAL(user_)) + { + SocketCertificateRequest req(&((LocalUser*)user_)->eh, ServerInstance->Modules->Find("m_sasl.so")); + std::string fp = req.GetFingerprint(); + + if (fp.size()) + params.push_back(fp); + } + SendSASL(params); } @@ -201,7 +218,7 @@ class CommandSASL : public Command CmdResult Handle(const std::vector& parameters, User *user) { User* target = ServerInstance->FindNick(parameters[1]); - if (!target) + if ((!target) || (IS_SERVER(target))) { ServerInstance->Logs->Log("m_sasl", DEBUG,"User not found in sasl ENCAP event: %s", parameters[1].c_str()); return CMD_FAILURE; @@ -242,7 +259,7 @@ class ModuleSASL : public Module { OnRehash(NULL); Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 3); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); ServiceProvider* providelist[] = { &auth, &sasl, &authExt }; ServerInstance->Modules->AddServices(providelist, 3);