grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 1/2] luks2: Propagate error when reading area key fails


From: Patrick Steinhardt
Subject: [PATCH v2 1/2] luks2: Propagate error when reading area key fails
Date: Thu, 16 Apr 2020 19:15:12 +0200

When decrypting a given keyslot, all error cases except for one set up
an error and return the error code. The only exception is when we try to
read the area key: instead of setting up an error message, we directly
print it via `grub_dprintf()`.

Convert the outlier to use `grub_error()` to allow more uniform handling
of errors.

Signed-off-by: Patrick Steinhardt <address@hidden>
---
 grub-core/disk/luks2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c
index 65c4f0aac..e3ff7c83d 100644
--- a/grub-core/disk/luks2.c
+++ b/grub-core/disk/luks2.c
@@ -487,7 +487,7 @@ luks2_decrypt_key (grub_uint8_t *out_key,
   ret = grub_disk_read (disk, 0, k->area.offset, k->area.size, split_key);
   if (ret)
     {
-      grub_dprintf ("luks2", "Read error: %s\n", grub_errmsg);
+      grub_error (GRUB_ERR_IO, "Read error: %s\n", grub_errmsg);
       goto err;
     }
 
-- 
2.26.1

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]