updates.
[silc.git] / apps / silcd / command.c
index d5fe84db3e5fbc6d819df439903eda74d36dac82..2828d81b2e21af11015606bf956725b2cd875b1c 100644 (file)
@@ -528,7 +528,7 @@ typedef struct {
   uint32 res_argc;
 } *SilcServerResolveContext;
 
-static char
+static bool
 silc_server_command_whois_check(SilcServerCommandContext cmd,
                                SilcClientEntry *clients,
                                uint32 clients_count)
@@ -538,6 +538,7 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
   SilcServerResolveContext resolve = NULL, r = NULL;
   uint32 resolve_count = 0;
   int i, k;
+  bool no_res = TRUE;
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
@@ -557,6 +558,7 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
                                  silc_server_command_destructor,
                                  silc_server_command_whois,
                                  silc_server_command_dup(cmd));
+      no_res = FALSE;
     } else {
       if (entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
        /* We've resolved this and it still is not ready.  We'll return
@@ -631,7 +633,7 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
                                          r->ident);
     silc_server_packet_send(server, r->router->connection,
                            SILC_PACKET_COMMAND, cmd->packet->flags,
-                           res_cmd->data, res_cmd->len, TRUE);
+                           res_cmd->data, res_cmd->len, FALSE);
 
     /* Reprocess this packet after received reply */
     silc_server_command_pending(server, SILC_COMMAND_WHOIS, 
@@ -647,13 +649,11 @@ silc_server_command_whois_check(SilcServerCommandContext cmd,
     silc_free(r->res_argv);
     silc_free(r->res_argv_lens);
     silc_free(r->res_argv_types);
+    no_res = FALSE;
   }
   silc_free(resolve);
 
-  if (resolve_count)
-    return FALSE;
-
-  return TRUE;
+  return no_res;
 }
 
 static void
@@ -1473,7 +1473,7 @@ silc_server_command_identify_parse(SilcServerCommandContext cmd,
    then send WHOIS request to the server who owns the client. We use
    WHOIS because we want to get as much information as possible at once. */
 
-static char
+static bool
 silc_server_command_identify_check_client(SilcServerCommandContext cmd,
                                          SilcClientEntry *clients,
                                          uint32 clients_count)
@@ -1483,6 +1483,7 @@ silc_server_command_identify_check_client(SilcServerCommandContext cmd,
   SilcServerResolveContext resolve = NULL, r = NULL;
   uint32 resolve_count = 0;
   int i, k;
+  bool no_res = TRUE;
 
   for (i = 0; i < clients_count; i++) {
     entry = clients[i];
@@ -1502,6 +1503,7 @@ silc_server_command_identify_check_client(SilcServerCommandContext cmd,
                                  silc_server_command_destructor,
                                  silc_server_command_identify,
                                  silc_server_command_dup(cmd));
+      no_res = FALSE;
     } else {
       if (entry->data.status & SILC_IDLIST_STATUS_RESOLVING) {
        /* We've resolved this and it still is not ready.  We'll return
@@ -1576,7 +1578,7 @@ silc_server_command_identify_check_client(SilcServerCommandContext cmd,
                                          r->ident);
     silc_server_packet_send(server, r->router->connection,
                            SILC_PACKET_COMMAND, cmd->packet->flags,
-                           res_cmd->data, res_cmd->len, TRUE);
+                           res_cmd->data, res_cmd->len, FALSE);
 
     /* Reprocess this packet after received reply */
     silc_server_command_pending(server, SILC_COMMAND_WHOIS, 
@@ -1592,13 +1594,11 @@ silc_server_command_identify_check_client(SilcServerCommandContext cmd,
     silc_free(r->res_argv);
     silc_free(r->res_argv_lens);
     silc_free(r->res_argv_types);
+    no_res = FALSE;
   }
   silc_free(resolve);
 
-  if (resolve_count)
-    return FALSE;
-
-  return TRUE;
+  return no_res;
 }
 
 static void
@@ -3811,7 +3811,7 @@ SILC_SERVER_CMD_FUNC(cmode)
 
       /* Delete old cipher and allocate default one */
       silc_cipher_free(channel->channel_key);
-      if (!silc_cipher_alloc(cipher ? cipher : "aes-256-cbc"
+      if (!silc_cipher_alloc(cipher ? cipher : SILC_DEFAULT_CIPHER
                             &channel->channel_key)) {
        silc_server_command_send_status_reply(cmd, SILC_COMMAND_CMODE,
                                   SILC_STATUS_ERR_UNKNOWN_ALGORITHM);
@@ -3868,7 +3868,7 @@ SILC_SERVER_CMD_FUNC(cmode)
 
       /* Delete old hmac and allocate default one */
       silc_hmac_free(channel->hmac);
-      if (!silc_hmac_alloc(hmac ? hmac : "hmac-sha1-96", NULL, 
+      if (!silc_hmac_alloc(hmac ? hmac : SILC_DEFAULT_HMAC, NULL, 
                           &channel->hmac)) {
        silc_server_command_send_status_reply(cmd, SILC_COMMAND_CMODE,
                                       SILC_STATUS_ERR_UNKNOWN_ALGORITHM);