From a271618c60cf188eb6483f9fcfb567a434f75469 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 3 Sep 2006 22:05:54 +0000 Subject: Check for people trying to literally put the fingerprint in as a pass git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5134 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_oper_cert.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp index 0d1ab045c..cf68fe5a4 100644 --- a/src/modules/extra/m_ssl_oper_cert.cpp +++ b/src/modules/extra/m_ssl_oper_cert.cpp @@ -88,7 +88,7 @@ class ModuleOperSSLCert : public Module virtual int OnOperCompare(const std::string &data, const std::string &input) { ServerInstance->Log(DEBUG,"HasCert=%d, data='%s' input='%s'",HasCert,data.c_str(), input.c_str()); - if (((data.length()) && (data.length() == cert->GetFingerprint().length()))) + if ((HasCert) && ((data.length()) && (data.length() == cert->GetFingerprint().length()))) { ServerInstance->Log(DEBUG,"Lengths match, cert='%s'",cert->GetFingerprint().c_str()); if (data == cert->GetFingerprint()) @@ -98,6 +98,10 @@ class ModuleOperSSLCert : public Module } else { + /* Someones playing silly buggers, and entering in literals asa the oper pass */ + if (input == cert->GetFingerprint()) + return -1; + ServerInstance->Log(DEBUG,"'%s' != '%s'",data.c_str(), cert->GetFingerprint().c_str()); return 0; } -- cgit v1.2.3