diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-20 10:43:48 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-20 10:43:48 +0000 |
commit | 857fb9e96d2264a2c0086c51a9dcc1fffe900ee8 (patch) | |
tree | 3cb40e97c1ba83286f762a8be77b1d97212f0f53 /src/gnsrecord/gnsrecord_crypto.c | |
parent | bcd5d6e9355f63e7758bee4f7bc41a11a2d59e0d (diff) | |
download | gnunet-857fb9e96d2264a2c0086c51a9dcc1fffe900ee8.tar.gz gnunet-857fb9e96d2264a2c0086c51a9dcc1fffe900ee8.zip |
major bug: not converting NBO to HBO
Diffstat (limited to 'src/gnsrecord/gnsrecord_crypto.c')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index a9c35a6d8..05a20c33a 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -187,6 +187,7 @@ 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; | ||
190 | size_t payload_len = ntohl (block->purpose.size) - | 191 | size_t payload_len = ntohl (block->purpose.size) - |
191 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) - | 192 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) - |
192 | sizeof (struct GNUNET_TIME_AbsoluteNBO); | 193 | sizeof (struct GNUNET_TIME_AbsoluteNBO); |
@@ -249,6 +250,7 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
249 | continue; | 250 | continue; |
250 | } | 251 | } |
251 | 252 | ||
253 | exp.abs_value_us = GNUNET_ntohll (rd[i].expiration_time); | ||
252 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) | 254 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) |
253 | { | 255 | { |
254 | int include_record = GNUNET_YES; | 256 | int include_record = GNUNET_YES; |
@@ -257,10 +259,12 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
257 | { | 259 | { |
258 | if (k == i) | 260 | if (k == i) |
259 | continue; | 261 | continue; |
260 | if (rd[i].expiration_time < now.abs_value_us) | 262 | if (exp.abs_value_us < now.abs_value_us) |
263 | { | ||
261 | include_record = GNUNET_NO; /* Shadow record is expired */ | 264 | include_record = GNUNET_NO; /* Shadow record is expired */ |
265 | } | ||
262 | if ((rd[k].record_type == rd[i].record_type) | 266 | if ((rd[k].record_type == rd[i].record_type) |
263 | && (rd[k].expiration_time >= now.abs_value_us) | 267 | && (GNUNET_ntohll (rd[k].expiration_time) >= now.abs_value_us) |
264 | && (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) | 268 | && (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD))) |
265 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ | 269 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ |
266 | } | 270 | } |
@@ -272,7 +276,7 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
272 | j++; | 276 | j++; |
273 | } | 277 | } |
274 | } | 278 | } |
275 | else if (rd[i].expiration_time >= now.abs_value_us) | 279 | else if (exp.abs_value_us >= now.abs_value_us) |
276 | { | 280 | { |
277 | /* Include this record */ | 281 | /* Include this record */ |
278 | if (j != i) | 282 | if (j != i) |