updates.
[silc.git] / apps / silc / client_ops.c
index f7c3964c19513376349a307ad2eb35ebb8cb8006..985be666d654b7a2dd5b90225b7f254cb4d00aa8 100644 (file)
@@ -893,6 +893,28 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
       }
       break;
 
+    case SILC_COMMAND_GETKEY:
+      {
+       SilcIdType id_type;
+       void *entry;
+       SilcPublicKey public_key;
+       unsigned char *pk;
+       uint32 pk_len;
+
+       id_type = va_arg(vp, SilcIdType);
+       entry = va_arg(vp, void *);
+       public_key = va_arg(vp, SilcPublicKey);
+
+       pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+
+       if (id_type == SILC_ID_CLIENT) {
+         silc_verify_public_key(client, conn, SILC_SOCKET_TYPE_CLIENT,
+                                pk, pk_len, SILC_SKE_PK_TYPE_SILC);
+       }
+
+       silc_free(pk);
+      }
+
     default:
       break;
     }
@@ -1011,7 +1033,7 @@ int silc_verify_public_key(SilcClient client,
   snprintf(filename, sizeof(filename) - 1, "%s/.silc/%skeys/%s", 
           pw->pw_dir, entity, file);
 
-  /* Check wheter this key already exists */
+  /* Check whether this key already exists */
   if (stat(filename, &st) < 0) {
 
     fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
@@ -1210,17 +1232,17 @@ int silc_key_agreement(SilcClient client, SilcClientConnection conn,
 
 /* SILC client operations */
 SilcClientOperations ops = {
-  say:                  silc_say,
-  channel_message:      silc_channel_message,
-  private_message:      silc_private_message,
-  notify:               silc_notify,
-  command:              silc_command,
-  command_reply:        silc_command_reply,
-  connect:              silc_connect,
-  disconnect:           silc_disconnect,
-  get_auth_method:      silc_get_auth_method,
-  verify_public_key:    silc_verify_public_key,
-  ask_passphrase:       silc_ask_passphrase,
-  failure:              silc_failure,
-  key_agreement:        silc_key_agreement,
+  silc_say,
+  silc_channel_message,
+  silc_private_message,
+  silc_notify,
+  silc_command,
+  silc_command_reply,
+  silc_connect,
+  silc_disconnect,
+  silc_get_auth_method,
+  silc_verify_public_key,
+  silc_ask_passphrase,
+  silc_failure,
+  silc_key_agreement,
 };