summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-11-05 03:43:02 -0500
committerjoe <joe@jerkface.net>2017-11-05 03:43:02 -0500
commit0658b07e68eed370c790f74db7d67f1496134b43 (patch)
treea459db44ee971c115fe4953929ebf12cf54e2287 /src/Network
parent8039d812b7ea8ae566f8873452ac34597336ddfc (diff)
Tox: Shared secrets cache.
Diffstat (limited to 'src/Network')
-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 40d17a07..35eaebb5 100644
--- a/src/Network/Tox.hs
+++ b/src/Network/Tox.hs
@@ -114,6 +114,7 @@ newCrypto = do
114 return $ randomBytesGenerate 32 drg0 :: IO (ByteString, SystemDRG) 114 return $ randomBytesGenerate 32 drg0 :: IO (ByteString, SystemDRG)
115 noncevar <- atomically $ newTVar $ fst $ withDRG drg drgNew 115 noncevar <- atomically $ newTVar $ fst $ withDRG drg drgNew
116 cookieKeys <- atomically $ newTVar [] 116 cookieKeys <- atomically $ newTVar []
117 cache <- newSecretsCache
117 hPutStrLn stderr $ "secret(tox) = " ++ DHT.showHex secret 118 hPutStrLn stderr $ "secret(tox) = " ++ DHT.showHex secret
118 hPutStrLn stderr $ "public(tox) = " ++ DHT.showHex pubkey 119 hPutStrLn stderr $ "public(tox) = " ++ DHT.showHex pubkey
119 hPutStrLn stderr $ "symmetric(tox) = " ++ DHT.showHex symkey 120 hPutStrLn stderr $ "symmetric(tox) = " ++ DHT.showHex symkey
@@ -132,6 +133,7 @@ newCrypto = do
132 return nonce 133 return nonce
133 , userKeys = ukeys 134 , userKeys = ukeys
134 , pendingCookies = cookieKeys 135 , pendingCookies = cookieKeys
136 , secretsCache = cache
135 } 137 }
136 138
137updateIP :: TVar (R.BucketList NodeInfo) -> SockAddr -> STM () 139updateIP :: TVar (R.BucketList NodeInfo) -> SockAddr -> STM ()