/**
* How often do we rekey based on time (at least)
*/
-#define REKEY_TIME_INTERVAL GNUNET_TIME_UNIT_DAYS
+#define DEFAULT_REKEY_INTERVAL GNUNET_TIME_UNIT_DAYS
/**
* How long do we wait until we must have received the initial KX?
*/
static struct GNUNET_PeerIdentity my_identity;
+/**
+ * The rekey interval
+ */
+static struct GNUNET_TIME_Relative rekey_interval;
+
/**
* Our private key.
*/
/* we don't need the private key anymore, drop it! */
memset (&queue->ephemeral, 0, sizeof(queue->ephemeral));
setup_cipher (&dh, &queue->target, &queue->out_cipher, &queue->out_hmac);
- queue->rekey_time = GNUNET_TIME_relative_to_absolute (REKEY_TIME_INTERVAL);
+ queue->rekey_time = GNUNET_TIME_relative_to_absolute (rekey_interval);
queue->rekey_left_bytes =
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, REKEY_MAX_BYTES);
}
"MAX_QUEUE_LENGTH",
&max_queue_length))
max_queue_length = DEFAULT_MAX_QUEUE_LENGTH;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ COMMUNICATOR_CONFIG_SECTION,
+ "REKEY_INTERVAL",
+ &rekey_interval))
+ rekey_interval = DEFAULT_REKEY_INTERVAL;
in = tcp_address_to_sockaddr (bindto, &in_len);
if (NULL == in)