updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 1 Nov 2001 20:17:58 +0000 (20:17 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 1 Nov 2001 20:17:58 +0000 (20:17 +0000)
CHANGES
lib/silcclient/command_reply.c
lib/silcclient/idlist.c
lib/silcclient/idlist.h

diff --git a/CHANGES b/CHANGES
index 0617c7e583ff8eb05e2046aa3a77fa4a2cfec127..1aff35ca6e504b8e80a215c5ebee1cf6ab50cf4e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,15 @@
+Thu Nov  1 22:10:07 EST 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * Defined to WHOIS command reply the sending of fingerprint
+         of the client's public key (if the proof of posession of the
+         corresponding private key is verified by the server).
+         Updated to the protocol specification.
+
+       * Added support of receiving the client's public key's 
+         fingerprint in command reply in client library.  Affected
+         file is lib/silcclient/command_reply.c, and
+         lib/silcclient/idlist.[ch].
+
 Thu Nov  1 18:06:12 EST 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Do not send over 128 chars long nickname to the server
index e6a778690a7d84683012b96fcf41eb9063d49a6b..a6ce15b7be312aed62252591148a1010f5b25fcf 100644 (file)
@@ -239,6 +239,8 @@ silc_client_command_reply_whois_save(SilcClientCommandReplyContext cmd,
   char *realname = NULL;
   uint32 idle = 0, mode = 0;
   SilcBuffer channels = NULL;
+  unsigned char *fingerprint;
+  uint32 fingerprint_len;
   
   argc = silc_argument_get_arg_num(cmd->args);
 
@@ -277,6 +279,8 @@ silc_client_command_reply_whois_save(SilcClientCommandReplyContext cmd,
   if (tmp)
     SILC_GET32_MSB(idle, tmp);
 
+  fingerprint = silc_argument_get_arg_type(cmd->args, 9, &fingerprint_len);
+
   /* Check if we have this client cached already. */
   if (!silc_idcache_find_by_id_one_ext(conn->client_cache, (void *)client_id, 
                                       NULL, NULL, 
@@ -293,6 +297,14 @@ silc_client_command_reply_whois_save(SilcClientCommandReplyContext cmd,
     silc_free(client_id);
   }
 
+  if (fingerprint && !client_entry->fingerprint) {
+    client_entry->fingerprint = 
+      silc_calloc(fingerprint_len, 
+                 sizeof(*client_entry->fingerprint));
+    memcpy(client_entry->fingerprint, fingerprint, fingerprint_len);
+    client_entry->fingerprint_len = fingerprint_len;
+  }
+
   if (client_entry->status & SILC_CLIENT_STATUS_RESOLVING)
     client_entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
 
index 45b91af63be83cc43f66f30693201022a5effa1d..3444819810314278c8bb2cb9911f81317fc9ef62 100644 (file)
@@ -646,6 +646,7 @@ void silc_client_del_client_entry(SilcClient client,
   silc_free(client_entry->realname);
   silc_free(client_entry->server);
   silc_free(client_entry->id);
+  silc_free(client_entry->fingerprint);
   if (client_entry->send_key)
     silc_cipher_free(client_entry->send_key);
   if (client_entry->receive_key)
index 396d024b8ef4c97cb864b1aaefb4528fb61b1481..26b38e010e3311aa9b76ccc6b4da4b031d4d2bf2 100644 (file)
@@ -39,6 +39,8 @@ typedef struct {
   uint32 num;
   uint32 mode;                 /* User mode in SILC */
   SilcClientID *id;            /* The Client ID */
+  unsigned char *fingerprint;  /* Fingerprint of client's public key */
+  uint32 fingerprint_len;      /* Length of the fingerprint */
   bool valid;                  /* FALSE if this entry is not valid */
   SilcCipher send_key;         /* Private message key for sending */
   SilcCipher receive_key;      /* Private message key for receiving */