From 44c3fae6e7cc60cc82f5d919c6b8d3e15c707b71 Mon Sep 17 00:00:00 2001 From: adeliktas Date: Tue, 12 Nov 2024 00:49:43 +0100 Subject: [PATCH] handle PIN with special characters in scripts piping to fido2luks-0.2.19 --- src/skfde-cred | 2 +- src/skfde-enroll | 2 +- src/skfde-format | 2 +- src/skfde-open | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/skfde-cred b/src/skfde-cred index 386bed8..c937031 100644 --- a/src/skfde-cred +++ b/src/skfde-cred @@ -7,7 +7,7 @@ echo "Generate the SoloKey credential" read -s -p "Enter the SoloKey PIN and Press the button: " PIN echo -e "\nRemember to press the SoloKey button if necessary" -CREDENTIAL="$(printf $PIN | fido2luks credential \ +CREDENTIAL="$(echo -n ${PIN} | fido2luks credential \ --pin --pin-source /dev/stdin 2>&1)" echo "SoloKey credential : $CREDENTIAL" diff --git a/src/skfde-enroll b/src/skfde-enroll index 2281020..e7cf5e3 100644 --- a/src/skfde-enroll +++ b/src/skfde-enroll @@ -90,7 +90,7 @@ fi if [ -z "$SKFDE_RESPONSE" ]; then read -s -p "Enter the SoloKey PIN: " PIN echo -e "\nRemember to press the SoloKey button if necessary" - SKFDE_RESPONSE="$(printf $PIN | fido2luks print-secret $SKFDE_CREDENTIAL \ + SKFDE_RESPONSE="$(echo -n ${PIN} | fido2luks print-secret $SKFDE_CREDENTIAL \ --salt string:$SKFDE_CHALLENGE --pin --pin-source /dev/stdin 2>&1)" SKFDE_PASSPHRASE="$SKFDE_RESPONSE" fi diff --git a/src/skfde-format b/src/skfde-format index 2ea3bdd..58f169f 100644 --- a/src/skfde-format +++ b/src/skfde-format @@ -27,7 +27,7 @@ fi if [ -z "$SKFDE_RESPONSE" ]; then read -s -p "Enter the SoloKey PIN: " PIN echo -e "\nRemember to press the SoloKey button if necessary" - SKFDE_RESPONSE="$(printf $PIN | fido2luks print-secret $SKFDE_CREDENTIAL \ + SKFDE_RESPONSE="$(echo -n ${PIN} | fido2luks print-secret $SKFDE_CREDENTIAL \ --salt string:$SKFDE_CHALLENGE --pin --pin-source /dev/stdin 2>&1)" SKFDE_PASSPHRASE="$SKFDE_RESPONSE" fi diff --git a/src/skfde-open b/src/skfde-open index 796fd96..64dba52 100644 --- a/src/skfde-open +++ b/src/skfde-open @@ -109,7 +109,7 @@ fi if [ -z "$SKFDE_RESPONSE" ]; then read -s -p "Enter the SoloKey PIN: " PIN echo -e "\nRemember to press the SoloKey button if necessary" - SKFDE_RESPONSE="$(printf $PIN | fido2luks print-secret $SKFDE_CREDENTIAL \ + SKFDE_RESPONSE="$(echo -n ${PIN} | fido2luks print-secret $SKFDE_CREDENTIAL \ --salt string:$SKFDE_CHALLENGE --pin --pin-source /dev/stdin 2>&1)" SKFDE_PASSPHRASE="$SKFDE_RESPONSE" fi