+Fri Mar 9 12:40:42 EET 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+ * Minor fix t the channel payload; allocate the data area, as it
+ needs to be of specific length.
+
+ * If the key agreement port is zero then the operating
+ system will define the bound port. Affected files are
+ lib/silcclient/silcapi.h and lib/silcclient/client_keyagr.c.
+
Thu Mar 8 21:39:03 EET 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
* Added assert()s to buffer formatting and unformatting routines
with this key except channel messages; channels has their own keys and
they are not exchanged with this protocol.
+The Diffie-Hellman implementation used in the SILC should be compliant
+to the PKCS #3.
+
.ti 0
2.1 Key Exchange Payloads
that port for the key agreement protocol. It also sends the `hostname'
and the `port' in the key agreement packet to the remote client. This
would indicate that the remote client may initiate the key agreement
- protocol to the `hostname' on the `port'.
+ protocol to the `hostname' on the `port'. If port is zero then the
+ bound port is undefined (the operating system defines it).
If the `hostname' and `port' is not provided then empty key agreement
packet is sent to the remote client. The remote client may reply with
return;
/* Create the listener if hostname and port was provided */
- if (hostname && port) {
+ if (hostname) {
ke = silc_calloc(1, sizeof(*ke));
ke->fd = silc_net_create_server(port, hostname);
that port for the key agreement protocol. It also sends the `hostname'
and the `port' in the key agreement packet to the remote client. This
would indicate that the remote client may initiate the key agreement
- protocol to the `hostname' on the `port'.
+ protocol to the `hostname' on the `port'. If port is zero then the
+ bound port is undefined (the operating system defines it).
If the `hostname' and `port' is not provided then empty key agreement
packet is sent to the remote client. The remote client may reply with
/* Parse the Channel Payload. Ignore the padding. */
ret = silc_buffer_unformat(buffer,
- SILC_STR_UI16_NSTRING(&new->data,
- &new->data_len),
+ SILC_STR_UI16_NSTRING_ALLOC(&new->data,
+ &new->data_len),
SILC_STR_UI16_NSTRING(NULL, NULL),
SILC_STR_UI_XNSTRING(&new->mac, mac_len),
SILC_STR_UI_XNSTRING(&new->iv, iv_len),
return new;
err:
- silc_free(new);
+ silc_channel_payload_free(new);
return NULL;
}
void silc_channel_payload_free(SilcChannelPayload payload)
{
- if (payload)
+ if (payload) {
+ if (payload->data)
+ silc_free(payload->data);
silc_free(payload);
+ }
}
/* Return data */
void (*set_iv)(struct SilcCipherStruct *, const unsigned char *);
void (*get_iv)(struct SilcCipherStruct *, unsigned char *);
- unsigned int (*get_key_len)(struct SilcCipherStruct *,
- const unsigned char *);
+ unsigned int (*get_key_len)(struct SilcCipherStruct *);
unsigned int (*get_block_len)(struct SilcCipherStruct *);
} *SilcCipher;
/* Set the socket information for bind() */
memset(&server, 0, sizeof(server));
server.sin_family = PF_INET;
- server.sin_port = htons(port);
+ if (port)
+ server.sin_port = htons(port);
/* Convert IP address to network byte order */
if (ip_addr)