fix #3709: bound encrypted message queue
[oweals/gnunet.git] / src / core / gnunet-service-core.c
index ada9b7bd99a5b359f12f696aef3035374ebff407..5a0452a5c5f6a6580bf8047ddd010fcc05bd2aab 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -91,7 +91,7 @@ static void
 run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
   char *keyfile;
 
   GSC_cfg = c;
@@ -101,20 +101,21 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
                                                &keyfile))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _
-                ("Core service is lacking HOSTKEY configuration setting.  Exiting.\n"));
+                _("Core service is lacking HOSTKEY configuration setting.  Exiting.\n"));
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
   GSC_stats = GNUNET_STATISTICS_create ("core", GSC_cfg);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+                                &shutdown_task,
                                 NULL);
   GNUNET_SERVER_suspend (server);
   GSC_TYPEMAP_init ();
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   GNUNET_assert (NULL != pk);
-  if ((GNUNET_OK != GSC_KX_init (pk)) ||
+  if ((GNUNET_OK != GSC_KX_init (pk,
+                                 server)) ||
       (GNUNET_OK != GSC_NEIGHBOURS_init ()))
   {
     GNUNET_SCHEDULER_shutdown ();
@@ -123,7 +124,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GSC_SESSIONS_init ();
   GSC_CLIENTS_init (GSC_server);
   GNUNET_SERVER_resume (GSC_server);
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Core service of `%4s' ready.\n"),
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              _("Core service of `%4s' ready.\n"),
               GNUNET_i2s (&GSC_my_identity));
 }
 
@@ -139,7 +141,8 @@ int
 main (int argc, char *const *argv)
 {
   return (GNUNET_OK ==
-          GNUNET_SERVICE_run (argc, argv, "core", GNUNET_SERVICE_OPTION_NONE,
+          GNUNET_SERVICE_run (argc, argv, "core",
+                              GNUNET_SERVICE_OPTION_NONE,
                               &run, NULL)) ? 0 : 1;
 }