summaryrefslogtreecommitdiff
path: root/dht/src/Network/Tox
diff options
context:
space:
mode:
Diffstat (limited to 'dht/src/Network/Tox')
-rw-r--r--dht/src/Network/Tox/Session.hs12
-rw-r--r--dht/src/Network/Tox/TCP.hs2
2 files changed, 7 insertions, 7 deletions
diff --git a/dht/src/Network/Tox/Session.hs b/dht/src/Network/Tox/Session.hs
index 0d89afc4..ff86e502 100644
--- a/dht/src/Network/Tox/Session.hs
+++ b/dht/src/Network/Tox/Session.hs
@@ -49,7 +49,7 @@ data SessionParams = SessionParams
49 , spGetSentHandshake :: SecretKey -> Multi.SessionAddress 49 , spGetSentHandshake :: SecretKey -> Multi.SessionAddress
50 -> Cookie Identity 50 -> Cookie Identity
51 -> Cookie Encrypted 51 -> Cookie Encrypted
52 -> IO (Maybe (SessionKey, HandshakeData)) 52 -> IO (Maybe (Multi.SessionAddress, (SessionKey, HandshakeData)))
53 -- | This method is invoked on each new session and is responsible for 53 -- | This method is invoked on each new session and is responsible for
54 -- launching any threads necessary to keep the session alive. 54 -- launching any threads necessary to keep the session alive.
55 , spOnNewSession :: Session -> IO () 55 , spOnNewSession :: Session -> IO ()
@@ -116,18 +116,18 @@ plainHandshakeH :: SessionParams
116 -> SecretKey 116 -> SecretKey
117 -> Handshake Identity 117 -> Handshake Identity
118 -> IO () 118 -> IO ()
119plainHandshakeH sp saddr skey handshake = do 119plainHandshakeH sp saddr0 skey handshake = do
120 let hd = runIdentity $ handshakeData handshake 120 let hd = runIdentity $ handshakeData handshake
121 prelude = show saddr ++ " --> " 121 prelude = show saddr0 ++ " --> "
122 dput XNetCrypto $ unlines $ map (prelude ++) 122 dput XNetCrypto $ unlines $ map (prelude ++)
123 [ "handshake: auth=" ++ show (handshakeCookie handshake) 123 [ "handshake: auth=" ++ show (handshakeCookie handshake)
124 , " : issuing=" ++ show (otherCookie hd) 124 , " : issuing=" ++ show (otherCookie hd)
125 , " : baseNonce=" ++ show (baseNonce hd) 125 , " : baseNonce=" ++ show (baseNonce hd)
126 ] 126 ]
127 sent <- spGetSentHandshake sp skey saddr (handshakeCookie handshake) (otherCookie hd) 127 sent <- spGetSentHandshake sp skey saddr0 (handshakeCookie handshake) (otherCookie hd)
128 -- TODO: this is always returning sent = Nothing 128 -- TODO: this is always returning sent = Nothing
129 dput XNetCrypto $ " <-- (cached) handshake baseNonce " ++ show (fmap (baseNonce . snd) sent) 129 dput XNetCrypto $ " <-- (cached) handshake baseNonce " ++ show (fmap (baseNonce . snd . snd) sent)
130 forM_ sent $ \(hd_skey,hd_sent) -> do 130 forM_ sent $ \(saddr, (hd_skey,hd_sent)) -> do
131 sk <- SessionKeys (spCrypto sp) 131 sk <- SessionKeys (spCrypto sp)
132 hd_skey 132 hd_skey
133 (sessionKey hd) 133 (sessionKey hd)
diff --git a/dht/src/Network/Tox/TCP.hs b/dht/src/Network/Tox/TCP.hs
index f8ec430b..ebb15e3b 100644
--- a/dht/src/Network/Tox/TCP.hs
+++ b/dht/src/Network/Tox/TCP.hs
@@ -368,7 +368,7 @@ newClient :: TransportCrypto
368 , RelayCache 368 , RelayCache
369 , Transport String ViaRelay ByteString 369 , Transport String ViaRelay ByteString
370 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted) ) 370 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted) )
371 , Client String PacketNumber Nonce8 NodeInfo (Bool,RelayPacket)) 371 , RelayClient )
372newClient crypto store load lookupSender getRoute = do 372newClient crypto store load lookupSender getRoute = do
373 (tcpcache,net0) <- toxTCP crypto 373 (tcpcache,net0) <- toxTCP crypto
374 (relaynet,net1) <- partitionRelay net0 374 (relaynet,net1) <- partitionRelay net0