-adding missing break statements
[oweals/gnunet.git] / src / psycstore / test_psycstore.c
index bb6f88665ec5b8c07e0109de8e6cb70cfc2b8885..05cb92dce2fb4dfb2a4309c6cc6000a4a470a302 100644 (file)
@@ -26,8 +26,8 @@
  */
 
 #include "platform.h"
-#include "gnunet_common.h"
 #include "gnunet_util_lib.h"
+#include "gnunet_common.h"
 #include "gnunet_testing_lib.h"
 #include "gnunet_psycstore_service.h"
 
@@ -56,11 +56,11 @@ static struct GNUNET_PSYCSTORE_OperationHandle *op;
  */
 static GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
 
-static struct GNUNET_CRYPTO_EccPrivateKey *channel_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *slave_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
+static struct GNUNET_CRYPTO_EddsaPrivateKey *slave_key;
 
-static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key;
-static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey channel_pub_key;
+static struct GNUNET_CRYPTO_EddsaPublicKey slave_pub_key;
 
 static struct FragmentClosure
 {
@@ -231,14 +231,16 @@ state_get_result (void *cls, int64_t result, const char *err_msg)
 
 
 void
-counters_result (void *cls, uint64_t max_fragment_id, uint64_t max_message_id,
-                 uint64_t max_group_generation, uint64_t max_state_message_id)
+counters_result (void *cls, int status, uint64_t max_fragment_id,
+                 uint64_t max_message_id, uint64_t max_group_generation,
+                 uint64_t max_state_message_id)
 {
   struct FragmentClosure *fcls = cls;
   int result = 0;
   op = NULL;
 
-  if (max_fragment_id == GNUNET_ntohll (fcls->msg[2]->fragment_id)
+  if (GNUNET_OK == status
+      && max_fragment_id == GNUNET_ntohll (fcls->msg[2]->fragment_id)
       && max_message_id == GNUNET_ntohll (fcls->msg[2]->message_id)
       && max_group_generation == GNUNET_ntohll (fcls->msg[2]->group_generation)
       && max_state_message_id == GNUNET_ntohll (fcls->msg[0]->message_id))
@@ -436,7 +438,7 @@ membership_test_result (void *cls, int64_t result, const char *err_msg)
                              - sizeof (msg->hop_counter)
                              - sizeof (msg->signature));
   msg->purpose.purpose = htonl (234);
-  GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecc_sign (slave_key, &msg->purpose,
+  GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (slave_key, &msg->purpose,
                                                       &msg->signature));
 
   op = GNUNET_PSYCSTORE_fragment_store (h, &channel_pub_key, msg, fcls.flags[0],
@@ -495,11 +497,11 @@ run (void *cls,
   h = GNUNET_PSYCSTORE_connect (cfg);
   GNUNET_assert (NULL != h);
 
-  channel_key = GNUNET_CRYPTO_ecc_key_create ();
-  slave_key = GNUNET_CRYPTO_ecc_key_create ();
+  channel_key = GNUNET_CRYPTO_eddsa_key_create ();
+  slave_key = GNUNET_CRYPTO_eddsa_key_create ();
 
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (channel_key, &channel_pub_key);
+  GNUNET_CRYPTO_eddsa_key_get_public (slave_key, &slave_pub_key);
 
   op = GNUNET_PSYCSTORE_membership_store (h, &channel_pub_key, &slave_pub_key,
                                           GNUNET_YES, 4, 2, 1,