From d4db24bfc34b29a3a894ebea2caa3ed6724207d7 Mon Sep 17 00:00:00 2001 From: vnctdj Date: Fri, 11 Jun 2021 18:43:24 +0200 Subject: Use GPG_OPTS when verifying .gpg-id signature I use a pass-specific gpg home directory. I tell pass about it by using PASSWORD_STORE_GPG_OPTS="--homedir dir". I also tell pass to sign files with PASSWORD_STORE_SIGNING_KEY. However "pass init" returns "Signing of .gpg_id unsuccessful." because we forgot to hand it GPG_OPTS. This patch fixes that oversight. --- src/password-store.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/password-store.sh b/src/password-store.sh index 2b2d208..e99b455 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -355,7 +355,7 @@ cmd_init() { signing_keys+=( --default-key $key ) done $GPG "${GPG_OPTS[@]}" "${signing_keys[@]}" --detach-sign "$gpg_id" || die "Could not sign .gpg_id." - key="$($GPG --verify --status-fd=1 "$gpg_id.sig" "$gpg_id" 2>/dev/null | sed -n 's/^\[GNUPG:\] VALIDSIG [A-F0-9]\{40\} .* \([A-F0-9]\{40\}\)$/\1/p')" + key="$($GPG "${GPG_OPTS[@]}" --verify --status-fd=1 "$gpg_id.sig" "$gpg_id" 2>/dev/null | sed -n 's/^\[GNUPG:\] VALIDSIG [A-F0-9]\{40\} .* \([A-F0-9]\{40\}\)$/\1/p')" [[ -n $key ]] || die "Signing of .gpg_id unsuccessful." git_add_file "$gpg_id.sig" "Signing new GPG id with ${key//[$IFS]/,}." fi -- cgit v1.2.3