summaryrefslogtreecommitdiff
path: root/src/Network/Tox.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-10-28 17:05:42 -0400
committerjoe <joe@jerkface.net>2017-10-28 17:05:42 -0400
commite89145df011e7737c59a1ce4568432e2e9291871 (patch)
tree11c76e5d76ecca70393063d1a70cc25fba4097af /src/Network/Tox.hs
parent63f0543e28ac2e73adb4676c36a6fa0b9b7c9d35 (diff)
New "cookie" command for tox command-line interface.
Diffstat (limited to 'src/Network/Tox.hs')
-rw-r--r--src/Network/Tox.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs
index e9220fcb..d434360f 100644
--- a/src/Network/Tox.hs
+++ b/src/Network/Tox.hs
@@ -112,6 +112,7 @@ newCrypto = do
112 drg0 <- getSystemDRG 112 drg0 <- getSystemDRG
113 return $ randomBytesGenerate 32 drg0 :: IO (ByteString, SystemDRG) 113 return $ randomBytesGenerate 32 drg0 :: IO (ByteString, SystemDRG)
114 noncevar <- atomically $ newTVar $ fst $ withDRG drg drgNew 114 noncevar <- atomically $ newTVar $ fst $ withDRG drg drgNew
115 cookieKeys <- atomically $ newTVar []
115 hPutStrLn stderr $ "secret(tox) = " ++ DHT.showHex secret 116 hPutStrLn stderr $ "secret(tox) = " ++ DHT.showHex secret
116 hPutStrLn stderr $ "public(tox) = " ++ DHT.showHex pubkey 117 hPutStrLn stderr $ "public(tox) = " ++ DHT.showHex pubkey
117 hPutStrLn stderr $ "symmetric(tox) = " ++ DHT.showHex symkey 118 hPutStrLn stderr $ "symmetric(tox) = " ++ DHT.showHex symkey
@@ -129,6 +130,7 @@ newCrypto = do
129 writeTVar noncevar drg2 130 writeTVar noncevar drg2
130 return nonce 131 return nonce
131 , userKeys = ukeys 132 , userKeys = ukeys
133 , pendingCookies = cookieKeys
132 } 134 }
133 135
134updateIP :: TVar (R.BucketList NodeInfo) -> SockAddr -> STM () 136updateIP :: TVar (R.BucketList NodeInfo) -> SockAddr -> STM ()