summaryrefslogtreecommitdiff
path: root/src/revocation/test_revocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation/test_revocation.c')
-rw-r--r--src/revocation/test_revocation.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c
index 07f5e6e61..84f90fe54 100644
--- a/src/revocation/test_revocation.c
+++ b/src/revocation/test_revocation.c
@@ -131,7 +131,7 @@ check_revocation (void *cls)
static void
-revocation_cb (void *cls, int is_valid)
+revocation_cb (void *cls, enum GNUNET_GenericReturnValue is_valid)
{
testpeers[1].revok_handle = NULL;
if (GNUNET_NO == is_valid)
@@ -147,6 +147,8 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
{
static int completed = 0;
const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
+ struct GNUNET_REVOCATION_Pow proof_of_work;
+
if ((NULL != ego) && (cls == &testpeers[0]))
{
@@ -162,9 +164,12 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n");
privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
- testpeers[1].pow = GNUNET_REVOCATION_pow_init (privkey,
- 1,
- 5);
+ memset (&proof_of_work, 0, sizeof (proof_of_work));
+ GNUNET_REVOCATION_pow_init (privkey,
+ &proof_of_work);
+ testpeers[1].pow = GNUNET_REVOCATION_pow_start (&proof_of_work,
+ 1,
+ 5);
int res =
GNUNET_REVOCATION_pow_round (testpeers[1].pow);
while (GNUNET_OK != res)
@@ -177,11 +182,9 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
}
if (2 == completed)
{
- const struct GNUNET_REVOCATION_Pow *pow;
- pow = GNUNET_REVOCATION_pow_get (testpeers[1].pow);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Egos retrieved\n");
testpeers[1].revok_handle = GNUNET_REVOCATION_revoke (testpeers[1].cfg,
- pow,
+ &proof_of_work,
&revocation_cb,
NULL);
GNUNET_REVOCATION_pow_cleanup (testpeers[1].pow);