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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index f2261ff4f..fba10a4d5 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -472,7 +472,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
472 * @return a handle for use in PoW rounds 472 * @return a handle for use in PoW rounds
473 */ 473 */
474struct GNUNET_REVOCATION_PowCalculationHandle* 474struct GNUNET_REVOCATION_PowCalculationHandle*
475GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *key, 475GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
476 int epochs, 476 int epochs,
477 unsigned int difficulty) 477 unsigned int difficulty)
478{ 478{
@@ -480,8 +480,15 @@ GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
480 struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get (); 480 struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get ();
481 481
482 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle); 482 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
483 pc->pow.key = *key;
484 pc->pow.timestamp = GNUNET_TIME_absolute_hton (ts); 483 pc->pow.timestamp = GNUNET_TIME_absolute_hton (ts);
484 pc->pow.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
485 pc->pow.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
486 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey));
487 GNUNET_CRYPTO_ecdsa_key_get_public (key, &pc->pow.key);
488 GNUNET_assert (GNUNET_OK ==
489 GNUNET_CRYPTO_ecdsa_sign_ (key,
490 &pc->pow.purpose,
491 &pc->pow.signature));
485 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 492 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
486 UINT64_MAX); 493 UINT64_MAX);
487 pc->difficulty = difficulty; 494 pc->difficulty = difficulty;