updates.
[silc.git] / apps / silcd / serverconfig.c
index 8a8aea500800cdd32d573cc359c3622f8df23617..0b31048af5093fcc86a32b7cb33f9196555426de 100644 (file)
@@ -430,6 +430,10 @@ SILC_CONFIG_CALLBACK(fetch_serverinfo)
 
   if (type == SILC_CONFIG_ARG_BLOCK) {
     /* check for mandatory inputs */
+    if (!server_info->public_key || !server_info->private_key) {
+      got_errno = SILC_CONFIG_EMISSFIELDS;
+      goto got_err;
+    }
     return SILC_CONFIG_OK;
   }
   if (!strcmp(name, "hostname")) {
@@ -1215,7 +1219,7 @@ SilcServerConfig silc_server_config_alloc(const char *filename)
   /* obtain a config file object */
   file = silc_config_open(filename);
   if (!file) {
-    SILC_SERVER_LOG_ERROR(("\nError: can't open config file `%s'\n", 
+    SILC_SERVER_LOG_ERROR(("\nError: can't open config file `%s'\n",
                           filename));
     return NULL;
   }
@@ -1241,7 +1245,7 @@ SilcServerConfig silc_server_config_alloc(const char *filename)
       SILC_SERVER_LOG_ERROR(("Error while parsing config file: %s.\n",
                             silc_config_strerror(ret)));
       linebuf = silc_config_read_line(file, line);
-      SILC_SERVER_LOG_ERROR(("  file %s line %lu:  %s\n", filename, 
+      SILC_SERVER_LOG_ERROR(("  file %s line %lu:  %s\n", filename,
                             line, linebuf));
       silc_free(linebuf);
     }
@@ -1331,6 +1335,8 @@ void silc_server_config_destroy(SilcServerConfig config)
     silc_free(si->group);
     silc_free(si->motd_file);
     silc_free(si->pid_file);
+    silc_pkcs_public_key_free(si->public_key);
+    silc_pkcs_private_key_free(si->private_key);
   }
 
   /* Now let's destroy the lists */