X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ircv3_sts.cpp;h=cab671b70c5ae00830b3a5c4099fb386e25eee8d;hb=6a0155101e09ecf48858d73dab17400777cbe668;hp=9dc36df606cdda65228bd64fffb3124a9179b94e;hpb=2d36fcb16ef3209fffbe9f4b600971a1edd2ae4b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index 9dc36df60..cab671b70 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -35,6 +35,10 @@ class STSCap : public Cap::Capability if (GetProtocol(user) == Cap::CAP_LEGACY) return false; + // Don't send the cap to clients in a class which has STS disabled. + if (!user->GetClass()->config->getBool("usests", true)) + return false; + // Plaintext listeners have their own policy. SSLIOHook* sslhook = SSLIOHook::IsSSL(&user->eh); if (!sslhook) @@ -130,7 +134,7 @@ class ModuleIRCv3STS : public Module for (std::vector::const_iterator iter = ServerInstance->ports.begin(); iter != ServerInstance->ports.end(); ++iter) { ListenSocket* ls = *iter; - + // Is this listener on the right port? unsigned int saport = ls->bind_sa.port(); if (saport != port) @@ -163,7 +167,7 @@ class ModuleIRCv3STS : public Module if (host.empty()) throw ModuleException(" must contain a hostname, at " + tag->getTagLocation()); - unsigned int port = tag->getInt("port", 0, 0, UINT16_MAX); + unsigned int port = tag->getUInt("port", 0, 0, UINT16_MAX); if (!HasValidSSLPort(port)) throw ModuleException(" must be a TLS port, at " + tag->getTagLocation()); @@ -174,7 +178,7 @@ class ModuleIRCv3STS : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides IRCv3 Strict Transport Security policy advertisement", VF_OPTCOMMON); + return Version("Provides IRCv3 Strict Transport Security policy advertisement", VF_OPTCOMMON|VF_VENDOR); } };