- if ((!strcmp(LoginName.c_str(),parameters[0])) && (!ServerInstance->OperPassCompare(Password.c_str(),parameters[1],i)) && (OneOfMatches(TheHost,TheIP,HostName.c_str())))
- {
- if (SSLOnly && !user->GetExt("ssl", dummy))
- {
- user->WriteServ("491 %s :This oper login name requires an SSL connection.", user->nick);
- return 1;
- }
-
- /* This oper would match */
- if ((!cert) || (cert->GetFingerprint() != FingerPrint))
- {
- user->WriteServ("491 %s :This oper login name requires a matching key fingerprint.",user->nick);
- ServerInstance->SNO->WriteToSnoMask('o',"'%s' cannot oper, does not match fingerprint", user->nick);
- ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.",user->nick,user->ident,user->host);
- return 1;
- }
- }
+ 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))
+ {
+ user->WriteNumeric(491, "%s :This oper login name requires a matching key fingerprint.",user->nick.c_str());
+ ServerInstance->SNO->WriteToSnoMask('o',"'%s' cannot oper, does not match fingerprint", user->nick.c_str());
+ ServerInstance->Logs->Log("m_ssl_oper_cert",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
+ return 1;