+Wed Mar 14 16:10:30 EET 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+ * Changed the format of AdminConnection configuration section
+ in the server. Added username of the admin to the format.
+ Affected files silcd/serverconfig.[ch].
+
+ Added silc_server_config_find_admin into silcd/serverconfig.[ch]
+ to return admin configuration data by host, username and/or
+ nickname.
+
Wed Mar 14 13:18:16 EET 2001 Pekka Riikonen <priikone@poseidon.pspt.fi>
* Implemented WHOWAS command to the server. Added the functions:
/* Any host */
config->admins->host = strdup("*");
+ /* Get username */
+ ret = silc_config_get_token(line, &config->admins->username);
+ if (ret < 0)
+ break;
+ if (ret == 0)
+ /* Any username */
+ config->admins->username = strdup("*");
+
+ /* Get nickname */
+ ret = silc_config_get_token(line, &config->admins->nickname);
+ if (ret < 0)
+ break;
+ if (ret == 0)
+ /* Any nickname */
+ config->admins->nickname = strdup("*");
+
/* Get authentication method */
ret = silc_config_get_token(line, &tmp);
if (ret < 0)
if (ret < 0)
break;
- /* Get nickname */
- ret = silc_config_get_token(line, &config->admins->nickname);
- if (ret < 0)
- break;
-
- /* Get class number */
- ret = silc_config_get_token(line, &tmp);
- if (ret < 0)
- break;
- if (ret) {
- config->admins->class = atoi(tmp);
- silc_free(tmp);
- }
-
check = TRUE;
checkmask |= (1L << pc->section->type);
break;
return serv;
}
+/* Returns Admin connection configuration by host, username and/or
+ nickname. */
+
+SilcServerConfigSectionAdminConnection *
+silc_server_config_find_admin(SilcServerConfig config,
+ char *host, char *username, char *nickname)
+{
+ SilcServerConfigSectionAdminConnection *admin = NULL;
+ int i;
+
+ if (!config->admins)
+ return NULL;
+
+ if (!host)
+ host = "*";
+ if (!username)
+ username = "*";
+ if (nickname)
+ nickname = "*";
+
+ admin = config->admins;
+ for (i = 0; admin; i++) {
+ if (silc_string_compare(admin->host, host) &&
+ silc_string_compare(admin->username, username) &&
+ silc_string_compare(admin->nickname, nickname))
+ break;
+
+ admin = admin->next;
+ }
+
+ if (!admin)
+ return NULL;
+
+ return admin;
+}
+
/* Prints out example configuration file with default built in
configuration values. */
/* Hols all server's administrators authentication data from config file */
typedef struct SilcServerConfigSectionAdminConnectionStruct {
char *host;
+ char *username;
+ char *nickname;
int auth_meth;
char *auth_data;
- char *nickname;
- unsigned int class;
struct SilcServerConfigSectionAdminConnectionStruct *next;
struct SilcServerConfigSectionAdminConnectionStruct *prev;
} SilcServerConfigSectionAdminConnection;
SilcServerConfigSectionServerConnection *
silc_server_config_find_router_conn(SilcServerConfig config,
char *host, int port);
+SilcServerConfigSectionAdminConnection *
+silc_server_config_find_admin(SilcServerConfig config,
+ char *host, char *username, char *nickname);
void silc_server_config_print();
#endif
If the authentication method is password based, the Authentication
Data field includes the plaintext password. It is safe to send
-plaintext password since the entire payload is encrypted.
+plaintext password since the entire payload is encrypted. In this
+case the Public Data Lenght is set to zero (0).
If the authentication method is public key based (or certificate)
the Authentication Data is computed as follows:
#
# Format: <remote host>:<auth method>:<auth data>:<port>:<class>
#
+# The <auth data> is either passphrase or file path to the public key
+# file.
+#
[ClientConnection]
:::1333:1
#
# Configured server administrator connections
#
-# Format: <host>:<auth method>:<auth data>:<nickname hash>:<class>
+# Format: <host>:<username>:<nickname>:<auth method>:<auth data>
+#
+# The <auth data> is either passphrase or file path to the public key
+# file.
#
[AdminConnection]
-10.2.1.199:passwd:veryscret:XXX:1
+10.2.1.199:priikone:pekka:passwd:veryscret
#
# Configured server connections.
#
# Format: <remote host>:<auth method>:<auth data>:<port>:<version ID>:<vlass>
#
+# The <auth data> is either passphrase or file path to the public key
+# file.
+#
[ServerConnection]
10.2.1.7:passwd:veryscret:706:1:1
#
# Format: <remote host>:<auth method>:<auth data>:<port>:<version ID>:<class>:<initiator>
#
+# The <auth data> is either passphrase or file path to the public key
+# file.
+#
[RouterConnection]
#10.2.1.100:passwd:veryverysecret:706:1:1:1