*/
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. */
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;
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);