aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-02-14 00:00:00 +0000
committerroot <root@localhost>2013-02-14 00:00:00 +0000
commit4f04d2d43bb7031d25cb15318db204c4119129d7 (patch)
tree9f7d3eab252463bed5e846255835eacf190e89d8
parent14da0a4d33c10dfd7f499d0e144f3df9f9193990 (diff)
downloadgit-remote-gcrypt-4f04d2d43bb7031d25cb15318db204c4119129d7.zip
git-remote-gcrypt-4f04d2d43bb7031d25cb15318db204c4119129d7.tar.gz
git-remote-gcrypt-4f04d2d43bb7031d25cb15318db204c4119129d7.tar.bz2
Encrypt to self by default; basic functionality now needs no configuration
Introduces gcrypt.participants "simple" mode which encrypts to self, and accepts any valid signature by default. No configuration needed for private repositories. We also adds remote.<name>.gcrypt-participants to configure this per remote.
-rwxr-xr-xgit-remote-gcrypt13
1 files changed, 11 insertions, 2 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 98c8ee6..93665dd 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -328,7 +328,8 @@ read_config()
local recp_= key_line= cap_= conf_keyring= conf_part=
Conf_signkey=$(git config --path user.signingkey || :)
conf_keyring=$(git config --path gcrypt.keyring || :)
- conf_part=$(git config --get gcrypt.participants '.+' || :)
+ conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' ||
+ git config --get gcrypt.participants '.+' || :)
# Figure out which keys we should encrypt to or accept signatures from
if isnonnull "$conf_keyring" && isnull "$conf_part"
@@ -339,6 +340,14 @@ read_config()
--with-colons --fast-list -k | grep ^pub | cut -f 5 -d :)
fi
+ if isnull "$conf_part" || iseq "$conf_part" simple
+ then
+ Signers="(default keyring)"
+ Recipients="--throw-keyids --default-recipient-self"
+ Goodsig="^\[GNUPG:\] GOODSIG "
+ return 0
+ fi
+
for recp_ in $conf_part
do
key_line=$(gpg --with-colons --fast-list -k "$recp_" | xgrep ^pub)
@@ -662,7 +671,7 @@ EOF
fi
# Generate manifest
- echo_info "Participants are: $Signers"
+ echo_info "Encrypting to: $Recipients"
echo_info "Requesting manifest signature"
TmpManifest_Enc="$Localdir/tmp_manifest.$$"