/*
This file is part of GNUnet.
- (C) 2005-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2005-2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
#include "gnunet_fs_service.h"
-static struct GNUNET_CRYPTO_EccPublicKey nsid;
+static struct GNUNET_CRYPTO_EcdsaPublicKey nsid;
static struct GNUNET_FS_Uri *sks_expect_uri;
static struct GNUNET_FS_SearchContext *ksk_search;
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
static int update_started;
static void
-abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+abort_ksk_search_task (void *cls)
{
if (ksk_search != NULL)
{
if (sks_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
static void
-abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+abort_sks_search_task (void *cls)
{
if (sks_search == NULL)
return;
if (ksk_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
static void
-do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_timeout (void *cls)
{
err = 1;
FPRINTF (stderr, "%s", "Operation timed out\n");
- kill_task = GNUNET_SCHEDULER_NO_TASK;
- abort_sks_search_task (NULL, tc);
- abort_ksk_search_task (NULL, tc);
+ kill_task = NULL;
+ abort_sks_search_task (NULL);
+ abort_ksk_search_task (NULL);
}
FPRINTF (stderr, "%s", "Wrong result for ksk search!\n");
err = 1;
}
- GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&abort_ksk_search_task, NULL);
}
else
{
FPRINTF (stderr, "Error searching file: %s\n",
event->value.search.specifics.error.message);
if (sks_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&abort_sks_search_task, NULL);
else if (ksk_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&abort_ksk_search_task, NULL);
else
GNUNET_break (0);
break;
adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
{
struct GNUNET_CONTAINER_MetaData *meta;
- struct GNUNET_CRYPTO_EccPrivateKey *ns;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
struct GNUNET_FS_BlockOptions bo;
if (NULL != emsg)
GNUNET_FS_stop (fs);
return;
}
- ns = GNUNET_CRYPTO_ecc_key_create ();
+ ns = GNUNET_CRYPTO_ecdsa_key_create ();
meta = GNUNET_CONTAINER_meta_data_create ();
sks_expect_uri = GNUNET_FS_uri_dup (uri);
bo.content_priority = 1;
bo.replication_level = 0;
bo.expiration_time =
GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
- GNUNET_CRYPTO_ecc_key_get_public (ns, &nsid);
+ GNUNET_CRYPTO_ecdsa_key_get_public (ns, &nsid);
GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri,
&bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL);
GNUNET_CONTAINER_meta_data_destroy (meta);
static void
testNamespace ()
{
- struct GNUNET_CRYPTO_EccPrivateKey *ns;
+ struct GNUNET_CRYPTO_EcdsaPrivateKey *ns;
struct GNUNET_FS_BlockOptions bo;
struct GNUNET_CONTAINER_MetaData *meta;
struct GNUNET_FS_Uri *ksk_uri;
struct GNUNET_FS_Uri *sks_uri;
- ns = GNUNET_CRYPTO_ecc_key_create ();
+ ns = GNUNET_CRYPTO_ecdsa_key_create ();
meta = GNUNET_CONTAINER_meta_data_create ();
ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/testnsa", NULL);
bo.content_priority = 1;
bo.expiration_time =
GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
sks_uri = GNUNET_FS_uri_sks_create (&nsid, "root");
- GNUNET_FS_publish_ksk (fs,
- ksk_uri, meta, sks_uri,
+ GNUNET_FS_publish_ksk (fs,
+ ksk_uri, meta, sks_uri,
&bo, GNUNET_FS_PUBLISH_OPTION_NONE,
&adv_cont, NULL);
GNUNET_FS_uri_destroy (sks_uri);
static void
-run (void *cls,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Peer *peer)
{