summaryrefslogtreecommitdiff
path: root/src/Propellor/Gpg.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-14 21:49:05 -0400
committerJoey Hess2015-09-14 21:49:05 -0400
commit0d93f4f12c4c7d0a37dc2e6f792ce0f9dde793db (patch)
tree082fb29222fb901c9ef34baae7af9700340e79c0 /src/Propellor/Gpg.hs
parentfb7b1826870c8a0e01f88da74ff2fd98a0626d5b (diff)
Allow storing arbitrary ByteStrings in PrivData, extracted using privDataByteString.
Diffstat (limited to 'src/Propellor/Gpg.hs')
-rw-r--r--src/Propellor/Gpg.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index 86f84dc1..24743d40 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -14,6 +14,7 @@ import Utility.Process
import Utility.Monad
import Utility.Misc
import Utility.Tmp
+import Utility.FileSystemEncoding
type KeyId = String
@@ -112,8 +113,9 @@ gpgEncrypt f s = do
, "--encrypt"
, "--trust-model", "always"
] ++ concatMap (\k -> ["--recipient", k]) keyids
- encrypted <- writeReadProcessEnv "gpg" opts
- Nothing
- (Just $ flip hPutStr s)
- Nothing
+ encrypted <- writeReadProcessEnv "gpg" opts Nothing (Just writer) Nothing
viaTmp writeFile f encrypted
+ where
+ writer h = do
+ fileEncoding h
+ hPutStr h s