journal: use recognizable error code

EINVAL is too generic and widely used. Let's use more specific error code.
This commit is contained in:
Yu Watanabe
2026-06-27 14:04:49 +09:00
parent 20e0244bdf
commit c286c0daaf
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ int action_verify(void) {
#endif
k = journal_file_verify(f, arg_verify_key, &first, &validated, &last, /* show_progress= */ !arg_quiet);
if (k == -EINVAL)
if (k == -EKEYREJECTED)
/* If the key was invalid give up right-away. */
return k;
if (k < 0)
@@ -515,24 +515,24 @@ int journal_file_parse_verification_key(JournalFile *f, const char *key) {
x = unhexchar(*k);
if (x < 0)
return -EINVAL;
return -EKEYREJECTED;
k++;
y = unhexchar(*k);
if (y < 0)
return -EINVAL;
return -EKEYREJECTED;
k++;
seed[c] = (uint8_t) (x * 16 + y);
}
if (*k != '/')
return -EINVAL;
return -EKEYREJECTED;
k++;
r = sscanf(k, "%llx-%llx", &start, &interval);
if (r != 2)
return -EINVAL;
return -EKEYREJECTED;
f->fsprg_seed = IOVEC_MAKE(TAKE_PTR(seed), seed_size);
f->fss_start_usec = start * interval;