diff options
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; +} |