From dd632994b5989b06346d192fa73d178ad5a54fd7 Mon Sep 17 00:00:00 2001 From: Sergio Arroutbi Date: Fri, 2 Dec 2022 12:00:48 +0100 Subject: [PATCH] Error expansion seems to be missed Fixes: #393 Signed-off-by: Sergio Arroutbi --- src/luks/clevis-luks-report | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/luks/clevis-luks-report b/src/luks/clevis-luks-report index c55df29c..1d27112a 100755 --- a/src/luks/clevis-luks-report +++ b/src/luks/clevis-luks-report @@ -97,9 +97,13 @@ report_sss() { [ -z "${content}" ] && return 1 local jwe - for jwe in $(jose fmt --json="${content}" --get jwe --foreach=-); do + local jwe_list + if ! jwe_list="$(jose fmt --json="${content}" --get jwe --foreach=-);"; then + return 1 + fi + for jwe in $jwe_list; do jwe="$(printf '%s' "${jwe}" | sed -e 's/"//g')" - report_decode "${jwe}" + report_decode "${jwe}" || return 1 done } @@ -129,10 +133,10 @@ report_decode() { case "${pin}" in tang) - report_tang "${content}" + report_tang "${content}" || return 1 ;; sss) - report_sss "${content}" + report_sss "${content}" || return 1 ;; esac }