diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-06-05 20:45:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-06-17 00:03:12 +0200 |
commit | 8144056fa63291e5b25d91a48cd77b91e845eabf (patch) | |
tree | fa01e43f80c19d30e4acb5b572274d8369575e9c | |
parent | 23b0b2b2647d3f0f3fd0219c877d6233b4585421 (diff) |
journal: add basic object definition for signatures
-rw-r--r-- | src/journal/journal-def.h | 18 | ||||
-rw-r--r-- | src/journal/journal-file.c | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h index 53f1e22cf0..86aef8f372 100644 --- a/src/journal/journal-def.h +++ b/src/journal/journal-def.h @@ -29,13 +29,17 @@ #include "macro.h" typedef struct Header Header; + typedef struct ObjectHeader ObjectHeader; typedef union Object Object; + typedef struct DataObject DataObject; typedef struct FieldObject FieldObject; typedef struct EntryObject EntryObject; typedef struct HashTableObject HashTableObject; typedef struct EntryArrayObject EntryArrayObject; +typedef struct SignatureObject SignatureObject; + typedef struct EntryItem EntryItem; typedef struct HashItem HashItem; @@ -48,6 +52,7 @@ enum { OBJECT_DATA_HASH_TABLE, OBJECT_FIELD_HASH_TABLE, OBJECT_ENTRY_ARRAY, + OBJECT_SIGNATURE, _OBJECT_TYPE_MAX }; @@ -115,6 +120,14 @@ _packed_ struct EntryArrayObject { le64_t items[]; }; +#define SIGNATURE_LENGTH 160 + +_packed_ struct SignatureObject { + ObjectHeader object; + le64_t from; + uint8_t signature[SIGNATURE_LENGTH]; +}; + union Object { ObjectHeader object; DataObject data; @@ -122,6 +135,7 @@ union Object { EntryObject entry; HashTableObject hash_table; EntryArrayObject entry_array; + SignatureObject signature; }; enum { @@ -135,6 +149,10 @@ enum { HEADER_INCOMPATIBLE_COMPRESSED = 1 }; +enum { + HEADER_COMPATIBLE_SIGNED = 1 +}; + _packed_ struct Header { uint8_t signature[8]; /* "LPKSHHRH" */ uint32_t compatible_flags; diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index bbe00ab1ef..8f301b87f9 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1702,6 +1702,10 @@ void journal_file_dump(JournalFile *f) { case OBJECT_ENTRY_ARRAY: printf("Type: OBJECT_ENTRY_ARRAY\n"); break; + + case OBJECT_SIGNATURE: + printf("Type: OBJECT_SIGNATURE\n"); + break; } if (o->object.flags & OBJECT_COMPRESSED) |