From 19b772329cb8968e5e96e33d5238f172f5553dc4 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Tue, 21 Apr 2020 11:52:12 +0200 Subject: new pass API --- src/revocation/test_revocation.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/revocation/test_revocation.c') 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); -- cgit v1.2.3