1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 03:53:12 +02:00

Automatically add client certificates to the cert list on register.

This commit is contained in:
Sadie Powell
2024-05-01 17:18:22 +01:00
parent 111f81aa95
commit be3822523b
2 changed files with 15 additions and 0 deletions
+6
View File
@@ -286,6 +286,12 @@ module
{
name = "ns_cert"
/*
* Should users who are connected with a SSL client certificate have its fingerprint be added to
* their account when they register. Defaults to yes.
*/
automatic = yes
/*
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
+9
View File
@@ -405,6 +405,15 @@ public:
Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint";
}
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
{
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || u->fingerprint.empty())
return;
auto *cl = certs.Require(na->nc);
cl->AddCert(u->fingerprint);
}
EventReturn OnNickValidate(User *u, NickAlias *na) override
{
NSCertList *cl = certs.Get(na->nc);