From bbdc439aa37b4703e89160ddd98c1a406a515327 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Wed, 28 Oct 2020 15:28:51 +0000 Subject: [PATCH] Replace IsInsecure with IsSecure --- extensions/m_webirc.c | 6 +++--- include/client.h | 8 ++++---- ircd/listener.c | 1 + ircd/s_user.c | 4 ++-- modules/m_starttls.c | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/extensions/m_webirc.c b/extensions/m_webirc.c index 2937189e..dff262c6 100644 --- a/extensions/m_webirc.c +++ b/extensions/m_webirc.c @@ -107,7 +107,7 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc sendto_one(source_p, "NOTICE * :CGI:IRC auth blocks must have a password"); return; } - if (!IsSSL(source_p) && aconf->flags & CONF_FLAGS_NEED_SSL) + if (!IsSecure(source_p) && aconf->flags & CONF_FLAGS_NEED_SSL) { sendto_one(source_p, "NOTICE * :Your CGI:IRC block requires TLS"); return; @@ -144,7 +144,7 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc } } - if (secure && !IsSSL(source_p)) + if (secure && !IsSecure(source_p)) { sendto_one(source_p, "NOTICE * :CGI:IRC is not connected securely; marking you as insecure"); secure = 0; @@ -152,7 +152,7 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc if (!secure) { - SetInsecure(source_p); + ClearSecure(source_p); } rb_inet_ntop_sock((struct sockaddr *)&source_p->localClient->ip, source_p->sockhost, sizeof(source_p->sockhost)); diff --git a/include/client.h b/include/client.h index cb5ec43d..21b8f066 100644 --- a/include/client.h +++ b/include/client.h @@ -437,7 +437,7 @@ struct ListClient #define LFLAGS_FLUSH 0x00000002 #define LFLAGS_CORK 0x00000004 #define LFLAGS_SCTP 0x00000008 -#define LFLAGS_INSECURE 0x00000010 /* for marking SSL clients as insecure before registration */ +#define LFLAGS_SECURE 0x00000010 /* for marking SSL clients as secure before registration */ /* umodes, settable flags */ /* lots of this moved to snomask -- jilles */ @@ -513,9 +513,9 @@ struct ListClient #define SetSCTP(x) ((x)->localClient->localflags |= LFLAGS_SCTP) #define ClearSCTP(x) ((x)->localClient->localflags &= ~LFLAGS_SCTP) -#define IsInsecure(x) ((x)->localClient->localflags & LFLAGS_INSECURE) -#define SetInsecure(x) ((x)->localClient->localflags |= LFLAGS_INSECURE) -#define ClearInsecure(x) ((x)->localClient->localflags &= ~LFLAGS_INSECURE) +#define IsSecure(x) ((x)->localClient->localflags & LFLAGS_SECURE) +#define SetSecure(x) ((x)->localClient->localflags |= LFLAGS_SECURE) +#define ClearSecure(x) ((x)->localClient->localflags &= ~LFLAGS_SECURE) /* oper flags */ #define MyOper(x) (MyConnect(x) && IsOper(x)) diff --git a/ircd/listener.c b/ircd/listener.c index 19e249a2..2cd2e8a2 100644 --- a/ircd/listener.c +++ b/ircd/listener.c @@ -539,6 +539,7 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, str F = xF[0]; new_client->localClient->F = F; SetSSL(new_client); + SetSecure(new_client); } if (listener->wsock) diff --git a/ircd/s_user.c b/ircd/s_user.c index 9b9bb1c7..5d6d0afc 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -441,7 +441,7 @@ register_local_user(struct Client *client_p, struct Client *source_p) return (CLIENT_EXITED); } - if(IsConfSSLNeeded(aconf) && !IsSSL(source_p)) + if(IsConfSSLNeeded(aconf) && !IsSecure(source_p)) { ServerStats.is_ref++; sendto_one_notice(source_p, ":*** Notice -- You need to use SSL/TLS to use this server"); @@ -634,7 +634,7 @@ register_local_user(struct Client *client_p, struct Client *source_p) add_to_id_hash(source_p->id, source_p); } - if (IsSSL(source_p) && !IsInsecure(source_p)) + if (IsSecure(source_p)) source_p->umodes |= UMODE_SSLCLIENT; if (source_p->umodes & UMODE_INVISIBLE) diff --git a/modules/m_starttls.c b/modules/m_starttls.c index a51f652f..7968836a 100644 --- a/modules/m_starttls.c +++ b/modules/m_starttls.c @@ -100,5 +100,6 @@ mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou client_p->localClient->F = F[0]; client_p->localClient->ssl_ctl = ctl; SetSSL(client_p); + SetSecure(client_p); } }