[Concept,03/14] luks: Tidy up debugging of unlock

Message ID 20251116212334.1603490-4-simon.glass@canonical.com
State New
Headers
Series luks: Integrate support for a TKey |

Commit Message

Simon Glass Nov. 16, 2025, 9:23 p.m. UTC
  Name the derived key as such to avoid confusion. Fix a typo in nearby
log_debug() statement.

Update essiv_decrypt() to have a const * for its first argument.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 drivers/block/luks.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/block/luks.c b/drivers/block/luks.c
index a7f5b436e12..94139b4f56d 100644
--- a/drivers/block/luks.c
+++ b/drivers/block/luks.c
@@ -358,7 +358,7 @@  static int try_keyslot(struct udevice *blk, struct disk_partition *pinfo,
 
 	/* Decrypt key material using derived key */
 	log_debug("expand key with key_size*8 %u bits\n", key_size * 8);
-	log_debug_hex("input key (derived_key) full:", derived_key, key_size);
+	log_debug_hex("derived_key", derived_key, key_size);
 
 	aes_expand_key(derived_key, key_size * 8, expkey);
 	log_debug_hex("expanded key [0-15]:", expkey, 16);
@@ -405,7 +405,7 @@  static int try_keyslot(struct udevice *blk, struct disk_partition *pinfo,
 
 	/* Check if the digest matches */
 	if (!memcmp(key_digest, hdr->mk_digest, LUKS_DIGESTSIZE)) {
-		log_debug("Uunlocked with key slot %d\n", slot_idx);
+		log_debug("Unlocked with key slot %d\n", slot_idx);
 		return 0;
 	}
 	log_debug("key slot %d: wrong passphrase\n", slot_idx);