diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-20 12:10:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-20 12:10:14 +0000 |
commit | 4576c5ef01c6ad841e00de0df3b9a418a3a75113 (patch) | |
tree | 8c3948178528f3dcc1ebdcd3361239a3d6783ff2 /src/gnsrecord | |
parent | cd9f185e7a0c78176bb45ad8fc65cb1712031078 (diff) | |
download | gnunet-4576c5ef01c6ad841e00de0df3b9a418a3a75113.tar.gz gnunet-4576c5ef01c6ad841e00de0df3b9a418a3a75113.zip |
-undo, rd[i].expiration time are in host-byte-order
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index 05a20c33a..a9c35a6d8 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -187,7 +187,6 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
187 | GNUNET_GNSRECORD_RecordCallback proc, | 187 | GNUNET_GNSRECORD_RecordCallback proc, |
188 | void *proc_cls) | 188 | void *proc_cls) |
189 | { | 189 | { |
190 | struct GNUNET_TIME_Absolute exp; | ||
191 | size_t payload_len = ntohl (block->purpose.size) - | 190 | size_t payload_len = ntohl (block->purpose.size) - |
192 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) - | 191 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) - |
193 | sizeof (struct GNUNET_TIME_AbsoluteNBO); | 192 | sizeof (struct GNUNET_TIME_AbsoluteNBO); |
@@ -250,7 +249,6 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
250 | continue; | 249 | continue; |
251 | } | 250 | } |
252 | 251 | ||
253 | exp.abs_value_us = GNUNET_ntohll (rd[i].expiration_time); | ||
254 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) | 252 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) |
255 | { | 253 | { |
256 | int include_record = GNUNET_YES; | 254 | int include_record = GNUNET_YES; |
@@ -259,12 +257,10 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
259 | { | 257 | { |
260 | if (k == i) | 258 | if (k == i) |
261 | continue; | 259 | continue; |
262 | if (exp.abs_value_us < now.abs_value_us) | 260 | if (rd[i].expiration_time < now.abs_value_us) |
263 | { | ||
264 | include_record = GNUNET_NO; /* Shadow record is expired */ | 261 | include_record = GNUNET_NO; /* Shadow record is expired */ |
265 | } | ||
266 | if ((rd[k].record_type == rd[i].record_type) | 262 | if ((rd[k].record_type == rd[i].record_type) |
267 | && (GNUNET_ntohll (rd[k].expiration_time) >= now.abs_value_us) | 263 | && (rd[k].expiration_time >= now.abs_value_us) |
268 | && (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) | 264 | && (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) |
269 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ | 265 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ |
270 | } | 266 | } |
@@ -276,7 +272,7 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
276 | j++; | 272 | j++; |
277 | } | 273 | } |
278 | } | 274 | } |
279 | else if (exp.abs_value_us >= now.abs_value_us) | 275 | else if (rd[i].expiration_time >= now.abs_value_us) |
280 | { | 276 | { |
281 | /* Include this record */ | 277 | /* Include this record */ |
282 | if (j != i) | 278 | if (j != i) |