]> jfr.im git - irc/freenode/solanum.git/commitdiff
Replace IsInsecure with IsSecure
authorEd Kellett <redacted>
Wed, 28 Oct 2020 15:28:51 +0000 (15:28 +0000)
committerEd Kellett <redacted>
Sat, 31 Oct 2020 16:00:02 +0000 (16:00 +0000)
extensions/m_webirc.c
include/client.h
ircd/listener.c
ircd/s_user.c
modules/m_starttls.c

index 2937189ea784496d2b5ac4b2006aca39db5a9595..dff262c62b888efded461fa7d27760aef8e95dbc 100644 (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");
                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));
index cb5ec43d26210b8b8cf48e397748440538b4a06e..21b8f06600f4a8a09b1363aee6b813f5bcfe9a72 100644 (file)
@@ -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))
index 19e249a2822b2168d8c584c64eea43dfd598336a..2cd2e8a2e5770dc3e1be09f32cb1612f48a2fbfe 100644 (file)
@@ -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)
index 9b9bb1c750a9166f29d59d7414b6f5e8aad608a9..5d6d0afc8035d5fe727f8fcfbe962dbe3ec032e2 100644 (file)
@@ -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)
index a51f652f246241d9994aeefd48d1c016af00226c..7968836ae98bf0d9942d4aef868c92e17d0f7563 100644 (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->ssl_ctl = ctl;
                SetSSL(client_p);
+               SetSecure(client_p);
        }
 }