summaryrefslogtreecommitdiff
path: root/src/journal/journal-authenticate.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-21 01:29:17 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-21 01:29:17 +0200
commit89fef99014662a5a63e7deaedd6292b7fb4ab2f8 (patch)
tree3482b20354f36b0a8874f27a9c115dad9ce2d6c0 /src/journal/journal-authenticate.c
parentc05276f23e216a706936f1ee45a7005f86b3599c (diff)
journal: automatically evolve FSS key even when nothing is logged
Diffstat (limited to 'src/journal/journal-authenticate.c')
-rw-r--r--src/journal/journal-authenticate.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/journal/journal-authenticate.c b/src/journal/journal-authenticate.c
index 435481000d..fd81797cf9 100644
--- a/src/journal/journal-authenticate.c
+++ b/src/journal/journal-authenticate.c
@@ -211,6 +211,9 @@ int journal_file_maybe_append_tag(JournalFile *f, uint64_t realtime) {
if (!f->seal)
return 0;
+ if (realtime <= 0)
+ realtime = now(CLOCK_MONOTONIC);
+
r = journal_file_fsprg_need_evolve(f, realtime);
if (r <= 0)
return 0;
@@ -517,3 +520,19 @@ int journal_file_parse_verification_key(JournalFile *f, const char *key) {
return 0;
}
+
+bool journal_file_next_evolve_usec(JournalFile *f, usec_t *u) {
+ uint64_t epoch;
+
+ assert(f);
+ assert(u);
+
+ if (!f->seal)
+ return false;
+
+ epoch = FSPRG_GetEpoch(f->fsprg_state);
+
+ *u = (usec_t) (f->fss_start_usec + f->fss_interval_usec * epoch + f->fss_interval_usec);
+
+ return true;
+}