+rubiks-ircd-1-0-2
+=================
+
+- Minor code cleanups related to SSL support
+- Added support for SSL_ONLY_OPERS, and added it as default in config.h.
+ This prevents opers from leaking channel information, since they can of
+ course join +S (secure only) channels. It seems a better approach than to
+ prevent opers from joining these channels. Moreover, this enhances security
+ since opers using SSL will not type their operator password in plain text.
+
+
rubiks-ircd-1-0-1
=================
*
*/
-/* $Id: config.h,v 1.13 2005/03/07 19:14:48 mwiggins Exp $ */
+/* $Id: config.h,v 1.14 2005/03/17 20:39:02 mmondor Exp $ */
#ifndef __config_include__
#define __config_include__
* SSL support stolen from fqircd
*/
#ifdef USE_SSL
+
+#define SSL_ONLY_OPERS /* Opers must use SSL */
+
#define IRCDSSL_KPATH "ircd.key"
#define IRCDSSL_CPATH "ircd.crt"
send(to->fd, buf, len, 0)
#define WRITEV_CHECK_SSL(to, iov, len) (IsSSL(to) && to->ssl) ?\
- safe_SSL_write(to,iov->iov_base,iov->iov_len) :\
- writev(to->fd, iov, len);
+ safe_SSL_write(to,iov->iov_base,iov->iov_len) :\
+ writev(to->fd, iov, len)
+
#endif
*
*/
-/* $Id: numeric.h,v 1.2 2005/01/13 10:35:43 mmondor Exp $ */
+/* $Id: numeric.h,v 1.3 2005/03/17 20:39:02 mmondor Exp $ */
#define RPL_WELCOME 001
#define ERR_MSGSERVICES 487
#ifdef USE_SSL
-#define ERR_NOSSL 488
+#define ERR_SSLONLYCHAN 488
+#define ERR_SSLONLYOPERS 490
#endif
#define ERR_NOOPERHOST 491
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: channel.c,v 1.4 2005/03/16 19:12:16 mwiggins Exp $ */
+/* $Id: channel.c,v 1.5 2005/03/17 20:39:02 mmondor Exp $ */
#include "struct.h"
#include "common.h"
if ((chptr->mode.mode & MODE_NOCOLOR) && msg_has_colors(msg))
return (ERR_NOCOLORSONCHAN);
#ifdef USE_SSL
- if ((chptr->mode.mode & MODE_SSL) && !IsUmodeS(cptr))
- return (MODE_SSL);
+ if ((chptr->mode.mode & MODE_SSL) && !IsUmodeS(cptr))
+ return (MODE_SSL);
#endif
if (MyClient(cptr) && is_banned(cptr, chptr, NULL))
return (MODE_BAN); /*
if ((chptr->mode.mode & MODE_MODREG) && !IsRegNick(cptr))
return (ERR_NEEDREGGEDNICK);
#ifdef USE_SSL
- if ((chptr->mode.mode & MODE_SSL) && !IsUmodeS(cptr))
- return (MODE_SSL);
+ if ((chptr->mode.mode & MODE_SSL) && !IsUmodeS(cptr))
+ return (MODE_SSL);
#endif
}
if ((chptr->mode.mode & MODE_NOCOLOR) && msg_has_colors(msg))
else if (chptr->mode.mode & MODE_SSL && !IsSSL(sptr) && !IsOper(sptr))
{
r = "+S";
- error = ERR_NOSSL;
+ error = ERR_SSLONLYCHAN;
}
#endif
else if (chptr->mode.mode & MODE_REGONLY && !IsRegNick(sptr))
/* 272 RPL_ENDOFSILELIST*/ ":%s 272 %s :End of /SILENCE list.",
/* 273 */ NULL,
/* 274 */ NULL,
- /* 275 */ ":%s 275 %s %s :is using a secure connection (SSL)",
+#ifdef USE_SSL
+ /* 275 RPL_USINGSSL */ ":%s 275 %s %s :is using a secure connection "
+ "(SSL)",
+#else
+ /* 275 */ NULL,
+#endif
/* 276 */ NULL,
/* 277 */ NULL,
/* 278 */ NULL,
"registered nick to private message %s",
/* 487 ERR_MSGSERVICES */ ":%s 487 %s :Error! \"/msg %s\" is no longer supported. "
"Use \"/msg %s@%s\" or \"/%s\" instead.",
- /* 488 ERR_NOPRIVILEGES */ ":%s 488 %s :SSL Only channel (+S), You must connect "
- "using SSL to join this channel.",
+#ifdef USE_SSL
+ /* 488 ERR_SSLONLYCHAN */ ":%s 488 %s :SSL Only channel (+S), You must "
+ "connect using SSL to join this channel.",
+#else
+ /* 488 */ NULL,
+#endif
/* 489 */ NULL, /* In use by Undernet */
+#if defined(USE_SSL) && defined(SSL_ONLY_OPERS)
+ /* 490 ERR_SSLONLYOPERS */ ":%s 490 %s :Operators only allowed through "
+ "SSL",
+#else
/* 490 */ NULL,
+#endif
/* 491 ERR_NOOPERHOST */ ":%s 491 %s :No Oper block for your host",
/* 492 */ NULL,
/* 493 */ NULL,
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: s_user.c,v 1.10 2005/01/19 22:05:45 mwiggins Exp $ */
+/* $Id: s_user.c,v 1.11 2005/03/17 20:39:03 mmondor Exp $ */
#include "struct.h"
#include "common.h"
sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
return 0;
}
+#if defined(USE_SSL) && defined(SSL_ONLY_OPERS)
+ if (!IsUmodeS(cptr)) {
+ sendto_one(sptr, rpl_str(ERR_SSLONLYOPERS), me.name, parv[0]);
+ return 0;
+ }
+#endif
#if (RIDICULOUS_PARANOIA_LEVEL>=1)
if(!sptr->user->real_oper_host)
{