summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-16 01:59:25 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-16 17:10:57 +0200
commitf59a5f6b873d8bf994e2d85671f2554b9fdd62db (patch)
tree377a7a41d14da7b3e6c7988c65ae602f940a8dfd /src/journal/journal-file.c
parent0284adc6a60ce0af1107cb0b50041a65d731f39e (diff)
journal: verify hashes only during actual verification, not all the time
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index ff439f2474..efa0910780 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -319,23 +319,6 @@ static int journal_file_move_to(JournalFile *f, int context, uint64_t offset, ui
return mmap_cache_get(f->mmap, f->fd, f->prot, context, offset, size, ret);
}
-static bool verify_hash(Object *o) {
- uint64_t h1, h2;
-
- assert(o);
-
- if (o->object.type == OBJECT_DATA && !(o->object.flags & OBJECT_COMPRESSED)) {
- h1 = le64toh(o->data.hash);
- h2 = hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload));
- } else if (o->object.type == OBJECT_FIELD) {
- h1 = le64toh(o->field.hash);
- h2 = hash64(o->field.payload, le64toh(o->object.size) - offsetof(Object, field.payload));
- } else
- return true;
-
- return h1 == h2;
-}
-
static uint64_t minimum_header_size(Object *o) {
static uint64_t table[] = {
@@ -394,9 +377,6 @@ int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Objec
o = (Object*) t;
}
- if (!verify_hash(o))
- return -EBADMSG;
-
*ret = o;
return 0;
}