diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-12 11:09:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-12 11:10:01 +0200 |
commit | ae8b5cb2eac770be0d18b7d46c238bf865e34023 (patch) | |
tree | 78ecc715e15d4116390adde53b4e117f432bb599 /src/gnsrecord/gnsrecord_crypto.c | |
parent | bb581dc55bfb90fc7f34797111b55d16e69b7af0 (diff) | |
download | gnunet-ae8b5cb2eac770be0d18b7d46c238bf865e34023.tar.gz gnunet-ae8b5cb2eac770be0d18b7d46c238bf865e34023.zip |
complain if datacache returns expired values
Diffstat (limited to 'src/gnsrecord/gnsrecord_crypto.c')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index 0752086fe..295d31100 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -377,6 +377,8 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
377 | (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ) | 377 | (0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ) |
378 | { | 378 | { |
379 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ | 379 | include_record = GNUNET_NO; /* We have a non-expired, non-shadow record of the same type */ |
380 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
381 | "Ignoring shadow record\n"); | ||
380 | break; | 382 | break; |
381 | } | 383 | } |
382 | } | 384 | } |
@@ -395,6 +397,16 @@ GNUNET_GNSRECORD_block_decrypt (const struct GNUNET_GNSRECORD_Block *block, | |||
395 | rd[j] = rd[i]; | 397 | rd[j] = rd[i]; |
396 | j++; | 398 | j++; |
397 | } | 399 | } |
400 | else | ||
401 | { | ||
402 | struct GNUNET_TIME_Absolute at; | ||
403 | |||
404 | at.abs_value_us = rd[i].expiration_time; | ||
405 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
406 | "Excluding record that expired %s (%llu ago)\n", | ||
407 | GNUNET_STRINGS_absolute_time_to_string (at), | ||
408 | (unsigned long long) rd[i].expiration_time - now.abs_value_us); | ||
409 | } | ||
398 | } | 410 | } |
399 | rd_count = j; | 411 | rd_count = j; |
400 | if (NULL != proc) | 412 | if (NULL != proc) |