summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-09 00:31:09 -0400
committerjoe <joe@jerkface.net>2018-06-09 00:31:09 -0400
commitcb6bf999a6a2fcafa5ebfa4a26a5154d04bbe8d7 (patch)
treeb433638b4d344e4e3907c45eae8138b425576513
parent2625c8b7a66c0245d1eacbe0076f04df6ae8acd8 (diff)
Updated error messages referring to non-extant functions.
-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.