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.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c
index b65567d79..c6457016f 100644
--- a/src/revocation/test_revocation.c
+++ b/src/revocation/test_revocation.c
@@ -38,8 +38,8 @@ struct TestPeer
38 struct GNUNET_TESTBED_Operation *core_op; 38 struct GNUNET_TESTBED_Operation *core_op;
39 struct GNUNET_IDENTITY_Handle *idh; 39 struct GNUNET_IDENTITY_Handle *idh;
40 const struct GNUNET_CONFIGURATION_Handle *cfg; 40 const struct GNUNET_CONFIGURATION_Handle *cfg;
41 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41 const struct GNUNET_IDENTITY_PrivateKey *privkey;
42 struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 42 struct GNUNET_IDENTITY_PublicKey pubkey;
43 struct GNUNET_CRYPTO_EcdsaSignature sig; 43 struct GNUNET_CRYPTO_EcdsaSignature sig;
44 struct GNUNET_IDENTITY_Operation *create_id_op; 44 struct GNUNET_IDENTITY_Operation *create_id_op;
45 struct GNUNET_IDENTITY_EgoLookup *ego_lookup; 45 struct GNUNET_IDENTITY_EgoLookup *ego_lookup;
@@ -142,13 +142,13 @@ revocation_cb (void *cls, enum GNUNET_GenericReturnValue is_valid)
142} 142}
143 143
144 144
145static struct GNUNET_REVOCATION_PowP proof_of_work; 145static struct GNUNET_REVOCATION_PowP *proof_of_work;
146 146
147static void 147static void
148ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) 148ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
149{ 149{
150 static int completed = 0; 150 static int completed = 0;
151 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 151 const struct GNUNET_IDENTITY_PrivateKey *privkey;
152 152
153 if ((NULL != ego) && (cls == &testpeers[0])) 153 if ((NULL != ego) && (cls == &testpeers[0]))
154 { 154 {
@@ -164,10 +164,10 @@ ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
164 GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey); 164 GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey);
165 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n"); 165 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n");
166 privkey = GNUNET_IDENTITY_ego_get_private_key (ego); 166 privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
167 memset (&proof_of_work, 0, sizeof (proof_of_work)); 167 proof_of_work = GNUNET_malloc (GNUNET_REVOCATION_MAX_PROOF_SIZE);
168 GNUNET_REVOCATION_pow_init (privkey, 168 GNUNET_REVOCATION_pow_init (privkey,
169 &proof_of_work); 169 proof_of_work);
170 testpeers[1].pow = GNUNET_REVOCATION_pow_start (&proof_of_work, 170 testpeers[1].pow = GNUNET_REVOCATION_pow_start (proof_of_work,
171 1, 171 1,
172 5); 172 5);
173 int res = 173 int res =
@@ -184,7 +184,7 @@ ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
184 { 184 {
185 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Egos retrieved\n"); 185 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Egos retrieved\n");
186 testpeers[1].revok_handle = GNUNET_REVOCATION_revoke (testpeers[1].cfg, 186 testpeers[1].revok_handle = GNUNET_REVOCATION_revoke (testpeers[1].cfg,
187 &proof_of_work, 187 proof_of_work,
188 &revocation_cb, 188 &revocation_cb,
189 NULL); 189 NULL);
190 GNUNET_REVOCATION_pow_stop (testpeers[1].pow); 190 GNUNET_REVOCATION_pow_stop (testpeers[1].pow);
@@ -194,7 +194,7 @@ ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
194 194
195static void 195static void
196identity_create_cb (void *cls, 196identity_create_cb (void *cls,
197 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, 197 const struct GNUNET_IDENTITY_PrivateKey *pk,
198 const char *emsg) 198 const char *emsg)
199{ 199{
200 static int completed = 0; 200 static int completed = 0;
@@ -238,11 +238,13 @@ identity_completion_cb (void *cls,
238 testpeers[0].create_id_op = GNUNET_IDENTITY_create (testpeers[0].idh, 238 testpeers[0].create_id_op = GNUNET_IDENTITY_create (testpeers[0].idh,
239 "client", 239 "client",
240 NULL, 240 NULL,
241 GNUNET_IDENTITY_TYPE_ECDSA,
241 &identity_create_cb, 242 &identity_create_cb,
242 &testpeers[0]); 243 &testpeers[0]);
243 testpeers[1].create_id_op = GNUNET_IDENTITY_create (testpeers[1].idh, 244 testpeers[1].create_id_op = GNUNET_IDENTITY_create (testpeers[1].idh,
244 "toberevoked", 245 "toberevoked",
245 NULL, 246 NULL,
247 GNUNET_IDENTITY_TYPE_ECDSA,
246 &identity_create_cb, 248 &identity_create_cb,
247 &testpeers[1]); 249 &testpeers[1]);
248} 250}