diff options
author | 2015-09-09 18:06:49 -0400 | |
---|---|---|
committer | 2015-09-09 18:06:49 -0400 | |
commit | 71863ac267113e79e2c6260361a4c1850b979b99 (patch) | |
tree | 6e7e4b78de91bd1b67096455343d21647c596ebe /Creds.hs | |
parent | 7c5af228ec0438c9ac40832311fd00ba07374abe (diff) |
support gpg.program
When gpg.program is configured, it's used to get the command to run for
gpg. Useful on systems that have only a gpg2 command or want to use it
instead of the gpg command.
Diffstat (limited to 'Creds.hs')
-rw-r--r-- | Creds.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -20,6 +20,7 @@ module Creds ( ) where import Common.Annex +import qualified Annex import Types.Creds import Annex.Perms import Utility.FileMode @@ -65,7 +66,8 @@ setRemoteCredPair _ c storage (Just creds) return c storeconfig key (Just cipher) = do - s <- liftIO $ encrypt (getGpgEncParams c) cipher + cmd <- gpgCmd <$> Annex.getGitConfig + s <- liftIO $ encrypt cmd (getGpgEncParams c) cipher (feedBytes $ L.pack $ encodeCredPair creds) (readBytes $ return . L.unpack) return $ M.insert key (toB64 s) c @@ -91,7 +93,8 @@ getRemoteCredPair c storage = maybe fromcache (return . Just) =<< fromenv fromcreds $ fromB64 bcreds Nothing -> return Nothing fromenccreds enccreds cipher storablecipher = do - mcreds <- liftIO $ catchMaybeIO $ decrypt cipher + cmd <- gpgCmd <$> Annex.getGitConfig + mcreds <- liftIO $ catchMaybeIO $ decrypt cmd cipher (feedBytes $ L.pack $ fromB64 enccreds) (readBytes $ return . L.unpack) case mcreds of |