diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-15 17:33:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-15 17:33:14 -0400 |
commit | 4b4d302bcd168732c0e04d76bb387fd04fce06b5 (patch) | |
tree | 8cf3e71a238298773ea0a905dec0e12b8e13570c /Remote/GCrypt.hs | |
parent | a5a92f89d200ce109cdcfc72e2a21f4d92eef2cf (diff) |
Set gcrypt-publish-participants when setting up a gcrypt repository, to avoid unncessary passphrase prompts.
This is a security/usability tradeoff. To avoid exposing the gpg key ids
who can decrypt the repository, users can unset
gcrypt-publish-participants.
The gcrypt-publish-participants option is available in my fork of
git-remote-gcrypt.
This commit was sponsored by Christopher Kernahan.
Diffstat (limited to 'Remote/GCrypt.hs')
-rw-r--r-- | Remote/GCrypt.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index 60c2df73e..b2dd6cdaf 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -263,10 +263,14 @@ shellOrRsync r ashell arsync = case method of - participants, which gcrypt requires is the case, and may not be - depending on system configuration. - - - (For shared encryption, gcrypt's default behavior is used.) -} + - (For shared encryption, gcrypt's default behavior is used.) + - + - Also, sets gcrypt-publish-participants to avoid unncessary gpg + - passphrase prompts. + -} setGcryptEncryption :: RemoteConfig -> String -> Annex () setGcryptEncryption c remotename = do - let participants = ConfigKey $ Git.GCrypt.remoteParticipantConfigKey remotename + let participants = remoteconfig Git.GCrypt.remoteParticipantConfigKey case extractCipher c of Nothing -> noCrypto Just (EncryptedCipher _ _ (KeyIds { keyIds = ks})) -> do @@ -278,6 +282,10 @@ setGcryptEncryption c remotename = do (k:_) -> setConfig signingkey k Just (SharedCipher _) -> unsetConfig participants + setConfig (remoteconfig Git.GCrypt.remotePublishParticipantConfigKey) + (Git.Config.boolConfig True) + where + remoteconfig n = ConfigKey $ n remotename store :: Remote -> Remote.Rsync.RsyncOpts -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool store r rsyncopts (cipher, enck) k p |