diff options
-rw-r--r-- | lib/GnuPGAgent.hs | 1 | ||||
-rw-r--r-- | lib/PacketTranscoder.hs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/GnuPGAgent.hs b/lib/GnuPGAgent.hs index 9e0bacf..06784dd 100644 --- a/lib/GnuPGAgent.hs +++ b/lib/GnuPGAgent.hs | |||
@@ -45,6 +45,7 @@ session :: IO (Maybe GnuPGAgent) | |||
45 | session = do | 45 | session = do |
46 | envhomedir Nothing gpgHomeSpec >>= \case | 46 | envhomedir Nothing gpgHomeSpec >>= \case |
47 | Just gpghome -> do | 47 | Just gpghome -> do |
48 | -- TODO: Launch gpg-agent if neccessary. | ||
48 | handleIO_ (hPutStrLn stderr "Failed to connect to gpg-agent." >> return Nothing) $ do | 49 | handleIO_ (hPutStrLn stderr "Failed to connect to gpg-agent." >> return Nothing) $ do |
49 | sock <- socket AF_UNIX Stream defaultProtocol | 50 | sock <- socket AF_UNIX Stream defaultProtocol |
50 | connect sock (SockAddrUnix (gpghome ++ "/S.gpg-agent")) | 51 | connect sock (SockAddrUnix (gpghome ++ "/S.gpg-agent")) |
diff --git a/lib/PacketTranscoder.hs b/lib/PacketTranscoder.hs index eaa8366..e276528 100644 --- a/lib/PacketTranscoder.hs +++ b/lib/PacketTranscoder.hs | |||
@@ -130,7 +130,7 @@ interpretPassSpec ctx keys PassphraseAgent = do | |||
130 | let cacheSearch alg mp = | 130 | let cacheSearch alg mp = |
131 | case getQueries keys mp of | 131 | case getQueries keys mp of |
132 | [] -> [] | 132 | [] -> [] |
133 | kqry:qs -> trace ("queries="++show (kqry:qs)) $ | 133 | kqry:qs -> -- trace ("queries="++show (kqry:qs)) $ |
134 | map (sendQuery agent (AskNot,NextPassphrase)) (kqry:qs) | 134 | map (sendQuery agent (AskNot,NextPassphrase)) (kqry:qs) |
135 | ++ sendQuery agent (initial_ask,CanceledPassphrase) kqry | 135 | ++ sendQuery agent (initial_ask,CanceledPassphrase) kqry |
136 | : replicate 3 (sendQuery agent (AskAgain "Bad passphrase",CanceledPassphrase) kqry) | 136 | : replicate 3 (sendQuery agent (AskAgain "Bad passphrase",CanceledPassphrase) kqry) |
@@ -147,7 +147,7 @@ sendQuery agent (ask,failure) qry = do | |||
147 | mbpw <- getPassphrase agent ask (packet qry) | 147 | mbpw <- getPassphrase agent ask (packet qry) |
148 | case mbpw of | 148 | case mbpw of |
149 | Nothing -> do | 149 | Nothing -> do |
150 | S8.hPutStr stderr $ S8.pack $ "Failed to get passphrase "++show failure | 150 | S8.hPutStrLn stderr $ S8.pack $ "Failed to get passphrase "++show failure |
151 | return failure | 151 | return failure |
152 | Just pw -> do | 152 | Just pw -> do |
153 | -- S8.hPutStrLn stderr $ S8.pack $ "received pw: "++pw | 153 | -- S8.hPutStrLn stderr $ S8.pack $ "received pw: "++pw |