unsigned int tmp_len;
unsigned int port = SILC_PORT;
- SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CONNECT, cmd, 1, 2);
+ SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CONNECT, cmd, 0, 0);
if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT)
goto out;
unsigned char *name;
unsigned int port = SILC_PORT;
- SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CLOSE, cmd, 1, 2);
+ SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CLOSE, cmd, 0, 0);
if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT)
goto out;
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-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
Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi
[ServerInfo]
-lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1334
+lassi.kuo.fi.ssh.com:10.2.1.7:Kuopio, Finland:1334
[ListenPort]
-212.146.42.253:212.146.42.253:1334
+10.2.1.7:10.2.1.7:1334
[Logging]
infologfile:silcd2.log:10000
[AdminConnection]
[ServerConnection]
-212.146.42.253:passwd:priikone:1333:1:1
+10.2.1.7:passwd:priikone:1333:1:1
[RouterConnection]
-212.146.42.253:passwd:priikone:1335:1:1:0
+10.2.1.7:passwd:priikone:1335:1:1:0
[DenyConnection]
[RedirectClient]
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 < block_len; i++) channel->iv[i] = silc_rng_get_byte(client->rng);
+ for (i = 0; i < 16; i++) channel->iv[i] = silc_rng_get_byte(client->rng);
else
- silc_hash_make(client->md5hash, channel->iv, block_len, channel->iv);
+ silc_hash_make(client->md5hash, channel->iv, 16, channel->iv);
/* Encode the channel payload */
- payload = silc_channel_payload_encode(data_len, data, block_len,
- channel->iv, client->rng);
+ payload = silc_channel_payload_encode(data_len, data, 16, 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 - block_len, /* -IV_LEN */
+ payload->len - 16, /* -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). */
- block_len = silc_cipher_get_block_len(channel->channel_key);
- silc_buffer_push_tail(buffer, block_len);
+ 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);
channel->channel_key->cipher->decrypt(channel->channel_key->context,
buffer->data, buffer->data,
buffer->len, buffer->tail);
- silc_buffer_pull_tail(buffer, block_len);
+ 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);
/* Parse the channel message payload */
payload = silc_channel_payload_parse(buffer);