aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/revocation_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r--src/revocation/revocation_api.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 5494f379c..18a312ab8 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -320,16 +320,16 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
320 "REVOCATION", 320 "REVOCATION",
321 "WORKBITS", 321 "WORKBITS",
322 &matching_bits))) 322 &matching_bits)))
323 { 323 {
324 GNUNET_break (0); 324 GNUNET_break (0);
325 GNUNET_free (h); 325 GNUNET_free (h);
326 return NULL; 326 return NULL;
327 } 327 }
328 if ((GNUNET_OK != 328 if ((GNUNET_OK !=
329 GNUNET_CONFIGURATION_get_value_time (cfg, 329 GNUNET_CONFIGURATION_get_value_time (cfg,
330 "REVOCATION", 330 "REVOCATION",
331 "EPOCH_DURATION", 331 "EPOCH_DURATION",
332 &epoch_duration))) 332 &epoch_duration)))
333 { 333 {
334 GNUNET_break (0); 334 GNUNET_break (0);
335 GNUNET_free (h); 335 GNUNET_free (h);
@@ -345,7 +345,6 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
345 } 345 }
346 346
347 347
348
349 h->mq = GNUNET_CLIENT_connect (cfg, 348 h->mq = GNUNET_CLIENT_connect (cfg,
350 "revocation", 349 "revocation",
351 handlers, 350 handlers,
@@ -454,8 +453,8 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
454 spurp.timestamp = pow->timestamp; 453 spurp.timestamp = pow->timestamp;
455 spurp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION); 454 spurp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
456 spurp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) 455 spurp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
457 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) 456 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)
458 + sizeof (struct GNUNET_TIME_AbsoluteNBO)); 457 + sizeof (struct GNUNET_TIME_AbsoluteNBO));
459 if (GNUNET_OK != 458 if (GNUNET_OK !=
460 GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, 459 GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
461 &spurp.purpose, 460 &spurp.purpose,
@@ -555,8 +554,8 @@ GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
555 rp.timestamp = pow->timestamp; 554 rp.timestamp = pow->timestamp;
556 rp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION); 555 rp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
557 rp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) 556 rp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
558 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) 557 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)
559 + sizeof (struct GNUNET_TIME_AbsoluteNBO)); 558 + sizeof (struct GNUNET_TIME_AbsoluteNBO));
560 GNUNET_CRYPTO_ecdsa_key_get_public (key, &pow->key); 559 GNUNET_CRYPTO_ecdsa_key_get_public (key, &pow->key);
561 rp.key = pow->key; 560 rp.key = pow->key;
562 GNUNET_assert (GNUNET_OK == 561 GNUNET_assert (GNUNET_OK ==
@@ -577,8 +576,8 @@ GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
577 */ 576 */
578struct GNUNET_REVOCATION_PowCalculationHandle* 577struct GNUNET_REVOCATION_PowCalculationHandle*
579GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_Pow *pow, 578GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_Pow *pow,
580 int epochs, 579 int epochs,
581 unsigned int difficulty) 580 unsigned int difficulty)
582{ 581{
583 struct GNUNET_REVOCATION_PowCalculationHandle *pc; 582 struct GNUNET_REVOCATION_PowCalculationHandle *pc;
584 583
@@ -651,15 +650,17 @@ GNUNET_REVOCATION_pow_round (struct GNUNET_REVOCATION_PowCalculationHandle *pc)
651 650
652 651
653/** 652/**
654 * Cleanup a PoW calculation 653 * Stop a PoW calculation
655 * 654 *
656 * @param pc the calculation to clean up 655 * @param pc the calculation to clean up
656 * @return #GNUNET_YES if pow valid, #GNUNET_NO if pow was set but is not
657 * valid
657 */ 658 */
658void 659void
659GNUNET_REVOCATION_pow_cleanup (struct 660GNUNET_REVOCATION_pow_stop (struct GNUNET_REVOCATION_PowCalculationHandle *pc)
660 GNUNET_REVOCATION_PowCalculationHandle *pc)
661{ 661{
662 GNUNET_free (pc); 662 GNUNET_free (pc);
663} 663}
664 664
665
665/* end of revocation_api.c */ 666/* end of revocation_api.c */