summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Crypto/Tox.hs2
-rw-r--r--src/Network/Tox.hs4
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.
92newtype Encrypted a = Encrypted ByteString 92newtype Encrypted a = Encrypted ByteString
93 deriving (Eq,Ord,Data) 93 deriving (Eq,Ord,Data,ByteArrayAccess)
94 94
95newtype Encrypted8 a = E8 (Encrypted (a,Nonce8)) 95newtype 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
89import Data.Word64Map (fitsInInt) 89import Data.Word64Map (fitsInInt)
90import qualified Data.Word64Map (empty) 90import qualified Data.Word64Map (empty)
91import Network.Tox.Crypto.Transport (NetCrypto) 91import Network.Tox.Crypto.Transport (NetCrypto)
92import Network.Tox.Crypto.Handlers (newSessionsState, cryptoNetHandler)
92import qualified Network.Tox.DHT.Handlers as DHT 93import qualified Network.Tox.DHT.Handlers as DHT
93import qualified Network.Tox.DHT.Transport as DHT 94import qualified Network.Tox.DHT.Transport as DHT
94import Network.Tox.NodeId 95import 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