Skip to content

Commit

Permalink
fix(crypt-gpg): execute --card-status on each try
Browse files Browse the repository at this point in the history
If the gpg card is not inserted before the --card-status command is
executed then the public key is not linked with the card. Therefore,
the LUKS partition cannot be decrypted. To solve this, the
--card--status command is executed on each try.
  • Loading branch information
LinkTed authored and johannbg committed Jun 29, 2021
1 parent c7fbc0c commit 6610093
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules.d/91crypt-gpg/crypt-gpg-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gpg_decrypt() {
fi

ask_for_password \
--cmd "gpg $opts --decrypt $mntp/$keypath" \
--cmd "GNUPGHOME=$gpghome gpg --card-status --no-tty > /dev/null 2>&1; gpg $opts --decrypt $mntp/$keypath" \
--prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \
--tries 3 --tty-echo-off

Expand Down

0 comments on commit 6610093

Please sign in to comment.