serverconfig.c
- Author: Giovanni Giacobbi <giovanni@giacobbi.net>
+ Authors: Giovanni Giacobbi <giovanni@giacobbi.net>
+ Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2014 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
CONFIG_IS_DOUBLE(server_info->server_type);
server_info->server_type = strdup((char *) val);
}
- else if (!strcmp(name, "externalip")) {
- CONFIG_IS_DOUBLE(server_info->external_ip);
- server_info->external_ip = strdup((char *) val);
- }
else if (!strcmp(name, "admin")) {
CONFIG_IS_DOUBLE(server_info->admin);
server_info->admin = strdup((char *) val);
SILC_SERVER_LOG_ERROR(("Error: Could not load private key file."));
return SILC_CONFIG_EPRINTLINE;
}
+
+ /* Warn if key length is < 4096 (some versions created 4095 bit keys). */
+ if (silc_pkcs_private_key_get_len(server_info->private_key) < 4095) {
+ fprintf(stderr,
+ "warning: Your server private key %s length is under 4096 bits. "
+ "It is recommended to use at least 4096 bits. Consider "
+ "generating a new server key pair.\n", file_tmp);
+ }
}
else
return SILC_CONFIG_EINTERNAL;
{ "primary", SILC_CONFIG_ARG_BLOCK, fetch_serverinfo, table_serverinfo_c},
{ "secondary", SILC_CONFIG_ARG_BLOCK, fetch_serverinfo, table_serverinfo_c},
{ "servertype", SILC_CONFIG_ARG_STR, fetch_serverinfo, NULL},
- { "externalip", SILC_CONFIG_ARG_STR, fetch_serverinfo, NULL},
{ "location", SILC_CONFIG_ARG_STR, fetch_serverinfo, NULL},
{ "admin", SILC_CONFIG_ARG_STR, fetch_serverinfo, NULL},
{ "adminemail", SILC_CONFIG_ARG_STR, fetch_serverinfo, NULL},
silc_config_strerror(ret)));
linebuf = silc_config_read_line(file, line);
if (linebuf) {
- SILC_SERVER_LOG_ERROR((" file %s line %lu: %s\n", filename,
+ SILC_SERVER_LOG_ERROR((" file %s line %u: %s\n", filename,
line, linebuf));
silc_free(linebuf);
}
silc_free(di);
}
silc_free(si->server_type);
- silc_free(si->external_ip);
silc_free(si->location);
silc_free(si->admin);
silc_free(si->email);
return NULL;
for (client = config->clients; client; client = client->next) {
- if (client->host && !silc_string_compare(client->host, host))
+ if (client->host && !silc_string_match(client->host, host))
continue;
break;
}
nick = "*";
for (admin = config->admins; admin; admin = admin->next) {
- if (admin->host && !silc_string_compare(admin->host, host))
+ if (admin->host && !silc_string_match(admin->host, host))
continue;
- if (admin->user && !silc_string_compare(admin->user, user))
+ if (admin->user && !silc_string_match(admin->user, user))
continue;
- if (admin->nick && !silc_string_compare(admin->nick, nick))
+ if (admin->nick && !silc_string_match(admin->nick, nick))
continue;
/* no checks failed -> this entry matches */
break;
return NULL;
for (deny = config->denied; deny; deny = deny->next) {
- if (deny->host && !silc_string_compare(deny->host, host))
+ if (deny->host && !silc_string_match(deny->host, host))
continue;
break;
}
return NULL;
for (serv = config->servers; serv; serv = serv->next) {
- if (!silc_string_compare(serv->host, host))
+ if (!silc_string_match(serv->host, host))
continue;
break;
}
return NULL;
for (serv = config->routers; serv; serv = serv->next) {
- if (!silc_string_compare(serv->host, host))
+ if (!silc_string_match(serv->host, host))
continue;
if (port && serv->port && serv->port != port)
continue;
for (serv = config->routers; serv; serv = serv->next) {
if (!serv->backup_router)
continue;
- if (!silc_string_compare(serv->host, host))
+ if (!silc_string_match(serv->host, host))
continue;
break;
}