diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-04-20 16:56:16 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-04-20 16:56:16 +0200 |
commit | ee5cfec8640886ea3fa3f582cb04347762feebbd (patch) | |
tree | c884ba6d0b6304fb635e4fd1a482fdffc91cf6f3 /src/revocation/revocation_api.c | |
parent | 6d61330e3ae457a27f10247cd9caf53987604143 (diff) | |
download | gnunet-ee5cfec8640886ea3fa3f582cb04347762feebbd.tar.gz gnunet-ee5cfec8640886ea3fa3f582cb04347762feebbd.zip |
fix tests
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r-- | src/revocation/revocation_api.c | 11 |
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 | */ |
474 | struct GNUNET_REVOCATION_PowCalculationHandle* | 474 | struct GNUNET_REVOCATION_PowCalculationHandle* |
475 | GNUNET_REVOCATION_pow_init (const struct GNUNET_CRYPTO_EcdsaPublicKey *key, | 475 | GNUNET_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; |