updates.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 9 Mar 2001 10:44:01 +0000 (10:44 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 9 Mar 2001 10:44:01 +0000 (10:44 +0000)
CHANGES
doc/draft-riikonen-silc-ke-auth-01.nroff
lib/silcclient/client_keyagr.c
lib/silcclient/silcapi.h
lib/silccore/silcchannel.c
lib/silccrypt/silccipher.h
lib/silcutil/silcnet.c

diff --git a/CHANGES b/CHANGES
index 47f3c148a4db95c6c1df3682ec353ac7120a527d..7d100fb51aace009e0f2a5a4bf7ff4799acc6035 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+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
 Thu Mar  8 21:39:03 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added assert()s to buffer formatting and unformatting routines
index 87030a7cbeda71c7c35e59a256aa5d73a26a3c57..27176028ee689e40a94969435a348ca45e40a9f4 100644 (file)
@@ -166,6 +166,9 @@ servers.  In client connections usually all the packets are protected
 with this key except channel messages; channels has their own keys and 
 they are not exchanged with this protocol.
 
 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
 
 .ti 0
 2.1 Key Exchange Payloads
index ca62805cfbfdfdb963f082d422b4f38d3e8ea4f9..487b8b5b7e6ae94bb77a2f6a035e2b5dbcb675fb 100644 (file)
@@ -222,7 +222,8 @@ SILC_TASK_CALLBACK(silc_client_key_agreement_timeout)
    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
    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
 
    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
@@ -268,7 +269,7 @@ void silc_client_send_key_agreement(SilcClient client,
     return;
 
   /* Create the listener if hostname and port was provided */
     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);
 
     ke = silc_calloc(1, sizeof(*ke));
     ke->fd = silc_net_create_server(port, hostname);
 
index a546b9573362b30d9e059a021987b0fa0781a8d9..67372a55c53f699b3e219352993030e89050304d 100644 (file)
@@ -560,7 +560,8 @@ void silc_client_free_channel_private_keys(SilcChannelPrivateKey *keys,
    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
    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
 
    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
index 54409ec1ae1e9b792a2084b7202bd63b3750ac70..b3956cd291408c6193f459678d14673d57382c9b 100644 (file)
@@ -85,8 +85,8 @@ SilcChannelPayload silc_channel_payload_parse(SilcBuffer buffer,
 
   /* Parse the Channel Payload. Ignore the padding. */
   ret = silc_buffer_unformat(buffer,
 
   /* 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),
                             SILC_STR_UI16_NSTRING(NULL, NULL),
                             SILC_STR_UI_XNSTRING(&new->mac, mac_len),
                             SILC_STR_UI_XNSTRING(&new->iv, iv_len),
@@ -102,7 +102,7 @@ SilcChannelPayload silc_channel_payload_parse(SilcBuffer buffer,
   return new;
 
  err:
   return new;
 
  err:
-  silc_free(new);
+  silc_channel_payload_free(new);
   return NULL;
 }
 
   return NULL;
 }
 
@@ -175,8 +175,11 @@ SilcBuffer silc_channel_payload_encode(unsigned short data_len,
 
 void silc_channel_payload_free(SilcChannelPayload payload)
 {
 
 void silc_channel_payload_free(SilcChannelPayload payload)
 {
-  if (payload)
+  if (payload) {
+    if (payload->data)
+      silc_free(payload->data);
     silc_free(payload);
     silc_free(payload);
+  }
 }
 
 /* Return data */
 }
 
 /* Return data */
index 65ef26eee2837ee468d4f0dd6239dc0cc1b5aafd..fe764bd0ee097d821fa8c9b506ebb9585dfd5084 100644 (file)
@@ -66,8 +66,7 @@ typedef struct SilcCipherStruct {
 
   void (*set_iv)(struct SilcCipherStruct *, const unsigned char *);
   void (*get_iv)(struct SilcCipherStruct *, unsigned char *);
 
   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;
 
   unsigned int (*get_block_len)(struct SilcCipherStruct *);
 } *SilcCipher;
 
index 78d7ce6b233d490864ff9b1cb24632f3701e5358..6914ccceecbb817e3dfa40d81efee11865f0123e 100644 (file)
@@ -52,7 +52,8 @@ int silc_net_create_server(int port, char *ip_addr)
   /* Set the socket information for bind() */
   memset(&server, 0, sizeof(server));
   server.sin_family = PF_INET;
   /* 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)
 
   /* Convert IP address to network byte order */
   if (ip_addr)