[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30317 - gnunet/src/gnsrecord
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30317 - gnunet/src/gnsrecord |
Date: |
Fri, 18 Oct 2013 15:36:09 +0200 |
Author: grothoff
Date: 2013-10-18 15:36:08 +0200 (Fri, 18 Oct 2013)
New Revision: 30317
Modified:
gnunet/src/gnsrecord/gnsrecord_crypto.c
Log:
-convert to absolute time instead of failing
Modified: gnunet/src/gnsrecord/gnsrecord_crypto.c
===================================================================
--- gnunet/src/gnsrecord/gnsrecord_crypto.c 2013-10-18 13:35:53 UTC (rev
30316)
+++ gnunet/src/gnsrecord/gnsrecord_crypto.c 2013-10-18 13:36:08 UTC (rev
30317)
@@ -92,19 +92,25 @@
struct GNUNET_CRYPTO_EcdsaPrivateKey *dkey;
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
+ struct GNUNET_GNSRECORD_Data rdc[rd_count];
uint32_t rd_count_nbo;
unsigned int i;
+ struct GNUNET_TIME_Absolute now;
if (payload_len > GNUNET_GNSRECORD_MAX_BLOCK_SIZE)
return NULL;
- /* sanity check */
+ /* convert relative to absolute times */
+ now = GNUNET_TIME_absolute_get ();
for (i=0;i<rd_count;i++)
+ {
+ rdc[i] = rd[i];
if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
- {
- /* encrypted blocks must never have relative expiration times, skip! */
- GNUNET_break (0);
- return NULL;
- }
+ {
+ /* encrypted blocks must never have relative expiration times, convert!
*/
+ rdc[i].flags ^= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
+ rdc[i].expiration_time += now.abs_value_us;
+ }
+ }
/* serialize */
rd_count_nbo = htonl (rd_count);
memcpy (payload, &rd_count_nbo, sizeof (uint32_t));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30317 - gnunet/src/gnsrecord,
gnunet <=