diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-08-21 01:29:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-08-21 01:29:17 +0200 |
commit | 89fef99014662a5a63e7deaedd6292b7fb4ab2f8 (patch) | |
tree | 3482b20354f36b0a8874f27a9c115dad9ce2d6c0 /src/journal/journal-authenticate.c | |
parent | c05276f23e216a706936f1ee45a7005f86b3599c (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.c | 19 |
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; +} |