Replace IsInsecure with IsSecure

This commit is contained in:
Ed Kellett 2020-10-28 15:28:51 +00:00
parent 1a16d47edb
commit bbdc439aa3
5 changed files with 11 additions and 9 deletions

View file

@ -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"); sendto_one(source_p, "NOTICE * :CGI:IRC auth blocks must have a password");
return; 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"); sendto_one(source_p, "NOTICE * :Your CGI:IRC block requires TLS");
return; 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"); sendto_one(source_p, "NOTICE * :CGI:IRC is not connected securely; marking you as insecure");
secure = 0; secure = 0;
@ -152,7 +152,7 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
if (!secure) 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)); rb_inet_ntop_sock((struct sockaddr *)&source_p->localClient->ip, source_p->sockhost, sizeof(source_p->sockhost));

View file

@ -437,7 +437,7 @@ struct ListClient
#define LFLAGS_FLUSH 0x00000002 #define LFLAGS_FLUSH 0x00000002
#define LFLAGS_CORK 0x00000004 #define LFLAGS_CORK 0x00000004
#define LFLAGS_SCTP 0x00000008 #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 */ /* umodes, settable flags */
/* lots of this moved to snomask -- jilles */ /* lots of this moved to snomask -- jilles */
@ -513,9 +513,9 @@ struct ListClient
#define SetSCTP(x) ((x)->localClient->localflags |= LFLAGS_SCTP) #define SetSCTP(x) ((x)->localClient->localflags |= LFLAGS_SCTP)
#define ClearSCTP(x) ((x)->localClient->localflags &= ~LFLAGS_SCTP) #define ClearSCTP(x) ((x)->localClient->localflags &= ~LFLAGS_SCTP)
#define IsInsecure(x) ((x)->localClient->localflags & LFLAGS_INSECURE) #define IsSecure(x) ((x)->localClient->localflags & LFLAGS_SECURE)
#define SetInsecure(x) ((x)->localClient->localflags |= LFLAGS_INSECURE) #define SetSecure(x) ((x)->localClient->localflags |= LFLAGS_SECURE)
#define ClearInsecure(x) ((x)->localClient->localflags &= ~LFLAGS_INSECURE) #define ClearSecure(x) ((x)->localClient->localflags &= ~LFLAGS_SECURE)
/* oper flags */ /* oper flags */
#define MyOper(x) (MyConnect(x) && IsOper(x)) #define MyOper(x) (MyConnect(x) && IsOper(x))

View file

@ -539,6 +539,7 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, str
F = xF[0]; F = xF[0];
new_client->localClient->F = F; new_client->localClient->F = F;
SetSSL(new_client); SetSSL(new_client);
SetSecure(new_client);
} }
if (listener->wsock) if (listener->wsock)

View file

@ -441,7 +441,7 @@ register_local_user(struct Client *client_p, struct Client *source_p)
return (CLIENT_EXITED); return (CLIENT_EXITED);
} }
if(IsConfSSLNeeded(aconf) && !IsSSL(source_p)) if(IsConfSSLNeeded(aconf) && !IsSecure(source_p))
{ {
ServerStats.is_ref++; ServerStats.is_ref++;
sendto_one_notice(source_p, ":*** Notice -- You need to use SSL/TLS to use this server"); 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); 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; source_p->umodes |= UMODE_SSLCLIENT;
if (source_p->umodes & UMODE_INVISIBLE) if (source_p->umodes & UMODE_INVISIBLE)

View file

@ -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->F = F[0];
client_p->localClient->ssl_ctl = ctl; client_p->localClient->ssl_ctl = ctl;
SetSSL(client_p); SetSSL(client_p);
SetSecure(client_p);
} }
} }