summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-09-01 22:22:56 -0400
committerjoe <joe@jerkface.net>2016-09-01 22:22:56 -0400
commit9c5f1d6577e35d3d134a7ad32d4d4611f05342cd (patch)
treef676410ce4b76f9d92a198eee6cece02bd3009c3
parente15e036f89a2c48b762f901e063d86417345287b (diff)
Cleanup output some.
-rw-r--r--lib/GnuPGAgent.hs1
-rw-r--r--lib/PacketTranscoder.hs4
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)
45session = do 45session = 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