m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvnctdj <vnctdj@laposte.net>2021-06-11 18:43:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-06-11 18:44:09 +0200
commitd4db24bfc34b29a3a894ebea2caa3ed6724207d7 (patch)
treea221778768e94e30bb93440831023a3427afde0e
parenta271b43cbd76cc30406202c49041b552656538bd (diff)
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.
-rwxr-xr-xsrc/password-store.sh2
1 files changed, 1 insertions, 1 deletions
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