summaryrefslogtreecommitdiff
path: root/lib/GnuPGAgent.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/GnuPGAgent.hs')
-rw-r--r--lib/GnuPGAgent.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/GnuPGAgent.hs b/lib/GnuPGAgent.hs
index 067e3bc..9e0bacf 100644
--- a/lib/GnuPGAgent.hs
+++ b/lib/GnuPGAgent.hs
@@ -3,6 +3,7 @@
3{-# LANGUAGE PatternGuards #-} 3{-# LANGUAGE PatternGuards #-}
4module GnuPGAgent 4module GnuPGAgent
5 ( session 5 ( session
6 , GnuPGAgent
6 , Query(..) 7 , Query(..)
7 , QueryMode(..) 8 , QueryMode(..)
8 , getPassphrase 9 , getPassphrase
@@ -99,7 +100,8 @@ getPassphrase agent ask (Query key uid masterkey) = do
99 r0 <- hGetLine (agentHandle agent) 100 r0 <- hGetLine (agentHandle agent)
100 -- hPutStrLn stderr $ "agent says: " ++ r0 101 -- hPutStrLn stderr $ "agent says: " ++ r0
101 case takeWhile (/=' ') r0 of 102 case takeWhile (/=' ') r0 of
102 "OK" -> hGetLine (agentHandle agent) >>= unhex . drop 3 103 "OK" | not (null $ drop 3 r0) -> return r0 >>= unhex . drop 3 -- . (\x -> trace (show x) x)
104 | otherwise -> hGetLine (agentHandle agent) >>= unhex . drop 3 -- . (\x -> trace (show x) x)
103 where 105 where
104#if defined(VERSION_memory) 106#if defined(VERSION_memory)
105 unhex hx = case convertFromBase Base16 (S8.pack hx) of 107 unhex hx = case convertFromBase Base16 (S8.pack hx) of