diff options
-rw-r--r-- | src/Crypto/Tox.hs | 2 | ||||
-rw-r--r-- | src/Network/Tox.hs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs index 9f7c5e16..a25f9f4f 100644 --- a/src/Crypto/Tox.hs +++ b/src/Crypto/Tox.hs | |||
@@ -90,7 +90,7 @@ import Data.Word64Map (fitsInInt) | |||
90 | 90 | ||
91 | -- | A 16-byte mac and an arbitrary-length encrypted stream. | 91 | -- | A 16-byte mac and an arbitrary-length encrypted stream. |
92 | newtype Encrypted a = Encrypted ByteString | 92 | newtype Encrypted a = Encrypted ByteString |
93 | deriving (Eq,Ord,Data) | 93 | deriving (Eq,Ord,Data,ByteArrayAccess) |
94 | 94 | ||
95 | newtype Encrypted8 a = E8 (Encrypted (a,Nonce8)) | 95 | newtype Encrypted8 a = E8 (Encrypted (a,Nonce8)) |
96 | deriving (Serialize, Show) | 96 | deriving (Serialize, Show) |
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index d5db6979..4cc762c4 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -89,6 +89,7 @@ import Crypto.Tox | |||
89 | import Data.Word64Map (fitsInInt) | 89 | import Data.Word64Map (fitsInInt) |
90 | import qualified Data.Word64Map (empty) | 90 | import qualified Data.Word64Map (empty) |
91 | import Network.Tox.Crypto.Transport (NetCrypto) | 91 | import Network.Tox.Crypto.Transport (NetCrypto) |
92 | import Network.Tox.Crypto.Handlers (newSessionsState, cryptoNetHandler) | ||
92 | import qualified Network.Tox.DHT.Handlers as DHT | 93 | import qualified Network.Tox.DHT.Handlers as DHT |
93 | import qualified Network.Tox.DHT.Transport as DHT | 94 | import qualified Network.Tox.DHT.Transport as DHT |
94 | import Network.Tox.NodeId | 95 | import Network.Tox.NodeId |
@@ -308,11 +309,12 @@ newTox keydb addr = do | |||
308 | (const id) | 309 | (const id) |
309 | 310 | ||
310 | roster <- newRoster | 311 | roster <- newRoster |
312 | sessionsState <- newSessionsState crypto | ||
311 | return Tox | 313 | return Tox |
312 | { toxDHT = dhtclient | 314 | { toxDHT = dhtclient |
313 | , toxOnion = onionclient | 315 | , toxOnion = onionclient |
314 | , toxToRoute = onInbound (updateRoster roster) dtacrypt | 316 | , toxToRoute = onInbound (updateRoster roster) dtacrypt |
315 | , toxCrypto = cryptonet | 317 | , toxCrypto = addHandler (error "printErrors stderr") (cryptoNetHandler sessionsState) cryptonet |
316 | , toxCryptoKeys = crypto | 318 | , toxCryptoKeys = crypto |
317 | , toxRouting = routing | 319 | , toxRouting = routing |
318 | , toxTokens = toks | 320 | , toxTokens = toks |