summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-09 18:06:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-09 18:06:49 -0400
commit71863ac267113e79e2c6260361a4c1850b979b99 (patch)
tree6e7e4b78de91bd1b67096455343d21647c596ebe /Test.hs
parent7c5af228ec0438c9ac40832311fd00ba07374abe (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 'Test.hs')
-rw-r--r--Test.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Test.hs b/Test.hs
index f9f79b463..9dd5edd37 100644
--- a/Test.hs
+++ b/Test.hs
@@ -1347,9 +1347,11 @@ test_crypto = do
testscheme "hybrid"
testscheme "pubkey"
where
- testscheme scheme = intmpclonerepo $ whenM (Utility.Path.inPath Utility.Gpg.gpgcmd) $ do
- Utility.Gpg.testTestHarness @? "test harness self-test failed"
- Utility.Gpg.testHarness $ do
+ gpgcmd = Utility.Gpg.mkGpgCmd Nothing
+ testscheme scheme = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
+ Utility.Gpg.testTestHarness gpgcmd
+ @? "test harness self-test failed"
+ Utility.Gpg.testHarness gpgcmd $ do
createDirectory "dir"
let a cmd = git_annex cmd $
[ "foo"
@@ -1397,16 +1399,16 @@ test_crypto = do
keysMatch (Utility.Gpg.KeyIds ks') =
maybe False (\(Utility.Gpg.KeyIds ks2) ->
sort (nub ks2) == sort (nub ks')) ks
- checkCipher encipher = Utility.Gpg.checkEncryptionStream encipher . Just
+ checkCipher encipher = Utility.Gpg.checkEncryptionStream gpgcmd encipher . Just
checkScheme Types.Crypto.Hybrid = scheme == "hybrid"
checkScheme Types.Crypto.PubKey = scheme == "pubkey"
checkKeys cip mvariant = do
- cipher <- Crypto.decryptCipher cip
+ cipher <- Crypto.decryptCipher gpgcmd cip
files <- filterM doesFileExist $
map ("dir" </>) $ concatMap (key2files cipher) keys
return (not $ null files) <&&> allM (checkFile mvariant) files
checkFile mvariant filename =
- Utility.Gpg.checkEncryptionFile filename $
+ Utility.Gpg.checkEncryptionFile gpgcmd filename $
if mvariant == Just Types.Crypto.PubKey then ks else Nothing
key2files cipher = Locations.keyPaths .
Crypto.encryptKey Types.Crypto.HmacSha1 cipher