]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
creds: Use ERRNO_IS_NEG_TPM2_UNSEAL_BAD_PCR
authorKai Lüke <kai@amutable.com>
Mon, 6 Jul 2026 13:58:39 +0000 (22:58 +0900)
committerKai Lüke <pothos@users.noreply.github.com>
Fri, 10 Jul 2026 06:07:47 +0000 (08:07 +0200)
The error set was duplicated, use the macro.

src/creds/creds.c

index 6dc4ea9277d0a216cf23c12cd4a25b9424be90ae..9d17e30ac1f76e4a0c92fe4e97266d83776b2e02 100644 (file)
@@ -1411,7 +1411,7 @@ static int vl_method_decrypt(sd_varlink *link, sd_json_variant *parameters, sd_v
                 ask_polkit = true;
         }
 
-        if (IN_SET(r, -EREMCHG, -ENOANO, -EUCLEAN, -EPERM))
+        if (ERRNO_IS_NEG_TPM2_UNSEAL_BAD_PCR(r))
                 return sd_varlink_error(link, "io.systemd.Credentials.UnexpectedPCRState", NULL);
         if (r < 0) {
                 const CredentialsVarlinkError *e = credentials_varlink_error_by_errno(r);