diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-20 13:19:31 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-20 13:19:31 +0000 |
commit | 12655b482ad79d57435a82b0988942dc1dafbd74 (patch) | |
tree | 895e6a085679512518db0d0d38e009246a810c68 /src/gnsrecord | |
parent | 03e7bdd09825eeaf044dc1779f7afe97af2a4453 (diff) | |
download | gnunet-12655b482ad79d57435a82b0988942dc1dafbd74.tar.gz gnunet-12655b482ad79d57435a82b0988942dc1dafbd74.zip |
fix relative time calculation
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index a17a64480..8cf8e532f 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -106,11 +106,12 @@ GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
106 | rdc[i] = rd[i]; | 106 | rdc[i] = rd[i]; |
107 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) | 107 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) |
108 | { | 108 | { |
109 | struct GNUNET_TIME_Relative t; | ||
110 | |||
109 | /* encrypted blocks must never have relative expiration times, convert! */ | 111 | /* encrypted blocks must never have relative expiration times, convert! */ |
110 | rdc[i].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; | 112 | rdc[i].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
111 | rdc[i].expiration_time = GNUNET_TIME_absolute_add (now, | 113 | t.rel_value_us = rdc[i].expiration_time; |
112 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS, | 114 | rdc[i].expiration_time = GNUNET_TIME_absolute_add (now, t).abs_value_us; |
113 | rdc[i].expiration_time)).abs_value_us; | ||
114 | } | 115 | } |
115 | } | 116 | } |
116 | /* serialize */ | 117 | /* serialize */ |