aboutsummaryrefslogtreecommitdiff
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)
131 131
132 132
133static void 133static void
134revocation_cb (void *cls, int is_valid) 134revocation_cb (void *cls, enum GNUNET_GenericReturnValue is_valid)
135{ 135{
136 testpeers[1].revok_handle = NULL; 136 testpeers[1].revok_handle = NULL;
137 if (GNUNET_NO == is_valid) 137 if (GNUNET_NO == is_valid)
@@ -147,6 +147,8 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
147{ 147{
148 static int completed = 0; 148 static int completed = 0;
149 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 149 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
150 struct GNUNET_REVOCATION_Pow proof_of_work;
151
150 152
151 if ((NULL != ego) && (cls == &testpeers[0])) 153 if ((NULL != ego) && (cls == &testpeers[0]))
152 { 154 {
@@ -162,9 +164,12 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
162 GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey); 164 GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey);
163 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n"); 165 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n");
164 privkey = GNUNET_IDENTITY_ego_get_private_key (ego); 166 privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
165 testpeers[1].pow = GNUNET_REVOCATION_pow_init (privkey, 167 memset (&proof_of_work, 0, sizeof (proof_of_work));
166 1, 168 GNUNET_REVOCATION_pow_init (privkey,
167 5); 169 &proof_of_work);
170 testpeers[1].pow = GNUNET_REVOCATION_pow_start (&proof_of_work,
171 1,
172 5);
168 int res = 173 int res =
169 GNUNET_REVOCATION_pow_round (testpeers[1].pow); 174 GNUNET_REVOCATION_pow_round (testpeers[1].pow);
170 while (GNUNET_OK != res) 175 while (GNUNET_OK != res)
@@ -177,11 +182,9 @@ ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
177 } 182 }
178 if (2 == completed) 183 if (2 == completed)
179 { 184 {
180 const struct GNUNET_REVOCATION_Pow *pow;
181 pow = GNUNET_REVOCATION_pow_get (testpeers[1].pow);
182 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Egos retrieved\n"); 185 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Egos retrieved\n");
183 testpeers[1].revok_handle = GNUNET_REVOCATION_revoke (testpeers[1].cfg, 186 testpeers[1].revok_handle = GNUNET_REVOCATION_revoke (testpeers[1].cfg,
184 pow, 187 &proof_of_work,
185 &revocation_cb, 188 &revocation_cb,
186 NULL); 189 NULL);
187 GNUNET_REVOCATION_pow_cleanup (testpeers[1].pow); 190 GNUNET_REVOCATION_pow_cleanup (testpeers[1].pow);