aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/gnunet-revocation.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-20 19:08:23 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-20 19:08:23 +0200
commitc20768b8b09fabaa3c2330cde381e894b1f90efb (patch)
tree62bca41b94c3280a09abbf9db8b50da5f354b691 /src/revocation/gnunet-revocation.c
parent424cd50ecd0144b264a547fe149839cf2866c21f (diff)
downloadgnunet-c20768b8b09fabaa3c2330cde381e894b1f90efb.tar.gz
gnunet-c20768b8b09fabaa3c2330cde381e894b1f90efb.zip
include buffer of 10& of epoch
Diffstat (limited to 'src/revocation/gnunet-revocation.c')
-rw-r--r--src/revocation/gnunet-revocation.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c
index 5f3df0ee0..d290d34c7 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -347,7 +347,6 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
347 struct GNUNET_CRYPTO_EcdsaPublicKey key; 347 struct GNUNET_CRYPTO_EcdsaPublicKey key;
348 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 348 const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
349 struct GNUNET_REVOCATION_PowCalculationHandle *ph = NULL; 349 struct GNUNET_REVOCATION_PowCalculationHandle *ph = NULL;
350 int epochs;
351 350
352 el = NULL; 351 el = NULL;
353 if (NULL == ego) 352 if (NULL == ego)
@@ -373,19 +372,12 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
373 GNUNET_free (pow); 372 GNUNET_free (pow);
374 return; 373 return;
375 } 374 }
376 if (0 < (epochs = 375 if (GNUNET_YES ==
377 GNUNET_REVOCATION_check_pow (pow, 376 GNUNET_REVOCATION_check_pow (pow,
378 (unsigned int) matching_bits))) 377 (unsigned int) matching_bits,
378 epoch_length))
379 { 379 {
380 struct GNUNET_TIME_Absolute ts;
381 struct GNUNET_TIME_Relative ttl;
382 ts = GNUNET_TIME_absolute_ntoh (pow->timestamp);
383 ttl = GNUNET_TIME_relative_multiply (epoch_length,
384 epochs);
385 fprintf (stderr, "%s", _ ("Revocation certificate ready\n")); 380 fprintf (stderr, "%s", _ ("Revocation certificate ready\n"));
386 fprintf (stderr, "%s %s for %s\n", _ ("Valid from"),
387 GNUNET_STRINGS_absolute_time_to_string (ts),
388 GNUNET_STRINGS_relative_time_to_string (ttl, GNUNET_NO));
389 if (perform) 381 if (perform)
390 perform_revocation (pow); 382 perform_revocation (pow);
391 else 383 else
@@ -499,9 +491,10 @@ run (void *cls,
499 return; 491 return;
500 } 492 }
501 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); 493 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
502 if (0 >= 494 if (GNUNET_YES !=
503 GNUNET_REVOCATION_check_pow (&pow, 495 GNUNET_REVOCATION_check_pow (&pow,
504 (unsigned int) matching_bits)) 496 (unsigned int) matching_bits,
497 epoch_length))
505 { 498 {
506 struct GNUNET_REVOCATION_PowCalculationHandle *ph; 499 struct GNUNET_REVOCATION_PowCalculationHandle *ph;
507 ph = GNUNET_REVOCATION_pow_init2 (&pow, 500 ph = GNUNET_REVOCATION_pow_init2 (&pow,