From 8c98b99b3b9832234e106bf15e93e238a9cda70c Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 16 Apr 2002 10:38:16 +0000 Subject: [PATCH] updates. --- CHANGES | 7 +++++++ TODO | 3 +++ apps/silcd/packet_receive.c | 29 ++++++++++++++++++++++++++- doc/draft-riikonen-silc-pp-05.nroff | 2 +- doc/draft-riikonen-silc-spec-05.nroff | 28 +++++++++++++++++--------- prepare | 4 ++-- 6 files changed, 59 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index 8464a923..d7d67dc1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Tue Apr 16 09:34:40 EEST 2002 Pekka Riikonen + + * Defined that channel message to unknown Channel ID must + cause SILC_NOTIFY_TYPE_ERROR notify message to the sender. + Updated the protocol specs and the code in server. The + affected file is silcd/packet_receive.c. + Mon Apr 15 19:57:57 EEST 2002 Pekka Riikonen * Added new notify type SILC_NOTIFY_TYPE_ERROR and specified diff --git a/TODO b/TODO index e0a20a8f..6bcc7fa5 100644 --- a/TODO +++ b/TODO @@ -118,3 +118,6 @@ TODO in SILC Protocol 24. Implement the and the Attribute Payload to the core library, client and server. + + 25. Disconnect Payload change to include Status Type instead of + human readable error message? diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index d124a91c..428c1f7f 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -1682,7 +1682,34 @@ void silc_server_channel_message(SilcServer server, if (!channel) { channel = silc_idlist_find_channel_by_id(server->global_list, id, NULL); if (!channel) { - SILC_LOG_DEBUG(("Could not find channel")); + SilcBuffer idp; + unsigned char error; + + /* Send SILC_NOTIFY_TYPE_ERROR to indicate that such destination ID + does not exist or is invalid. */ + idp = silc_id_payload_encode_data(packet->dst_id, + packet->dst_id_len, + packet->dst_id_type); + if (!idp) + goto out; + + error = SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID; + if (packet->src_id_type == SILC_ID_CLIENT) { + SilcClientID *client_id = silc_id_str2id(packet->src_id, + packet->src_id_len, + packet->src_id_type); + silc_server_send_notify_dest(server, sock, FALSE, + client_id, SILC_ID_CLIENT, + SILC_NOTIFY_TYPE_ERROR, 2, + &error, 1, idp->data, idp->len); + silc_free(client_id); + } else { + silc_server_send_notify(server, sock, FALSE, + SILC_NOTIFY_TYPE_ERROR, 2, + &error, 1, idp->data, idp->len); + } + + silc_buffer_free(idp); goto out; } } diff --git a/doc/draft-riikonen-silc-pp-05.nroff b/doc/draft-riikonen-silc-pp-05.nroff index 21ec4048..818597f5 100644 --- a/doc/draft-riikonen-silc-pp-05.nroff +++ b/doc/draft-riikonen-silc-pp-05.nroff @@ -1706,7 +1706,7 @@ o Initial Vector (variable length) - The initial vector initial vector. This field is not encrypted. This field is not included into the padding calculation. Length of this field equals the cipher's block size. This field - is, however, authenticated. + is, however authenticated. .in 3 diff --git a/doc/draft-riikonen-silc-spec-05.nroff b/doc/draft-riikonen-silc-spec-05.nroff index 4611512d..9c62e583 100644 --- a/doc/draft-riikonen-silc-spec-05.nroff +++ b/doc/draft-riikonen-silc-spec-05.nroff @@ -922,7 +922,10 @@ tell to where the packet needs to be sent and where it is coming from. The header in the packet MUST NOT change during the routing of the packet. The original sender, for example client, assembles the packet and the packet header and server or router between the sender and the -receiver MUST NOT change the packet header. +receiver MUST NOT change the packet header. Note however, that some +packets such as commands may resent by a server to serve the client's +original command. In this case the command packet send by the server +includes the server's IDs. Note that the packet and the packet header may be encrypted with different keys. For example, packets to channels are encrypted with @@ -1975,8 +1978,8 @@ it should have cached the Client ID from the SILC Packet Header. If server receives a private message packet which includes invalid destionation Client ID the server MUST send SILC_NOTIFY_TYPE_ERROR -notify to the client with error status indicating that such ID does -not exist to the client. +notify to the client with error status indicating that such Client ID +does not exist. See [SILC2] for description of private message encryption and decryption process. @@ -2007,8 +2010,10 @@ ignored. After processing the key material it is employed as defined in [SILC3], however, the HMAC key material MUST be discarded. If the key is pre-shared-key or randomly generated the implementations -should use the SILC protocol's mandatory cipher as the cipher. If the -SKE was used to negotiate key material the cipher was negotiated as well. +SHOULD use the SILC protocol's mandatory cipher as the cipher. If the +SKE was used to negotiate key material the cipher was negotiated as well, +and may be different from default cipher. + .ti 0 4.7 Channel Message Sending and Reception @@ -2022,11 +2027,13 @@ as Destination ID in the SILC Packet Header. The server MUST then distribute the message to all clients on the channel by sending the channel message destined explicitly to a client on the channel. -See the [SILC2] for description of channel messege routing for router -servers. +If server receives a channel message packet which includes invalid +destionation Channel ID the server MUST send SILC_NOTIFY_TYPE_ERROR +notify to the sender with error status indicating that such Channel ID +does not exist. -See [SILC2] for description of channel message encryption and decryption -process. +See the [SILC2] for description of channel messege routing for router +servers, and channel message encryption and decryption process. .ti 0 @@ -2071,7 +2078,8 @@ MUST be protected with the new key. Client usually sends the commands in the SILC network. In this case the client simply sends the command packet to server and the server -processes it and replies with command reply packet. +processes it and replies with command reply packet. See the [SILC3] +for detailed description of all commands. However, if the server is not able to process the command, it is sent to the server's router. This is case for example with commands such diff --git a/prepare b/prepare index f5cfff57..87f53dd2 100755 --- a/prepare +++ b/prepare @@ -126,14 +126,14 @@ cp Makefile.defines.in lib/silcmath/mpi cp Makefile.defines_int.in lib/silcmath/mpi aclocal -autoconf +/home/silc/share/bin/autoconf autoheader >/dev/null 2>/dev/null automake echo "Preparing mpi" cd lib/silcmath/mpi aclocal -autoconf +/home/silc/share/bin/autoconf autoheader /dev/null automake >/dev/null 2>/dev/null cd ../../.. -- 2.24.0