From ef672ecfcc78b21f04143c6f21c5450c972cdffc Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 16 Jun 2013 10:58:28 +0000 Subject: - Add usermode 'S' (client is connecte via SSL/TLS). Allows services to keep track of what users are connected via SSL, and allows to see ssl-status of remote clients in a /whois git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2247 82007160-df01-0410-b94d-b575c5fd34c7 --- src/channel.c | 7 +------ src/s_bsd.c | 1 + src/s_user.c | 8 ++++++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/channel.c b/src/channel.c index 1c04488..e588add 100644 --- a/src/channel.c +++ b/src/channel.c @@ -641,13 +641,8 @@ is_banned(const struct Channel *chptr, const struct Client *who) int can_join(struct Client *source_p, struct Channel *chptr, const char *key) { -#ifdef HAVE_LIBCRYPTO - if ((chptr->mode.mode & MODE_SSLONLY) && !source_p->localClient->fd.ssl) + if ((chptr->mode.mode & MODE_SSLONLY) && !HasUMode(source_p, UMODE_SSL)) return ERR_SSLONLYCHAN; -#else - if ((chptr->mode.mode & MODE_SSLONLY)) - return ERR_SSLONLYCHAN; -#endif if ((chptr->mode.mode & MODE_REGONLY) && !HasUMode(source_p, UMODE_REGISTERED)) return ERR_NEEDREGGEDNICK; diff --git a/src/s_bsd.c b/src/s_bsd.c index e0b8173..903741e 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -368,6 +368,7 @@ add_connection(struct Listener *listener, struct irc_ssaddr *irn, int fd) return; } + AddFlag(new_client, FLAGS_SSL); SSL_set_fd(new_client->localClient->fd.ssl, fd); ssl_handshake(0, new_client); } diff --git a/src/s_user.c b/src/s_user.c index ebbeecd..97ad2c1 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -101,7 +101,7 @@ const unsigned int user_modes[256] = 0, /* P */ 0, /* Q */ UMODE_REGONLY, /* R */ - 0, /* S */ + UMODE_SSL, /* S */ 0, /* T */ 0, /* U */ 0, /* V */ @@ -895,6 +895,7 @@ set_user_mode(struct Client *client_p, struct Client *source_p, break; + case 'S': /* Only servers may set +S in a burst */ case 'r': /* Only services may set +r */ case 'x': /* Only services may set +x */ break; @@ -1143,10 +1144,13 @@ user_welcome(struct Client *source_p) #endif #ifdef HAVE_LIBCRYPTO - if (source_p->localClient->fd.ssl != NULL) + if (HasFlag(source_p, FLAGS_SSL)) + { + AddUMode(source_p, UMODE_SSL); sendto_one(source_p, ":%s NOTICE %s :*** Connected securely via %s", me.name, source_p->name, ssl_get_cipher(source_p->localClient->fd.ssl)); + } #endif sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name, -- cgit