Skip to content

Commit ee138b1

Browse files
committed
Add keyslot fix for cryptsetup
1 parent d58b274 commit ee138b1

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FILESEXTRAPATHS:append := "${THISDIR}/files:"
2+
3+
SRC_URI += "file://0001-keyslot-fix.patch"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 20eca0e409ab83bcf4df26bd3fcb3782ff44f33a Mon Sep 17 00:00:00 2001
2+
From: alexh-scrt <[email protected]>
3+
Date: Tue, 26 Aug 2025 17:39:09 +0000
4+
Subject: [PATCH] fix
5+
6+
---
7+
lib/luks2/luks2_keyslot_luks2.c | 4 ++++
8+
1 file changed, 4 insertions(+)
9+
10+
diff --git a/lib/luks2/luks2_keyslot_luks2.c b/lib/luks2/luks2_keyslot_luks2.c
11+
index 2c1f400..020a792 100644
12+
--- a/lib/luks2/luks2_keyslot_luks2.c
13+
+++ b/lib/luks2/luks2_keyslot_luks2.c
14+
@@ -336,6 +336,10 @@ static int luks2_keyslot_get_key(struct crypt_device *cd,
15+
if (r < 0)
16+
return r;
17+
18+
+ /* Allow only empty passphrase with null cipher */
19+
+ if (crypt_is_cipher_null(cipher) && passwordLen)
20+
+ return -EPERM;
21+
+
22+
if (!json_object_object_get_ex(jobj_area, "key_size", &jobj2))
23+
return -EINVAL;
24+
keyslot_key_len = json_object_get_int(jobj2);

0 commit comments

Comments
 (0)