- ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "name", i, LoginName, MAXBUF);
- ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "password", i, Password, MAXBUF);
- ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "type", i, OperType, MAXBUF);
- ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "host", i, HostName, MAXBUF);
- ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "fingerprint", i, FingerPrint, MAXBUF);
-
- if (*FingerPrint)
+ LoginName = cf->ReadValue("oper", "name", i);
+ 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 (FingerPrint.empty() && !SSLOnly)
+ continue;
+
+ if (LoginName != parameters[0])
+ continue;
+
+ if (!OneOfMatches(TheHost, TheIP, HostName.c_str()))
+ continue;
+
+ if (Password.length() && ServerInstance->PassCompare(user, Password.c_str(),parameters[1].c_str(), HashType.c_str()))
+ continue;
+
+ if (SSLOnly && !user->GetExt("ssl", dummy))
+ {
+ user->WriteNumeric(491, "%s :This oper login name requires an SSL connection.", user->nick.c_str());
+ return 1;
+ }
+
+ /*
+ * No cert found or the fingerprint doesn't match
+ */
+ if ((!cert) || (cert->GetFingerprint() != FingerPrint))