silcclient: auto-negotiation of private message key using SKE over SILCnet
[silc.git] / lib / silcclient / client.h
index d66808dcef168e06473e7168104b18f97430ce43..87441e53686520d339a80500e8016c3bb35c4d1a 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2007 Pekka Riikonen
+  Copyright (C) 1997 - 2014 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
@@ -32,6 +32,7 @@ typedef struct SilcChannelEntryStruct *SilcChannelEntry;
 typedef struct SilcServerEntryStruct *SilcServerEntry;
 
 typedef struct SilcClientKeyAgreementStruct *SilcClientKeyAgreement;
+typedef struct SilcClientAutonegMessageKeyStruct *SilcClientAutonegMessageKey;
 typedef struct SilcClientFtpSessionStruct *SilcClientFtpSession;
 typedef struct SilcClientCommandReplyContextStruct
                                            *SilcClientCommandReplyContext;
@@ -52,6 +53,11 @@ typedef struct SilcClientEntryInternalStruct {
   unsigned char *key;          /* Valid if application provided the key */
   SilcUInt32 key_len;          /* Key data length */
   SilcClientKeyAgreement ke;   /* Current key agreement context or NULL */
+  SilcAsyncOperation op;       /* Asynchronous operation with this client */
+
+  SilcClientAutonegMessageKey ake; /* Current auto-negotiation context */
+  SilcInt64 ake_rekey;         /* Next private message key auto-negotation */
+  SilcUInt32 ake_generation;   /* current AKE rekey generation */
 
   SilcAtomic32 refcnt;         /* Reference counter */
   SilcAtomic32 deleted;                /* Flag indicating whether the client object is
@@ -64,6 +70,9 @@ typedef struct SilcClientEntryInternalStruct {
   unsigned int generated   : 1; /* TRUE if library generated `key' */
   unsigned int prv_resp    : 1; /* TRUE if we are responder when using
                                   private message keys. */
+  unsigned int no_ake      : 1;        /* TRUE if client doesn't support
+                                  auto-negotiation of private message key,
+                                  or it doesn't work. */
 } SilcClientEntryInternal;
 
 /* Internal channel entry context */
@@ -101,6 +110,9 @@ typedef struct SilcServerEntryInternalStruct {
   SilcRwLock lock;                          /* Read/write lock */
   SilcUInt16 resolve_cmd_ident;                     /* Resolving identifier */
   SilcAtomic32 refcnt;                      /* Reference counter */
+  SilcAtomic32 deleted;                             /* Flag indicating whether the
+                                               server object is already
+                                               scheduled for deletion. */
 } SilcServerEntryInternal;
 
 #endif /* CLIENT_H */