summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Crypto/Tox.hs4
-rw-r--r--src/Network/Tox.hs4
-rw-r--r--todo.txt4
3 files changed, 4 insertions, 8 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs
index 71aa99c4..0a7f07c3 100644
--- a/src/Crypto/Tox.hs
+++ b/src/Crypto/Tox.hs
@@ -218,7 +218,7 @@ decryptSymmetric (SymmetricKey symmkey) (Nonce24 n24) (Encrypted bs) = do
218 let (ds, symm') = Symmetric.decrypt bs'' symm 218 let (ds, symm') = Symmetric.decrypt bs'' symm
219 auth = Symmetric.finalize symm' 219 auth = Symmetric.finalize symm'
220 if BA.convert auth /= mac 220 if BA.convert auth /= mac
221 then Left "symmetricDecipher: Auth fail." 221 then Left "Symmetric decryption failed. Incorrect key material?"
222 else return $ Plain ds 222 else return $ Plain ds
223 223
224encryptSymmetric :: SymmetricKey -> Nonce24 -> Plain s x -> Encrypted x 224encryptSymmetric :: SymmetricKey -> Nonce24 -> Plain s x -> Encrypted x
@@ -237,7 +237,7 @@ data State = State Poly1305.State XSalsa.State
237decrypt :: State -> Encrypted a -> Either String (Plain s a) 237decrypt :: State -> Encrypted a -> Either String (Plain s a)
238decrypt (State hash crypt) ciphertext 238decrypt (State hash crypt) ciphertext
239 | (a == mac) = Right (Plain m) 239 | (a == mac) = Right (Plain m)
240 | otherwise = Left "decipherAndAuth: auth fail" 240 | otherwise = Left "Asymmetric decryption failed. Incorrect key material?"
241 where 241 where
242 (mac, c) = authAndBytes ciphertext 242 (mac, c) = authAndBytes ciphertext
243 m = fst . XSalsa.combine crypt $ c 243 m = fst . XSalsa.combine crypt $ c
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs
index 5bd23da8..634b0db1 100644
--- a/src/Network/Tox.hs
+++ b/src/Network/Tox.hs
@@ -490,13 +490,13 @@ forkTox tox = do
490 , bootstrap (DHT.refresher6 $ toxRouting tox) 490 , bootstrap (DHT.refresher6 $ toxRouting tox)
491 ) 491 )
492 492
493-- TODO: Don't export this. 493-- TODO: Don't export this. The exported interface is 'toxAnnounceToLan'.
494announceToLan :: Socket -> NodeId -> IO () 494announceToLan :: Socket -> NodeId -> IO ()
495announceToLan sock nid = do 495announceToLan sock nid = do
496 addrs <- broadcastAddrs 496 addrs <- broadcastAddrs
497 forM_ addrs $ \addr -> do 497 forM_ addrs $ \addr -> do
498 (broadcast_info:_) <- getAddrInfo (Just defaultHints { addrFlags = [AI_NUMERICHOST], addrSocketType = Datagram }) 498 (broadcast_info:_) <- getAddrInfo (Just defaultHints { addrFlags = [AI_NUMERICHOST], addrSocketType = Datagram })
499 (Just addr) -- TODO: Detect broadcast address. 499 (Just addr)
500 (Just "33445") 500 (Just "33445")
501 let broadcast = addrAddress broadcast_info 501 let broadcast = addrAddress broadcast_info
502 bs = S.runPut $ DHT.putMessage (DHT.DHTLanDiscovery nid) 502 bs = S.runPut $ DHT.putMessage (DHT.DHTLanDiscovery nid)
diff --git a/todo.txt b/todo.txt
index 645197d5..5483efbb 100644
--- a/todo.txt
+++ b/todo.txt
@@ -9,10 +9,6 @@ ui: better error message for a +dhtkey without any selected key.
9 9
10tox: tcp relay 10tox: tcp relay
11 11
12bug: local IPv6 addresses are occurring in the IPv4 tox routing table.
13
14xmpp: xmpp-added roster keys are not in TransportCrypto and unusable from TOx.Crypto.Handlers.
15
16xmpp: handle tox-friends in roster. 12xmpp: handle tox-friends in roster.
17 13
18tox: Add fallback trials to cookie response in case response is from another address than request. 14tox: Add fallback trials to cookie response in case response is from another address than request.