diff options
Diffstat (limited to 'dht/src/Network/Tox/Session.hs')
-rw-r--r-- | dht/src/Network/Tox/Session.hs | 12 |
1 files changed, 6 insertions, 6 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 () |
119 | plainHandshakeH sp saddr skey handshake = do | 119 | plainHandshakeH 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) |