Fixed channel key setting.
[silc.git] / lib / silcclient / client.h
index 1f3d0d2bfa68dca3726eef8f59da4825ad418624..1a6da14ebbdd0547ccb7e7ad5364aa1665a663e9 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2006 Pekka Riikonen
+  Copyright (C) 1997 - 2007 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
@@ -39,7 +39,7 @@ typedef struct SilcClientCommandReplyContextStruct
 typedef struct SilcChannelUserStruct *SilcChannelUser;
 typedef struct SilcClientInternalStruct *SilcClientInternal;
 typedef struct SilcClientConnectionInternalStruct
-                                          *SilcClientConnectionInternal;
+     *SilcClientConnectionInternal;
 typedef struct SilcChannelPrivateKeyStruct *SilcChannelPrivateKey;
 
 
@@ -57,8 +57,8 @@ typedef struct SilcClientEntryInternalStruct {
   unsigned int valid       : 1;        /* FALSE if this entry is not valid */
   unsigned int resolving   : 1; /* TRUE when entry is being resolved */
   unsigned int generated   : 1; /* TRUE if library generated `key' */
-  unsigned int prv_resp    : 1; /* TRUE if private message key indicator
-                                  has been received (responder). */
+  unsigned int prv_resp    : 1; /* TRUE if we are responder when using
+                                  private message keys. */
   SilcUInt16 resolve_cmd_ident;        /* Command identifier when resolving */
   SilcAtomic8 refcnt;          /* Reference counter */
 } SilcClientEntryInternal;
@@ -74,12 +74,18 @@ typedef struct SilcChannelEntryInternalStruct {
   SilcChannelPrivateKey curr_key;           /* Current private key */
 
   /* Channel keys */
-  SilcCipher channel_key;                    /* The channel key */
+  SilcCipher send_key;                       /* The channel key */
+  SilcCipher receive_key;                    /* The channel key */
   SilcHmac hmac;                            /* Current HMAC */
   unsigned char iv[SILC_CIPHER_MAX_IV_SIZE]; /* Current IV */
 
-  SilcUInt16 resolve_cmd_ident;                     /* Resolving identifier */
-  SilcAtomic8 refcnt;                       /* Reference counter */
+  SilcUInt16 resolve_cmd_ident;                     /* Channel information resolving
+                                               identifier. This is used when
+                                               resolving users, and other
+                                               stuff that relates to the
+                                               channel. Not used for the
+                                               channel resolving itself. */
+  SilcAtomic16 refcnt;                      /* Reference counter */
 } SilcChannelEntryInternal;
 
 /* Internal server entry context */