X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sasl.cpp;h=f8d8c5322d26788da4d6aae37bf3a478c5a39010;hb=3f782d5cad84165d695203977c75d2a3877f4644;hp=b653096b24566361685e7acafe391a4362bbf1db;hpb=553a8da754c8cd308bad2008018849714e70f9b7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index b653096b2..f8d8c5322 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -22,6 +22,7 @@ #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. */ @@ -62,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); } @@ -208,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; @@ -249,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);