diff options
Diffstat (limited to 'src/Network/Tox.hs')
-rw-r--r-- | src/Network/Tox.hs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index 66a19097..c3e559d7 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -323,22 +323,13 @@ netCryptoWithBackoff millisecs tox myseckey theirpubkey = do | |||
323 | , hpTheirBaseNonce = Nothing | 323 | , hpTheirBaseNonce = Nothing |
324 | , hpTheirSessionKeyPublic = Nothing | 324 | , hpTheirSessionKeyPublic = Nothing |
325 | } | 325 | } |
326 | freshCryptoSession (toxCryptoSessions tox) saddr hp | 326 | newsession <- generateSecretKey |
327 | -- myhandshake <- do | 327 | timestamp <- getPOSIXTime |
328 | -- n24' <- atomically $ transportNewNonce crypto | 328 | -- (myhandshakeData,launchThreads) <- |
329 | -- dput XNetCrypto ("Handshake Nonce24: " <> show n24') | 329 | _ <- atomically $ freshCryptoSession (toxCryptoSessions tox) saddr newsession timestamp hp |
330 | -- newBaseNonce <- atomically $ transportNewNonce crypto | 330 | -- launchThreads |
331 | -- mbMyhandshakeData <- newHandShakeData crypto newBaseNonce hp saddr | 331 | -- forM myhandshake $ \response_handshake -> do |
332 | -- forM mbMyhandshakeData $ \hsdata -> do | 332 | -- sendHandshake sessions addr response_handshake |
333 | -- state <- lookupSharedSecret crypto myseckey theirpubkey n24' | ||
334 | -- return Handshake { handshakeCookie = cookie | ||
335 | -- , handshakeNonce = n24' | ||
336 | -- , handshakeData = encrypt state $ encodePlain hsdata | ||
337 | -- } | ||
338 | -- case myhandshake of | ||
339 | -- Nothing -> hPutStrLn stderr "netCrypto: failed to create HandshakeData." >> return [] | ||
340 | -- Just handshake -> do | ||
341 | -- sendMessage (toxCrypto tox) saddr (NetHandshake handshake) | ||
342 | let secnum :: Double | 333 | let secnum :: Double |
343 | secnum = fromIntegral millisecs / 1000000 | 334 | secnum = fromIntegral millisecs / 1000000 |
344 | delay = (millisecs * 5 `div` 4) | 335 | delay = (millisecs * 5 `div` 4) |