custom cloak for tor HS users

This commit is contained in:
Al Beano 2017-04-06 22:22:12 +01:00
parent ff50430c76
commit 436240f3e1
1 changed files with 13 additions and 1 deletions

View File

@ -773,6 +773,11 @@ Client_HostnameDisplayed(CLIENT *Client)
{
assert(Client != NULL);
/* Client is using Tor HS */
if (strcmp(Client_IPAText(Client), "127.0.0.1") == 0) {
return "TorHS";
}
/* Client isn't cloaked at all, return real hostname: */
if (!Client_HasMode(Client, 'x'))
return Client_Hostname(Client);
@ -947,9 +952,16 @@ Client_MaskCloaked(CLIENT *Client)
assert (Client != NULL);
/* Custom mask for Tor clients */
if (strcmp(Client_IPAText(Client), "127.0.0.1") == 0) {
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user,
"TorHS");
}
/* Is the client using cloaking at all? */
if (!Client_HasMode(Client, 'x'))
else if (!Client_HasMode(Client, 'x')) {
return Client_Mask(Client);
}
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user,
Client_HostnameDisplayed(Client));