gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r28614 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r28614 - gnunet/src/testing
Date: Wed, 14 Aug 2013 10:57:43 +0200

Author: harsha
Date: 2013-08-14 10:57:43 +0200 (Wed, 14 Aug 2013)
New Revision: 28614

Modified:
   gnunet/src/testing/testing.c
Log:
- avoid assertion failure if PRIVATE_KEY is not present in PEER section


Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2013-08-14 08:05:28 UTC (rev 28613)
+++ gnunet/src/testing/testing.c        2013-08-14 08:57:43 UTC (rev 28614)
@@ -1164,20 +1164,6 @@
   ss_instances = NULL;
   if (NULL != emsg)
     *emsg = NULL;
-  /* Remove sections for shared services */
-  for (cnt = 0; cnt < system->n_shared_services; cnt++)
-  {
-    ss = system->shared_services[cnt];
-    GNUNET_CONFIGURATION_remove_section (cfg, ss->sname);
-  }
-  if (GNUNET_OK != GNUNET_TESTING_configuration_create_ (system, cfg,
-                                                         &ports, &nports))
-  {
-    GNUNET_asprintf (&emsg_,
-                     _("Failed to create configuration for peer "
-                       "(not enough free ports?)\n"));
-    goto err_ret;
-  }
   if (key_number >= system->total_hostkeys)
   {
     GNUNET_asprintf (&emsg_,
@@ -1193,9 +1179,30 @@
                     _("Failed to initialize hostkey for peer %u\n"),
                     (unsigned int) key_number);
     goto err_ret;
-  }
+  }  
   if (NULL != pk)
     GNUNET_CRYPTO_ecc_key_free (pk);
+  if (GNUNET_NO == 
+      GNUNET_CONFIGURATION_have_value (cfg, "PEER", "PRIVATE_KEY"))
+  {
+    GNUNET_asprintf (&emsg_, 
+                     _("PRIVATE_KEY option in PEER section missing in 
configuration\n"));
+    goto err_ret;
+  }
+  /* Remove sections for shared services */
+  for (cnt = 0; cnt < system->n_shared_services; cnt++)
+  {
+    ss = system->shared_services[cnt];
+    GNUNET_CONFIGURATION_remove_section (cfg, ss->sname);
+  }
+  if (GNUNET_OK != GNUNET_TESTING_configuration_create_ (system, cfg,
+                                                         &ports, &nports))
+  {
+    GNUNET_asprintf (&emsg_,
+                     _("Failed to create configuration for peer "
+                       "(not enough free ports?)\n"));
+    goto err_ret;
+  }
   GNUNET_assert (GNUNET_OK == 
                  GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER",
                                                          "PRIVATE_KEY",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]