40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
|
--- clevis-18.0008/src/luks/clevis-luks-common-functions.in 2022-12-16 11:59:17.972475773 +0100
|
||
|
+++ clevis-18/src/luks/clevis-luks-common-functions.in 2022-12-16 12:05:07.214424096 +0100
|
||
|
@@ -319,6 +319,7 @@
|
||
|
clevis_luks_unlock_device_by_slot() {
|
||
|
local DEV="${1}"
|
||
|
local SLT="${2}"
|
||
|
+ local SKIP_CHECK="${3}"
|
||
|
|
||
|
[ -z "${DEV}" ] && return 1
|
||
|
[ -z "${SLT}" ] && return 1
|
||
|
@@ -334,7 +335,9 @@
|
||
|
return 1
|
||
|
fi
|
||
|
|
||
|
- clevis_luks_check_valid_key_or_keyfile "${DEV}" "${passphrase}" || return 1
|
||
|
+ if [ -z "${SKIP_CHECK}" ]; then
|
||
|
+ clevis_luks_check_valid_key_or_keyfile "${DEV}" "${passphrase}" || return 1
|
||
|
+ fi
|
||
|
printf '%s' "${passphrase}"
|
||
|
}
|
||
|
|
||
|
@@ -342,6 +345,8 @@
|
||
|
# parameter and returns the decoded passphrase.
|
||
|
clevis_luks_unlock_device() {
|
||
|
local DEV="${1}"
|
||
|
+ local SKIP_CHECK="YES"
|
||
|
+
|
||
|
[ -z "${DEV}" ] && return 1
|
||
|
|
||
|
local used_slots
|
||
|
@@ -352,7 +357,7 @@
|
||
|
|
||
|
local slt pt
|
||
|
for slt in ${used_slots}; do
|
||
|
- if ! pt=$(clevis_luks_unlock_device_by_slot "${DEV}" "${slt}") \
|
||
|
+ if ! pt=$(clevis_luks_unlock_device_by_slot "${DEV}" "${slt}" "${SKIP_CHECK}") \
|
||
|
|| [ -z "${pt}" ]; then
|
||
|
continue
|
||
|
fi
|