summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto/Handlers.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2018-05-29 06:12:52 +0000
committerJames Crayne <jim.crayne@gmail.com>2018-05-29 06:12:52 +0000
commitbef702cf30f1386a5ad11abaee6f37f6e496138f (patch)
tree1dfe9f5bdf2ea39465ef1d23bc01c3f1b8cf8560 /src/Network/Tox/Crypto/Handlers.hs
parent99bba3ebda84c691d3065715b416ed0916507992 (diff)
show the contents of userKeys upon handshake
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index 41ab8d41..d192e42e 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -544,6 +544,8 @@ cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) non
544 anyRight [] f = return $ Left "missing key" 544 anyRight [] f = return $ Left "missing key"
545 anyRight (x:xs) f = f x >>= either (const $ anyRight xs f) (return . Right) 545 anyRight (x:xs) f = f x >>= either (const $ anyRight xs f) (return . Right)
546 seckeys <- map fst <$> atomically (userKeys crypto) 546 seckeys <- map fst <$> atomically (userKeys crypto)
547 dput XNetCrypto "trying the following keys:"
548 forM_ seckeys $ \k -> dput XNetCrypto $ " " ++ show (key2id . toPublic $ k)
547 symkey <- atomically $ transportSymmetric crypto 549 symkey <- atomically $ transportSymmetric crypto
548 now <- getPOSIXTime 550 now <- getPOSIXTime
549 dput XNetCrypto ("Decrypt cookie with n24=" ++ show n24 ++ "\n symkey= " ++ show symkey) 551 dput XNetCrypto ("Decrypt cookie with n24=" ++ show n24 ++ "\n symkey= " ++ show symkey)