From cae1a304ba0e79c5ef5ed98bb3630aed9ffd9671 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Wed, 18 Apr 2001 17:36:59 +0000 Subject: [PATCH] -- Fixed a claok bug caused by stskeeps(tm) "not knowing how to use << and >> coding" +- Fixed a cloak bug caused by stskeeps(tm) "not knowing how to use << and >> coding" +- Fixed some cloak bugs, and applied +x crypto to hostnames as well --- Changes | 3 ++- src/cloak.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index d6b636669..9686ab982 100644 --- a/Changes +++ b/Changes @@ -430,4 +430,5 @@ - Removed doc/ADD-TO-IRCRC, doc/INSTALL, doc/Manual, doc/Operators, doc/irc.1, doc/ircd.8, doc/server-compile-guide - Made it so Invitewalk and Keywalk don't show for U:lines -- Fixed a claok bug caused by stskeeps(tm) "not knowing how to use << and >> coding" +- Fixed a cloak bug caused by stskeeps(tm) "not knowing how to use << and >> coding" +- Fixed some cloak bugs, and applied +x crypto to hostnames as well diff --git a/src/cloak.c b/src/cloak.c index 9cc44bcef..d5497d9c3 100644 --- a/src/cloak.c +++ b/src/cloak.c @@ -200,7 +200,7 @@ char *hidehost(char *host) l[4] = crc32(host, strlen(host)); l[2] = ((l[4] + KEY2) ^ KEY)^ KEY3; l[2] <<= 2; l[2] >>= 2; - l[0] >>= 1; l[0] >>= 1; + l[0] <<= 1; l[0] >>= 1; ircsprintf(cloaked, "%X.%X.%X.IP", l[2], l[1], l[0]); return cloaked; } @@ -223,12 +223,15 @@ char *hidehost(char *host) break; } } + l[0] = ((crc32(host, strlen(host)) + KEY2) ^ KEY)^ KEY3; + l[0] <<= 2; + l[0] >>= 2; p++; if (*p) sprintf(cloaked, "%s-%X.%s", hidden_host, - crc32(host, strlen(host)), p); + l[0], p); else - sprintf(cloaked, "%s-%X", hidden_host, crc32(host, strlen(host))); + sprintf(cloaked, "%s-%X", hidden_host, l[0]); return cloaked; }