aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/revocation_api.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-21 15:45:12 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-21 15:45:12 +0200
commite64ec174f28812a18fd35f5d671a03e335380d93 (patch)
tree41163115e277b0f33abcdeee758960753ccb1d81 /src/revocation/revocation_api.c
parent19b772329cb8968e5e96e33d5238f172f5553dc4 (diff)
downloadgnunet-e64ec174f28812a18fd35f5d671a03e335380d93.tar.gz
gnunet-e64ec174f28812a18fd35f5d671a03e335380d93.zip
rename, fix
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r--src/revocation/revocation_api.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 7bf7799de..bff004698 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -311,7 +311,7 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
311 GNUNET_MQ_handler_end () 311 GNUNET_MQ_handler_end ()
312 }; 312 };
313 unsigned long long matching_bits; 313 unsigned long long matching_bits;
314 struct GNUNET_TIME_Relative epoch_length; 314 struct GNUNET_TIME_Relative epoch_duration;
315 struct RevokeMessage *rm; 315 struct RevokeMessage *rm;
316 struct GNUNET_MQ_Envelope *env; 316 struct GNUNET_MQ_Envelope *env;
317 317
@@ -328,8 +328,8 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
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_LENGTH", 331 "EPOCH_DURATION",
332 &epoch_length))) 332 &epoch_duration)))
333 { 333 {
334 GNUNET_break (0); 334 GNUNET_break (0);
335 GNUNET_free (h); 335 GNUNET_free (h);
@@ -337,7 +337,7 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
337 } 337 }
338 if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow, 338 if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow,
339 (unsigned int) matching_bits, 339 (unsigned int) matching_bits,
340 epoch_length)) 340 epoch_duration))
341 { 341 {
342 GNUNET_break (0); 342 GNUNET_break (0);
343 GNUNET_free (h); 343 GNUNET_free (h);
@@ -431,7 +431,7 @@ calculate_score (const struct GNUNET_REVOCATION_PowCalculationHandle *ph)
431enum GNUNET_GenericReturnValue 431enum GNUNET_GenericReturnValue
432GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow, 432GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
433 unsigned int difficulty, 433 unsigned int difficulty,
434 struct GNUNET_TIME_Relative epoch_length) 434 struct GNUNET_TIME_Relative epoch_duration)
435{ 435{
436 char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) 436 char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)
437 + sizeof (struct GNUNET_TIME_AbsoluteNBO) 437 + sizeof (struct GNUNET_TIME_AbsoluteNBO)
@@ -462,7 +462,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
462 &pow->signature, 462 &pow->signature,
463 &pow->key)) 463 &pow->key))
464 { 464 {
465 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 465 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
466 "Proof of work signature invalid!\n"); 466 "Proof of work signature invalid!\n");
467 return GNUNET_NO; 467 return GNUNET_NO;
468 } 468 }
@@ -508,12 +508,12 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
508 * Check expiration 508 * Check expiration
509 */ 509 */
510 ts = GNUNET_TIME_absolute_ntoh (pow->timestamp); 510 ts = GNUNET_TIME_absolute_ntoh (pow->timestamp);
511 ttl = GNUNET_TIME_relative_multiply (epoch_length, 511 ttl = GNUNET_TIME_relative_multiply (epoch_duration,
512 epochs); 512 epochs);
513 /** 513 /**
514 * Extend by 10% for unsynchronized clocks 514 * Extend by 10% for unsynchronized clocks
515 */ 515 */
516 buffer = GNUNET_TIME_relative_divide (epoch_length, 516 buffer = GNUNET_TIME_relative_divide (epoch_duration,
517 10); 517 10);
518 exp = GNUNET_TIME_absolute_add (ts, ttl); 518 exp = GNUNET_TIME_absolute_add (ts, ttl);
519 exp = GNUNET_TIME_absolute_add (exp, 519 exp = GNUNET_TIME_absolute_add (exp,