From: Pekka Riikonen Date: Wed, 30 May 2001 14:19:20 +0000 (+0000) Subject: update updates-s- X-Git-Tag: robodoc-323~257 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=e1c38761645137364b2acadec0cc9c51471b4ce9;p=silc.git update updates-s- --- diff --git a/CHANGES b/CHANGES index db41d029..5418a1e9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,22 @@ +Tue May 29 22:16:40 EEST 2001 Pekka Riikonen + + * Added Makefile.defines_int to include the actual definitions + for Makefile.defines.in. Tested the new distribution system, + created distributions and tested installation. + + * Added AWAY message printing to the Irssi SILC client. Added + the messages to the irssi/src/fe-common/silc/module-formats.[ch]. + + * Added SCONNECT command to call the SILC's CONNECT command. + Cannot use CONNECT directly since Irssi uses that internally. + Affected file irssi/src/silc/core/silc-servers.c. + + Added ACTION local command. It is same as ME command but takes + the channel as mandatory argument. + + Rewrote some of the Irssi's help files to suite for SILC + protocol. + Mon May 28 19:05:22 EEST 2001 Pekka Riikonen * Added Makefile.defines[.in] that should for now on be included diff --git a/TODO b/TODO index 60920cda..9ff6f4f8 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,12 @@ +TODO/bugs in Irssi SILC client +============================== + + o Add KNOCKOUT local command. It should kick an client from channel and + set a ban for it for number of seconds. + + o Add KICKBAN local command. Kicks and bans the specified client. + + TODO/bugs In SILC Client Library ================================ diff --git a/apps/irssi/config b/apps/irssi/config index 38dc7478..fc346a2d 100644 --- a/apps/irssi/config +++ b/apps/irssi/config @@ -46,6 +46,7 @@ aliases = { WN = "window new hide"; GOTO = "sb goto"; CHAT = "dcc chat"; + ADMIN = "info"; }; settings = { diff --git a/apps/irssi/src/fe-common/silc/module-formats.c b/apps/irssi/src/fe-common/silc/module-formats.c index 90c35129..9e8ddfb0 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.c +++ b/apps/irssi/src/fe-common/silc/module-formats.c @@ -83,7 +83,7 @@ FORMAT_REC fecommon_silc_formats[] = { { "pubkey_maybe_expired", "It is possible that the key has expired or changed", 0 }, { "pubkey_mitm_attach", "It is also possible that someone is performing man-in-the-middle attack", 0 }, - /* Key management and key agreement */ + /* Misc messages */ { NULL, "Misc", 0 }, { "server_oper", "You are now {hilight server operator}", 0 }, @@ -101,6 +101,8 @@ FORMAT_REC fecommon_silc_formats[] = { { "ke_unknown_hmac", "Server does not support one of your proposed HMAC", 0 }, { "ke_incorrect_signature", "Incorrect signature", 0 }, { "auth_failed", "Authentication failed", 0 }, + { "set_away", "You have meen marked as being away (away message: {hilight $0})", 1, { 0 } }, + { "unset_away", "You are no longer marked as being away", 0 }, { NULL, NULL, 0 } }; diff --git a/apps/irssi/src/fe-common/silc/module-formats.h b/apps/irssi/src/fe-common/silc/module-formats.h index 13284445..b1de6171 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.h +++ b/apps/irssi/src/fe-common/silc/module-formats.h @@ -88,7 +88,6 @@ enum { SILCTXT_UNKNOWN_NOTIFY, SILCTXT_KE_BAD_VERSION, SILCTXT_KE_UNSUPPORTED_PUBLIC_KEY, - SILCTXT_KE_UNKNOWN_PUBLIC_KEY, SILCTXT_KE_UNKNOWN_GROUP, SILCTXT_KE_UNKNOWN_CIPHER, SILCTXT_KE_UNKNOWN_PKCS, @@ -96,6 +95,8 @@ enum { SILCTXT_KE_UNKNOWN_HMAC, SILCTXT_KE_INCORRECT_SIGNATURE, SILCTXT_AUTH_FAILED, + SILCTXT_SET_AWAY, + SILCTXT_UNSET_AWAY, }; extern FORMAT_REC fecommon_silc_formats[]; diff --git a/apps/irssi/src/silc/core/silc-channels.c b/apps/irssi/src/silc/core/silc-channels.c index c299f65f..ac588e64 100644 --- a/apps/irssi/src/silc/core/silc-channels.c +++ b/apps/irssi/src/silc/core/silc-channels.c @@ -487,6 +487,53 @@ static void command_me(const char *data, SILC_SERVER_REC *server, silc_free(argv_types); } +/* ACTION local command. Same as ME but takes the channel as mandatory + argument. */ + +static void command_action(const char *data, SILC_SERVER_REC *server, + WI_ITEM_REC *item) +{ + SILC_CHANNEL_REC *chanrec; + char *tmpcmd = "ME", *tmp; + uint32 argc = 0; + unsigned char **argv; + uint32 *argv_lens, *argv_types; + int i; + + if (!IS_SILC_SERVER(server) || !server->connected) + cmd_return_error(CMDERR_NOT_CONNECTED); + + if (!IS_SILC_CHANNEL(item)) + cmd_return_error(CMDERR_NOT_JOINED); + + /* Now parse all arguments */ + tmp = g_strconcat(tmpcmd, " ", data, NULL); + silc_parse_command_line(tmp, &argv, &argv_lens, + &argv_types, &argc, 3); + g_free(tmp); + + if (argc < 3) + cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS); + + chanrec = silc_channel_find(server, argv[1]); + if (chanrec == NULL) + cmd_return_error(CMDERR_CHAN_NOT_FOUND); + + /* Send the action message */ + silc_client_send_channel_message(silc_client, server->conn, + chanrec->entry, NULL, + SILC_MESSAGE_FLAG_ACTION, + argv[2], argv_lens[2], TRUE); + + printformat_module("fe-common/silc", server, chanrec->entry->channel_name, + MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_OWNACTION, argv[2]); + + for (i = 0; i < argc; i++) + silc_free(argv[i]); + silc_free(argv_lens); + silc_free(argv_types); +} + /* NOTICE local command. */ static void command_notice(const char *data, SILC_SERVER_REC *server, @@ -548,12 +595,20 @@ static void command_away(const char *data, SILC_SERVER_REC *server, /* Remove any possible away message */ silc_client_set_away_message(silc_client, server->conn, NULL); set = FALSE; + + printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, + SILCTXT_UNSET_AWAY); } else { /* Set the away message */ silc_client_set_away_message(silc_client, server->conn, (char *)data); set = TRUE; + + printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, + SILCTXT_SET_AWAY, data); } + signal_emit("away mode changed", 1, server); + silc_command_exec(server, "UMODE", set ? "+g" : "-g"); } @@ -1050,6 +1105,7 @@ void silc_channels_init(void) command_bind("part", MODULE_NAME, (SIGNAL_FUNC) command_part); command_bind("me", MODULE_NAME, (SIGNAL_FUNC) command_me); + command_bind("action", MODULE_NAME, (SIGNAL_FUNC) command_action); command_bind("notice", MODULE_NAME, (SIGNAL_FUNC) command_notice); command_bind("away", MODULE_NAME, (SIGNAL_FUNC) command_away); command_bind("key", MODULE_NAME, (SIGNAL_FUNC) command_key); @@ -1082,6 +1138,7 @@ void silc_channels_deinit(void) command_unbind("part", (SIGNAL_FUNC) command_part); command_unbind("me", (SIGNAL_FUNC) command_me); + command_unbind("action", (SIGNAL_FUNC) command_action); command_unbind("notice", (SIGNAL_FUNC) command_notice); command_unbind("away", (SIGNAL_FUNC) command_away); command_unbind("key", (SIGNAL_FUNC) command_key); diff --git a/apps/irssi/src/silc/core/silc-servers.c b/apps/irssi/src/silc/core/silc-servers.c index b2986eac..55bc0255 100644 --- a/apps/irssi/src/silc/core/silc-servers.c +++ b/apps/irssi/src/silc/core/silc-servers.c @@ -287,6 +287,8 @@ void silc_command_exec(SILC_SERVER_REC *server, (*cmd->cb)(ctx); } +/* Generic command function to call any SILC command directly. */ + static void command_self(const char *data, SILC_SERVER_REC *server) { if (!IS_SILC_SERVER(server) || !server->connected) { @@ -298,6 +300,20 @@ static void command_self(const char *data, SILC_SERVER_REC *server) signal_stop(); } +/* SCONNECT command. Calls actually SILC's CONNECT command since Irssi + has CONNECT command for other purposes. */ + +static void command_sconnect(const char *data, SILC_SERVER_REC *server) +{ + if (!IS_SILC_SERVER(server) || !server->connected) { + printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Not connected to server"); + return; + } + + silc_command_exec(server, "CONNECT", data); + signal_stop(); +} + static void event_text(const char *line, SILC_SERVER_REC *server, WI_ITEM_REC *item) { @@ -338,12 +354,12 @@ void silc_server_init(void) command_bind("kill", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("kick", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("info", MODULE_NAME, (SIGNAL_FUNC) command_self); - command_bind("connect", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("ping", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("motd", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("close", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("shutdown", MODULE_NAME, (SIGNAL_FUNC) command_self); command_bind("getkey", MODULE_NAME, (SIGNAL_FUNC) command_self); + command_bind("sconnect", MODULE_NAME, (SIGNAL_FUNC) command_sconnect); command_set_options("connect", "+silcnet"); } @@ -370,11 +386,11 @@ void silc_server_deinit(void) command_unbind("kill", (SIGNAL_FUNC) command_self); command_unbind("kick", (SIGNAL_FUNC) command_self); command_unbind("info", (SIGNAL_FUNC) command_self); - command_unbind("connect", (SIGNAL_FUNC) command_self); command_unbind("ping", (SIGNAL_FUNC) command_self); command_unbind("motd", (SIGNAL_FUNC) command_self); command_unbind("ban", (SIGNAL_FUNC) command_self); command_unbind("close", (SIGNAL_FUNC) command_self); command_unbind("shutdown", (SIGNAL_FUNC) command_self); command_unbind("getkey", (SIGNAL_FUNC) command_self); + command_unbind("sconnect", (SIGNAL_FUNC) command_sconnect); } diff --git a/apps/silc/testi.conf b/apps/silc/testi.conf index 5d052d20..ca9346b9 100644 --- a/apps/silc/testi.conf +++ b/apps/silc/testi.conf @@ -1,11 +1,4 @@ -# -# Configured ciphers. -# -# Format: ::: -# -# If the cipher is builtin the maybe omitted. -# -[cipher] +[Cipher] aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 @@ -17,53 +10,57 @@ mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16 mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16 none:../lib/silcsim/modules/none.sim.so:0:0 -# -# Configured hash functions. -# -# Format: ::: -# -# If the hash function is builtin the maybe omitted. -# -[hash] +[Hash] md5::64:16 sha1::64:20 -# -# Configured HMAC functions. The hash function used in the HMAC must -# configured to the [hash] section. -# -# Format: :: -# [hmac] hmac-sha1-96:sha1:12 hmac-md5-96:md5:12 -hmac-sha1:sha1:20 +hmac-sha1:sha1:20 hmac-md5:md5:16 -# -# Configured PKCS. -# -# Format: :: -# -# NOTE: must be omitted as PKCS cannot be modules currently. -# -[pkcs] +[PKCS] rsa -# -# Configured connections to servers. -# -# Format: ::: -# -# maybe `passwd' or `pubkey'. -# -[connection] -#lassi.kuo.fi.ssh.com:passwd::706 +[ServerKeys] +./silcd.pub:./silcd.prv -# -# Commands. These are executed when SILC client is run. Normal -# SILC commands may be executed here. -# -# Format: -# -[commands] +[Identity] +nobody:nobody + +[AdminInfo] +Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi + +[ServerInfo] +lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1333 + +[ListenPort] +212.146.42.253:212.146.42.253:1333 + +[Logging] +infologfile:silcd2.log:10000 +#warninglogfile:/var/log/silcd_warning.log:10000 +errorlogfile:silcd2.log:10000 +#fatallogfile:/var/log/silcd_error.log: + +[ConnectionClass] +1:100:100:100 +2:200:300:400 + +[ClientConnection] +:::1333:1 +:::1334:1 +:::1335:1 +:::1336:1 + +[AdminConnection] +*:priikone:*:passwd:testi + +[ServerConnection] +#212.146.42.253:passwd:priikone:1335:1:1 + +[RouterConnection] +212.146.42.253:passwd:priikone:1334:1:1:1 + +[DenyConnection] diff --git a/apps/silc/testi2.conf b/apps/silc/testi2.conf index b6935b7f..1d549c5b 100644 --- a/apps/silc/testi2.conf +++ b/apps/silc/testi2.conf @@ -1,27 +1,66 @@ -[cipher] -twofish:/home/silc/silc/lib/silcsim/modules/twofish.sim.so:16:16 -rc6:/home/silc/silc/lib/silcsim/modules/rc6.sim.so:16:16 -mars:/home/silc/silc/lib/silcsim/modules/mars.sim.so:16:16 -none:/home/silc/silc/lib/silcsim/modules/none.sim.so:0:0 +[Cipher] +aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 +aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 +aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 +twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 +twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 +twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 +mars-256-cbc:../lib/silcsim/modules/mars.sim.so:32:16 +mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16 +mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16 +none:../lib/silcsim/modules/none.sim.so:0:0 -[hash] +[Hash] md5::64:16 sha1::64:20 [hmac] hmac-sha1-96:sha1:12 hmac-md5-96:md5:12 -hmac-sha1:sha1:20 +hmac-sha1:sha1:20 hmac-md5:md5:16 -#[pkcs] -#rsa::1024 -#dss::1024 +[PKCS] +rsa -[connection] -#lassi.kuo.fi.ssh.com:passwd::1333 +[serverkeys] +./silcd.pub:./silcd.prv -[commands] -#/server lassi:1333 -#/server lassi:1334 -#/server leevi:1333 +[Identity] +nobody:nobody + +[AdminInfo] +Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi + +[ServerInfo] +lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1334 + +[ListenPort] +212.146.42.253:212.146.42.253:1334 + +[Logging] +infologfile:silcd2.log:10000 +#warninglogfile:/var/log/silcd_warning.log:10000 +errorlogfile:silcd2.log:10000 +#fatallogfile:/var/log/silcd_error.log: + +[ConnectionClass] +1:100:100:100 +2:200:300:400 + +[ClientConnection] +:::1333:1 +:::1334:1 +:::1335:1 +:::1336:1 + +[AdminConnection] +*:priikone:*:passwd:testi + +[ServerConnection] +212.146.42.253:passwd:priikone:1334:1:1 + +[RouterConnection] +212.146.42.253:passwd:priikone:1335:1:1:0 + +[DenyConnection]