Resolve public key in JOIN for founder auth. Bug #53.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 6 Nov 2002 16:56:59 +0000 (16:56 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 6 Nov 2002 16:56:59 +0000 (16:56 +0000)
CHANGES
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index 064ef49b98423280935f5f26b92617782e32616a..73b612480ef1fb0a77b23e11a26691e580f58169 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,11 @@ Wed Nov  6 17:18:13 EET 2002  Pekka Riikonen <priikone@silcnet.org>
        * Fixed silc_get_input to NULL-terminate the returned input.
          Affected file lib/silcutil/silcutil.c.
 
+       * Resolve the client's public key in JOIN command if the
+         founder auth data is being requested but we don't know the
+         client's public key.  Affected file silcd/command.c.
+         Bug #53.
+
 Mon Nov  4 16:02:59 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Print notify for server opers when backup router comes
index 560fcec1f29e6613c60a23732ef8060de76585c5..b1e908547b39119edb86b0a5dece006e07b300f8 100644 (file)
@@ -1737,6 +1737,25 @@ static void silc_server_command_join_channel(SilcServer server,
       goto out;
     }
 
+    if (auth && auth_len && !client->data.public_key) {
+      if (cmd->pending == 2)
+       goto out;
+
+      /* We must retrieve the detached client's public key by sending
+        GETKEY command. Reprocess this packet after receiving the key */
+      clidp = silc_id_payload_encode(client_id, SILC_ID_CLIENT);
+      silc_server_send_command(server, cmd->sock,
+                              SILC_COMMAND_GETKEY, ++server->cmd_ident,
+                              1, 1, clidp->data, clidp->len);
+      silc_buffer_free(clidp);
+      silc_server_command_pending(server, SILC_COMMAND_GETKEY,
+                                 server->cmd_ident,
+                                 silc_server_command_join, 
+                                 silc_server_command_dup(cmd));
+      cmd->pending = 2;
+      goto out;
+    }
+
     cmd->pending = FALSE;
   }