From: Pekka Riikonen Date: Thu, 1 Nov 2001 20:17:58 +0000 (+0000) Subject: updates. X-Git-Tag: silcertest~53 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=f5b4db198e71aafaec2db4eac043d2ae0151dfac updates. --- diff --git a/CHANGES b/CHANGES index 0617c7e5..1aff35ca 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +Thu Nov 1 22:10:07 EST 2001 Pekka Riikonen + + * 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 * Do not send over 128 chars long nickname to the server diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index e6a77869..a6ce15b7 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -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; diff --git a/lib/silcclient/idlist.c b/lib/silcclient/idlist.c index 45b91af6..34448198 100644 --- a/lib/silcclient/idlist.c +++ b/lib/silcclient/idlist.c @@ -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) diff --git a/lib/silcclient/idlist.h b/lib/silcclient/idlist.h index 396d024b..26b38e01 100644 --- a/lib/silcclient/idlist.h +++ b/lib/silcclient/idlist.h @@ -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 */