channel, do not re-create the channel since it creates
duplicate same channels. Affected file silcd/server.c.
+ * Added anonymous client connections support to server. New
+ "anonymous" configuration option to ConnectionParams section
+ added. If set to true, the username and hostname information
+ of the client will be scrambled and anonymous user mode is
+ set automatically to the user. Affected files are
+ silcd/serverconfig.[ch], silcd/packet_receive.c and server.c.
+
Sat Sep 7 16:02:09 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* In JOIN notify handling, mark that the cache entry of the
snprintf(&nickname[strlen(nickname) - 1], 1, "%d", nickfail);
}
+ /* If client marked as anonymous, scramble the username and hostname */
+ if (client->mode & SILC_UMODE_ANONYMOUS) {
+ char *scramble;
+
+ if (strlen(username) >= 2) {
+ username[0] = silc_rng_get_byte_fast(server->rng);
+ username[1] = silc_rng_get_byte_fast(server->rng);
+ }
+
+ scramble = silc_hash_babbleprint(server->sha1hash, username,
+ strlen(username));
+ scramble[5] = '@';
+ scramble[11] = '.';
+ memcpy(&scramble[16], ".silc", 5);
+ scramble[21] = '\0';
+ silc_free(username);
+ username = scramble;
+ }
+
/* Update client entry */
idata->status |= SILC_IDLIST_STATUS_REGISTERED;
client->nickname = nickname;
if (conn->param) {
if (conn->param->keepalive_secs)
hearbeat_timeout = conn->param->keepalive_secs;
+
+ /* Check if to be anonymous connection */
+ if (conn->param->anonymous)
+ client->mode |= SILC_UMODE_ANONYMOUS;
}
id_entry = (void *)client;
tmp->version_software_vendor =
(*(char *)val ? strdup((char *) val) : NULL);
}
+ else if (!strcmp(name, "anonymous")) {
+ tmp->anonymous = *(bool *)val;
+ }
else
return SILC_CONFIG_EINTERNAL;
{ "key_exchange_pfs", SILC_CONFIG_ARG_TOGGLE, fetch_connparam, NULL },
{ "version_protocol", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
{ "version_software", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
- { "version_software_vendor", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
+ { "version_software_vendor", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
+ { "anonymous", SILC_CONFIG_ARG_TOGGLE, fetch_connparam, NULL },
{ 0, 0, 0, 0 }
};
/* Connection parameters */
typedef struct SilcServerConfigConnParams {
char *name;
+ char *version_protocol;
+ char *version_software;
+ char *version_software_vendor;
SilcUInt32 connections_max;
SilcUInt32 connections_max_per_host;
SilcUInt32 keepalive_secs;
SilcUInt32 reconnect_count;
SilcUInt32 reconnect_interval;
SilcUInt32 reconnect_interval_max;
- bool reconnect_keep_trying;
SilcUInt32 key_exchange_rekey;
bool key_exchange_pfs;
- char *version_protocol;
- char *version_software;
- char *version_software_vendor;
+ bool reconnect_keep_trying;
+ bool anonymous;
struct SilcServerConfigConnParams *next;
} SilcServerConfigConnParams;
# process somewhat slower, than without PFS.
#key_exchange_pfs = true;
+ # Anonymous connection. This setting has effect only when this
+ # this is used with client connections. If set to true then clients
+ # using this connection parameter will be anonymous connections.
+ # This means that the client's username and hostname information
+ # is scrambled and anonymous mode is set for the user.
+ #anonymous = true;
+
#TODO:
#connections_interval - incoming connection interval limit ?
};