[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 21/31: predate validity time on creation; extent ttl on validat
From: |
gnunet |
Subject: |
[gnunet] 21/31: predate validity time on creation; extent ttl on validation |
Date: |
Wed, 22 Apr 2020 21:53:12 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit d4fd97e693e462f3bd16425f4e803fe5a99b9d62
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Mon Apr 20 19:38:41 2020 +0200
predate validity time on creation; extent ttl on validation
---
src/revocation/revocation_api.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index fe600ec7a..291c58dd8 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -510,8 +510,9 @@ GNUNET_REVOCATION_check_pow (const struct
GNUNET_REVOCATION_Pow *pow,
*/
buffer = GNUNET_TIME_relative_divide (epoch_length,
10);
- ts = GNUNET_TIME_absolute_subtract (ts,
- buffer);
+ exp = GNUNET_TIME_absolute_add (ts, ttl);
+ exp = GNUNET_TIME_absolute_add (exp,
+ buffer);
if (0 != GNUNET_TIME_absolute_get_remaining (ts).rel_value_us)
return GNUNET_NO; /* Not yet valid. */
@@ -519,10 +520,6 @@ GNUNET_REVOCATION_check_pow (const struct
GNUNET_REVOCATION_Pow *pow,
ts = GNUNET_TIME_absolute_add (ts,
buffer);
- exp = GNUNET_TIME_absolute_add (ts, ttl);
- exp = GNUNET_TIME_absolute_add (exp,
- buffer);
-
if (0 == GNUNET_TIME_absolute_get_remaining (exp).rel_value_us)
return GNUNET_NO; /* expired */
return GNUNET_YES;
@@ -545,6 +542,13 @@ GNUNET_REVOCATION_pow_init (const struct
GNUNET_CRYPTO_EcdsaPrivateKey *key,
struct GNUNET_REVOCATION_PowCalculationHandle *pc;
struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get ();
+ /**
+ * Predate the validity period to prevent rejections due to
+ * unsynchronized clocks
+ */
+ ts = GNUNET_TIME_absolute_subtract (ts,
+ GNUNET_TIME_UNIT_WEEKS);
+
pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
pc->pow.timestamp = GNUNET_TIME_absolute_hton (ts);
pc->pow.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] 09/31: no diplicate nonces, (continued)
- [gnunet] 09/31: no diplicate nonces, gnunet, 2020/04/22
- [gnunet] 11/31: uncrustify, gnunet, 2020/04/22
- [gnunet] 12/31: those are actually debug messages, gnunet, 2020/04/22
- [gnunet] 13/31: more comments, allow to pick up pow later, gnunet, 2020/04/22
- [gnunet] 18/31: fix, gnunet, 2020/04/22
- [gnunet] 10/31: some comments, gnunet, 2020/04/22
- [gnunet] 25/31: packed makes no sense there, gnunet, 2020/04/22
- [gnunet] 19/31: check signature in check_pow, gnunet, 2020/04/22
- [gnunet] 14/31: evaluate epochs, gnunet, 2020/04/22
- [gnunet] 24/31: remove pow_get, gnunet, 2020/04/22
- [gnunet] 21/31: predate validity time on creation; extent ttl on validation,
gnunet <=
- [gnunet] 28/31: purge scrypt; add argon2, gnunet, 2020/04/22
- [gnunet] 16/31: remove sign API call, gnunet, 2020/04/22
- [gnunet] 17/31: update API comments, gnunet, 2020/04/22
- [gnunet] 30/31: add epochs CLI parameter, gnunet, 2020/04/22
- [gnunet] 29/31: remova binary file commited by accident, gnunet, 2020/04/22
- [gnunet] 08/31: towards less variance, gnunet, 2020/04/22
- [gnunet] 22/31: new pass API, gnunet, 2020/04/22
- [gnunet] 27/31: update API for cleanup of handle, gnunet, 2020/04/22
- [gnunet] 26/31: update revocation config, gnunet, 2020/04/22
- [gnunet] 23/31: rename, fix, gnunet, 2020/04/22