From 4f04d2d43bb7031d25cb15318db204c4119129d7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Feb 2013 00:00:00 +0000 Subject: 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..gcrypt-participants to configure this per remote. --- git-remote-gcrypt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'git-remote-gcrypt') 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.$$" -- cgit v1.2.3