summaryrefslogtreecommitdiff
path: root/Crypto.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-16 18:22:52 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-16 19:12:50 -0400
commit4f9fafa02354d275d6fa83ff42ada4ebd1bc83d8 (patch)
tree83fd6a4ade64d2e8e6ab390459fc48ba80b9c435 /Crypto.hs
parent9fe7e6be7064d9c47e6c6fd4f1b3a70da604727d (diff)
full encryption support for directory special remotes
Diffstat (limited to 'Crypto.hs')
-rw-r--r--Crypto.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Crypto.hs b/Crypto.hs
index 337aedff6..9f404c1b1 100644
--- a/Crypto.hs
+++ b/Crypto.hs
@@ -9,6 +9,8 @@
-}
module Crypto (
+ Cipher,
+ EncryptedCipher,
genCipher,
updateCipher,
storeCipher,
@@ -133,7 +135,10 @@ gpgRead params = pOpen ReadFromPipe "gpg" (gpgParams params) hGetContentsStrict
gpgPipeStrict :: [CommandParam] -> String -> IO String
gpgPipeStrict params input = do
- (_, output) <- pipeBoth "gpg" (gpgParams params) input
+ (pid, fromh, toh) <- hPipeBoth "gpg" (gpgParams params)
+ _ <- forkIO $ finally (hPutStr toh input) (hClose toh)
+ output <- hGetContentsStrict fromh
+ forceSuccess pid
return output
gpgPipeBytes :: [CommandParam] -> L.ByteString -> IO (PipeHandle, L.ByteString)