- if (verification_key && journal_file_fss_enabled(f)) {
+ if (verification_key && JOURNAL_HEADER_SEALED(f->header)) {
log_info("=> Validated from %s to %s, %s missing",
format_timestamp(a, sizeof(a), from),
format_timestamp(b, sizeof(b), to),
log_info("=> Validated from %s to %s, %s missing",
format_timestamp(a, sizeof(a), from),
format_timestamp(b, sizeof(b), to),
- format_timespan(c, sizeof(c), total > to ? total - to : 0));
+ format_timespan(c, sizeof(c), total > to ? total - to : 0, 0));
}
}
+
journal_file_close(f);
journal_file_close(f);
- log_info("Toggling bits...");
+ if (verification_key) {
+ log_info("Toggling bits...");
- assert_se(stat("test.journal", &st) >= 0);
+ assert_se(stat("test.journal", &st) >= 0);
- for (p = 240*8; p < ((uint64_t) st.st_size * 8); p ++) {
- bit_toggle("test.journal", p);
+ for (p = 38448*8+0; p < ((uint64_t) st.st_size * 8); p ++) {
+ bit_toggle("test.journal", p);
- log_info("[ %llu+%llu]", (unsigned long long) p / 8, (unsigned long long) p % 8);
+ log_info("[ %"PRIu64"+%"PRIu64"]", p / 8, p % 8);
- if (raw_verify("test.journal", verification_key) >= 0) {
- log_notice(ANSI_HIGHLIGHT_RED_ON ">>>> %llu (bit %llu) can be toggled without detection." ANSI_HIGHLIGHT_OFF, (unsigned long long) p / 8, (unsigned long long) p % 8);
- sleep(1);
- }
+ if (raw_verify("test.journal", verification_key) >= 0)
+ log_notice(ANSI_HIGHLIGHT_RED_ON ">>>> %"PRIu64" (bit %"PRIu64") can be toggled without detection." ANSI_HIGHLIGHT_OFF, p / 8, p % 8);