#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. */
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);
}
CmdResult Handle(const std::vector<std::string>& 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;
{
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);