summaryrefslogtreecommitdiff
path: root/src
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 /src
parent2625c8b7a66c0245d1eacbe0076f04df6ae8acd8 (diff)
Updated error messages referring to non-extant functions.
Diffstat (limited to 'src')
-rw-r--r--src/Crypto/Tox.hs4
-rw-r--r--src/Network/Tox.hs4
2 files changed, 4 insertions, 4 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)