]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-journal-verify: replace HAVE_GCRYPT ifdef with journal_auth_supported()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 27 Jun 2026 06:49:31 +0000 (15:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 27 Jun 2026 15:00:11 +0000 (00:00 +0900)
src/libsystemd/sd-journal/test-journal-verify.c

index 413f8ce05c6df0f4e5d957435f39f78052c0e5e0..6a1401764bd3afd7fc61d00950d8e0a0213f9d2d 100644 (file)
@@ -190,10 +190,9 @@ int main(int argc, char *argv[]) {
         ASSERT_OK_ERRNO(setenv("SYSTEMD_JOURNAL_COMPACT", "1", 1));
         run_test(verification_key, max_iterations);
 
-#if HAVE_GCRYPT
-        /* If we're running without any arguments and we're compiled with gcrypt
+        /* If we're running without any arguments and journal sealing support is enabled,
          * check the journal verification stuff with a valid key as well */
-        if (argc <= 1) {
+        if (argc <= 1 && journal_auth_supported()) {
                 verification_key = "c262bd-85187f-0b1b04-877cc5/1c7af8-35a4e900";
 
                 ASSERT_OK_ERRNO(setenv("SYSTEMD_JOURNAL_COMPACT", "0", 1));
@@ -202,7 +201,6 @@ int main(int argc, char *argv[]) {
                 ASSERT_OK_ERRNO(setenv("SYSTEMD_JOURNAL_COMPACT", "1", 1));
                 run_test(verification_key, max_iterations);
         }
-#endif
 
         return 0;
 }