HEADER_COMPATIBLE_TAIL_ENTRY_BOOT_ID |
HEADER_COMPATIBLE_SEALED_CONTINUOUS,
- HEADER_COMPATIBLE_SUPPORTED = (HAVE_GCRYPT ? HEADER_COMPATIBLE_SEALED | HEADER_COMPATIBLE_SEALED_CONTINUOUS : 0) |
+ HEADER_COMPATIBLE_SUPPORTED = HEADER_COMPATIBLE_SEALED |
+ HEADER_COMPATIBLE_SEALED_CONTINUOUS |
HEADER_COMPATIBLE_TAIL_ENTRY_BOOT_ID,
};
}
static bool warn_wrong_flags(const JournalFile *f, bool compatible) {
- const uint32_t any = compatible ? HEADER_COMPATIBLE_ANY : HEADER_INCOMPATIBLE_ANY,
- supported = compatible ? HEADER_COMPATIBLE_SUPPORTED : HEADER_INCOMPATIBLE_SUPPORTED;
+ const uint32_t any = compatible ? HEADER_COMPATIBLE_ANY : HEADER_INCOMPATIBLE_ANY;
+ uint32_t supported = compatible ? HEADER_COMPATIBLE_SUPPORTED : HEADER_INCOMPATIBLE_SUPPORTED;
const char *type = compatible ? "compatible" : "incompatible";
uint32_t flags;
assert(f);
assert(f->header);
+ /* When sealing is not supported, refuse to write to an already sealed journal file, but still allow
+ * reading sealed journal files. */
+ if (compatible && journal_file_writable(f) && !journal_auth_supported())
+ supported &= ~(HEADER_COMPATIBLE_SEALED | HEADER_COMPATIBLE_SEALED_CONTINUOUS);
+
flags = le32toh(compatible ? f->header->compatible_flags : f->header->incompatible_flags);
if (flags & ~supported) {