summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-keyring.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-02-22 17:29:48 +0000
committerHavoc Pennington <hp@redhat.com>2003-02-22 17:29:48 +0000
commit6c07098c5ec68e78320a6f07e4c9e141a95729ed (patch)
treef57c665728bb0efaf363701b6e9b37758de136c6 /dbus/dbus-keyring.c
parent92f7d50b3b420670732a55bf15f7b343b2ce9fe6 (diff)
2003-02-22 Havoc Pennington <hp@pobox.com>
* dbus/dbus-message.c (dbus_message_iter_get_string_array): (dbus_message_iter_get_byte_array): Fix up doxygen warnings * dbus/dbus-sha.c: add implementation of SHA-1 algorithm * dbus/test/data/sha-1: add US government test suite for SHA-1
Diffstat (limited to 'dbus/dbus-keyring.c')
-rw-r--r--dbus/dbus-keyring.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/dbus/dbus-keyring.c b/dbus/dbus-keyring.c
index 0f1dd1c9..0bc7ab9a 100644
--- a/dbus/dbus-keyring.c
+++ b/dbus/dbus-keyring.c
@@ -53,12 +53,16 @@
* @{
*/
-/** The maximum time a key can be alive before we switch to a
- * new one. This isn't super-reliably enforced, since
- * system clocks can change or be wrong, but we make
- * a best effort to only use keys for a short time.
+/** The maximum age of a key before we create a new key to use in
+ * challenges. This isn't super-reliably enforced, since system
+ * clocks can change or be wrong, but we make a best effort to only
+ * use keys for a short time.
*/
-#define MAX_KEY_LIFETIME_SECONDS (60*5)
+#define NEW_KEY_TIMEOUT (60*5)
+/**
+ * The time after which we drop a key from the secrets file
+ */
+#define EXPIRE_KEYS_TIMEOUT (NEW_KEY_TIMEOUT + (60*2))
typedef struct
{
@@ -432,7 +436,7 @@ find_recent_key (DBusKeyring *keyring)
{
DBusKey *key = &keyring->keys[i];
- if (tv_sec - MAX_KEY_LIFETIME_SECONDS < key->creation_time)
+ if (tv_sec - NEW_KEY_TIMEOUT < key->creation_time)
return key;
++i;