summaryrefslogtreecommitdiff
path: root/src/journal/journal-verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journal-verify.c')
-rw-r--r--src/journal/journal-verify.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index a31817671b..535b2727ac 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -35,8 +35,8 @@
/* FIXME:
*
- * - write bit mucking test
* - evolve key even if nothing happened in regular intervals
+ * - add macro for accessing flags
*
* - Allow building without libgcrypt
* - check with sparse
@@ -115,7 +115,8 @@ static int journal_file_object_verify(JournalFile *f, Object *o) {
return -EBADMSG;
if (le64toh(o->entry.seqnum) <= 0 ||
- le64toh(o->entry.realtime) <= 0)
+ !VALID_REALTIME(le64toh(o->entry.realtime)) ||
+ !VALID_MONOTONIC(le64toh(o->entry.monotonic)))
return -EBADMSG;
for (i = 0; i < journal_file_entry_n_items(o); i++) {
@@ -169,6 +170,10 @@ static int journal_file_object_verify(JournalFile *f, Object *o) {
case OBJECT_TAG:
if (le64toh(o->object.size) != sizeof(TagObject))
return -EBADMSG;
+
+ if (!VALID_EPOCH(o->tag.epoch))
+ return -EBADMSG;
+
break;
}