Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
The header is variable in length and first two (2) bytes of the
header (thus first two bytes of the packet) are not encrypted. The
first two (2) bytes are the length of the packet which is not encrypted.
-See following section for description of SILC Packet header. Packets
+See The following section for description of SILC Packet header. Packets
without SILC header or with malformed SILC header must be dropped.
Padding follows the packet header. The purpose of the padding is to
the packet header to parse the packet and gain other relevant parameters
of the packet.
-Following diagram represents the default SILC header format.
+The following diagram represents the default SILC header format.
(*) indicates that this field is never encrypted. Other fields are
always encrypted.
processing. Several flags may be set by ORing the flags
together.
- Following flags are reserved for this field:
+ The following flags are reserved for this field:
No flags 0x00
This payload can be used to send an ID. ID's are variable length thus
this payload provides a way to send variable length ID's.
-Following diagram represents the ID Payload.
+The following diagram represents the ID Payload.
.in 5
.nf
associated with a packet must be indicated by the packet payload who
needs the arguments. Argument Payloads must always reside right after
the packet payload needing the arguments. Incorrect amount of argument
-payloads must cause rejection of the packet. Following diagram represents
+payloads must cause rejection of the packet. The following diagram represents
the Argument Payload.
reason of disconnection is sent to the disconnected party.
The payload may only be sent with SILC_PACKET_DISCONNECT packet. It
-must not be sent in any other packet type. Following diagram represents
+must not be sent in any other packet type. The following diagram represents
the Disconnect Payload.
contents of the payload, however, notify message should be audited.
The payload may only be sent with SILC_PACKET_NOTIFY packet. It must
-not be sent in any other packet type. Following diagram represents the
+not be sent in any other packet type. The following diagram represents the
Notify Payload.
.in 5
arguments to be send along the notify message.
.in 3
-Following list of currently defined notify types. The format for notify
+The following list of currently defined notify types. The format for notify
arguments is same as in SILC commands described in [SILC1]. Also, all
ID's sent in arguments are sent inside ID Payload.
the message.
The payload may only be sent with SILC_PACKET_CHANNEL_MESSAGE packet.
-It must not be sent in any other packet type. Following diagram
+It must not be sent in any other packet type. The following diagram
represents the Channel Message Payload.
(*) indicates that the field is not encrypted.
which case new channel key is created and distributed.
The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
-It must not be sent in any other packet type. Following diagram
+It must not be sent in any other packet type. The following diagram
represents the Channel Key Payload.
this scheme as well.
The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE
-packet. It must not be sent in any other packet type. Following
+packet. It must not be sent in any other packet type. The following
diagram represents the Private Message Payload.
flag into SILC Packet Header.
The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
-packet. It must not be sent in any other packet type. Following
+packet. It must not be sent in any other packet type. The following
diagram represents the Private Message Key Payload.
2.3.13 Command Payload
Command Payload is used to send SILC commands from client to server.
-Also server may send commands to other servers. Following diagram
+Also server may send commands to other servers. The following diagram
represents the Command Payload.
Exchange Start Payload in [SILC3] for detailed information.
The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
-packet. It must not be sent in any other packet type. Following
+packet. It must not be sent in any other packet type. The following
diagram represents the Connection Auth Request Payload.
.in 6
o Connection Type (2 bytes) - Indicates the type of the ID.
- Following connection types are defined:
+ The following connection types are defined:
1 Client connection
2 Server connection
discarded and the authentication must be failed.
o Authentication Method (2 bytes) - Indicates the authentication
- method to be used in the authentication protocol. Following
+ method to be used in the authentication protocol. The following
authentication methods are defined:
client ID.
The payload may only be sent with SILC_PACKET_NEW_CLIENT packet. It
-must not be sent in any other packet type. Following diagram represents
+must not be sent in any other packet type. The following diagram represents
the New Client Payload.
name of the server that is associated to the Server ID.
The payload may only be sent with SILC_PACKET_NEW_SERVER packet. It
-must not be sent in any other packet type. Following diagram represents
+must not be sent in any other packet type. The following diagram represents
the New Server Payload.
this packet.
The payload may only be sent with SILC_PACKET_NEW_CHANNEL packet.
-It must not be sent in any other packet type. Following diagram
+It must not be sent in any other packet type. The following diagram
represents the New Channel Payload.
2.4 SILC ID Types
ID's are extensively used in the SILC network to associate different
-entities. Following ID's has been defined to be used in the SILC
+entities. The following ID's has been defined to be used in the SILC
network.
.in 6
of it, usually first 16 bytes of it. Then the receiver checks the
packet type from the decrypted part of the header and can determine
how the rest of the packet must be decrypted. If the packet type is
-any of the special cases described in following sections the packet
+any of the special cases described in The following sections the packet
decryption is special. If the packet type is not among those special
packet types rest of the packet may be decrypted with the same key.
common and core components of SILC protocol from lib/silccore library and
normal utility routines from lib/silcutil library. The library has been
designed to be complete SILC Client implementation without actual user
-interface. The library provides API for the application which can use
-it to implement generally what ever user interface it wants.
+interface. The library provides the API for the application which it can
+use to implement generally whatever user interface it wants.
The `ops.h' file defines the function prototypes that application must
implement in order to be able to create the user interface with the
-library. The idea is that the application can implement what ever user
-interface routines in the functions and display the data what ever way
+library. The idea is that the application can implement whatever user
+interface routines in the functions and display the data whatever way
it wants. The library is entirely transparent to the user interface and
it does not include any user interface specific issues such as window
handling or item handling on the screen etc. These does not interest
the library.
-
Creating Client
===============
get_auth_method: silc_get_auth_method,
verify_server_key: silc_verify_server_key,
ask_passphrase: silc_ask_passphrase,
+ failure: silc_failure,
};
Application might not want to use silc_client_connect_to_server function
if it wants to perform its own connecting for some reason. In this case
application must call function silc_client_start_key_exchange after it
-has created the connection by itself. This function starts key exhange
+has created the connection by itself. This function starts the key exhange
protocol between the client and server and the library takes care of
everything after that.
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
SilcCipher cipher;
SilcHmac hmac;
unsigned char *id_string;
+ unsigned int block_len;
SILC_LOG_DEBUG(("Sending packet to channel"));
}
/* Generate IV */
+ block_len = silc_cipher_get_block_len(channel->channel_key);
if (channel->iv[0] == '\0')
- for (i = 0; i < 16; i++) channel->iv[i] = silc_rng_get_byte(client->rng);
+ for (i = 0; i < block_len; i++) channel->iv[i] = silc_rng_get_byte(client->rng);
else
- silc_hash_make(client->md5hash, channel->iv, 16, channel->iv);
+ silc_hash_make(client->md5hash, channel->iv, block_len, channel->iv);
/* Encode the channel payload */
- payload = silc_channel_payload_encode(data_len, data, 16, channel->iv,
- client->rng);
+ payload = silc_channel_payload_encode(data_len, data, block_len,
+ channel->iv, client->rng);
if (!payload) {
client->ops->say(client, conn,
"Error: Could not create packet to be sent to channel");
packetdata.buffer = sock->outbuf;
- SILC_LOG_HEXDUMP(("IV"), channel->iv, 16);
- SILC_LOG_HEXDUMP(("channel key"), channel->key, channel->key_len/8);
-
/* Encrypt payload of the packet. This is encrypted with the channel key. */
channel->channel_key->cipher->encrypt(channel->channel_key->context,
payload->data, payload->data,
- payload->len - 16, /* -IV_LEN */
+ payload->len - block_len, /* -IV_LEN */
channel->iv);
/* Put the actual encrypted payload data into the buffer. */
SilcIDCacheEntry id_cache = NULL;
SilcClientID *client_id = NULL;
int found = FALSE;
+ unsigned int block_len;
/* Sanity checks */
if (packet->dst_id_type != SILC_ID_CHANNEL)
channel = (SilcChannelEntry)id_cache->context;
- SILC_LOG_HEXDUMP(("channel key"), channel->key, channel->key_len);
-
/* Decrypt the channel message payload. Push the IV out of the way,
since it is not encrypted (after pushing buffer->tail has the IV). */
- SILC_LOG_HEXDUMP(("Packet"), buffer->data, buffer->len);
- silc_buffer_push_tail(buffer, channel->channel_key->cipher->block_len);
- SILC_LOG_HEXDUMP(("Packet"), buffer->data, buffer->len);
- SILC_LOG_HEXDUMP(("IV"), buffer->tail, 16);
+ block_len = silc_cipher_get_block_len(channel->channel_key);
+ silc_buffer_push_tail(buffer, block_len);
channel->channel_key->cipher->decrypt(channel->channel_key->context,
buffer->data, buffer->data,
buffer->len, buffer->tail);
- SILC_LOG_HEXDUMP(("Packet"), buffer->data, buffer->len);
- silc_buffer_pull_tail(buffer, channel->channel_key->cipher->block_len);
- SILC_LOG_HEXDUMP(("Packet"), buffer->data, buffer->len);
+ silc_buffer_pull_tail(buffer, block_len);
/* Parse the channel message payload */
payload = silc_channel_payload_parse(buffer);
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by