* USE WITH CAUTION.
* no_tilde (old - flag) | don't prefix ~ to username if no ident
* need_ident (old + flag) | require ident for user in this class
+ * need_ssl | require SSL/TLS for user in this class
* need_sasl | require SASL id for user in this class
*/
flags = kline_exempt, exceed_limit;
* Available options:
*
* encrypted: the password above is encrypted [DEFAULT]
+ * need_ssl: must be using SSL/TLS to oper up
* local_kill: allows local users to be /KILL'd
* global_kill: allows local and remote users to be
* /KILL'd (OLD 'O' flag)
/* Generic flags... */
#define CONF_FLAGS_TEMPORARY 0x00800000
+#define CONF_FLAGS_NEED_SSL 0x00000002
/* auth{} flags... */
#define CONF_FLAGS_NO_TILDE 0x00000004
#define CONF_FLAGS_NEED_IDENTD 0x00000008
#define IsConfEncrypted(x) ((x)->flags & CONF_FLAGS_ENCRYPTED)
#define IsNeedSasl(x) ((x)->flags & CONF_FLAGS_NEED_SASL)
#define IsConfExemptDNSBL(x) ((x)->flags & CONF_FLAGS_EXEMPTDNSBL)
+#define IsConfSSLNeeded(x) ((x)->flags & CONF_FLAGS_NEED_SSL)
/* flag definitions for opers now in client.h */
#define OPER_SPY 0x10000
#define OPER_REMOTEBAN 0x20000
#define OPER_MASSNOTICE 0x40000
+#define OPER_NEEDSSL 0x80000
/* 0x400000 and above are in client.h */
#define OPER_FLAGS (OPER_KLINE|OPER_UNKLINE|OPER_LOCKILL|OPER_GLOBKILL|\
OPER_REMOTEBAN|OPER_MASSNOTICE)
#define IsOperConfEncrypted(x) ((x)->flags & OPER_ENCRYPTED)
+#define IsOperConfNeedSSL(x) ((x)->flags & OPER_NEEDSSL)
#define HasPrivilege(x, y) ((x)->localClient != NULL && (x)->localClient->privset != NULL && privilegeset_in_set((x)->localClient->privset, (y)))
return 0;
}
+ if(IsOperConfNeedSSL(oper_p) && !IsSSLClient(source_p))
+ {
+ sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name);
+ ilog(L_FOPER, "FAILED CHALLENGE (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
+ parv[1], source_p->name, source_p->username, source_p->host,
+ source_p->sockhost);
+
+ if(ConfigFileEntry.failed_oper_notice)
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "Failed CHALLENGE attempt - missing SSL/TLS by %s (%s@%s)",
+ source_p->name, source_p->username, source_p->host);
+ }
+ return 0;
+ }
+
if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey))
{
char *chal = challenge;
return 0;
}
+ if(IsOperConfNeedSSL(oper_p) && !IsSSLClient(source_p))
+ {
+ sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name);
+ ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
+ name, source_p->name,
+ source_p->username, source_p->host, source_p->sockhost);
+
+ if(ConfigFileEntry.failed_oper_notice)
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "Failed OPER attempt - missing SSL/TLS by %s (%s@%s)",
+ source_p->name, source_p->username, source_p->host);
+ }
+ return 0;
+ }
+
if(match_oper_password(password, oper_p))
{
oper_up(source_p, oper_p);
{"hidden_oper", OPER_INVIS },
{"remoteban", OPER_REMOTEBAN },
{"mass_notice", OPER_MASSNOTICE },
+ {"need_ssl", OPER_NEEDSSL },
{NULL, 0}
};
{"no_tilde", CONF_FLAGS_NO_TILDE },
{"need_ident", CONF_FLAGS_NEED_IDENTD },
{"have_ident", CONF_FLAGS_NEED_IDENTD },
+ {"need_ssl", CONF_FLAGS_NEED_SSL },
{"need_sasl", CONF_FLAGS_NEED_SASL },
{NULL, 0}
};
return (CLIENT_EXITED);
}
+ if(IsConfSSLNeeded(aconf) && !IsSSL(source_p))
+ {
+ ServerStats.is_ref++;
+ sendto_one_notice(source_p, ":*** Notice -- You need to use SSL/TLS to use this server");
+ exit_client(client_p, source_p, &me, "Use SSL/TLS");
+ return (CLIENT_EXITED);
+ }
+
if(!IsGotId(source_p))
{
const char *p;