summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_oper_cert.cpp
diff options
context:
space:
mode:
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-27 00:12:11 +0000
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-27 00:12:11 +0000
commit20bea3078d67a090ebcca64bf3cdbd7e6ab6adb6 (patch)
tree154357b8fdc476393e110ac48686a1160b508058 /src/modules/extra/m_ssl_oper_cert.cpp
parent5773bcf973708ee2d9b0eca42fd0f8076a93f4c9 (diff)
Change API OnOperCompare to OnPassCompare, password hashing is now available for <connect:allow>, <power die= restart=>, <title> (m_customtitle.so), <vhost> (m_vhost.so), this works the same was as for <oper>: load m_password_hash.so (after all hasher modules, of course), and add hash="md5/sha256/whatever" to the relevant tag. Also fix m_callerid.cpp crashing on unload.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8755 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_ssl_oper_cert.cpp')
-rw-r--r--src/modules/extra/m_ssl_oper_cert.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp
index 074a75713..f82537c95 100644
--- a/src/modules/extra/m_ssl_oper_cert.cpp
+++ b/src/modules/extra/m_ssl_oper_cert.cpp
@@ -112,7 +112,6 @@ class ModuleOperSSLCert : public Module
return false;
}
-
virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
{
irc::string cmd = command.c_str();
@@ -125,6 +124,7 @@ class ModuleOperSSLCert : public Module
std::string Password;
std::string OperType;
std::string HostName;
+ std::string HashType;
std::string FingerPrint;
bool SSLOnly;
char* dummy;
@@ -140,12 +140,13 @@ class ModuleOperSSLCert : public Module
Password = cf->ReadValue("oper", "password", i);
OperType = cf->ReadValue("oper", "type", i);
HostName = cf->ReadValue("oper", "host", i);
+ HashType = cf->ReadValue("oper", "hash", i);
FingerPrint = cf->ReadValue("oper", "fingerprint", i);
SSLOnly = cf->ReadFlag("oper", "sslonly", i);
if (SSLOnly || !FingerPrint.empty())
{
- if ((!strcmp(LoginName.c_str(),parameters[0])) && (!ServerInstance->OperPassCompare(Password.c_str(),parameters[1],i)) && (OneOfMatches(TheHost,TheIP,HostName.c_str())))
+ if ((!strcmp(LoginName.c_str(),parameters[0])) && (!ServerInstance->PassCompare(user, Password.c_str(),parameters[1], HashType.c_str())) && (OneOfMatches(TheHost,TheIP,HostName.c_str())))
{
if (SSLOnly && !user->GetExt("ssl", dummy))
{