summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Crypto/Tox.hs3
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs1
-rw-r--r--src/Network/Tox/DHT/Handlers.hs1
3 files changed, 5 insertions, 0 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs
index 9b7e82c0..acb98e3e 100644
--- a/src/Crypto/Tox.hs
+++ b/src/Crypto/Tox.hs
@@ -515,6 +515,9 @@ newSecretsCache = atomically (SecretsCache <$> newTVar MM.empty)
515 515
516newtype SymmetricKey = SymmetricKey ByteString 516newtype SymmetricKey = SymmetricKey ByteString
517 517
518instance Show SymmetricKey where
519 show (SymmetricKey bs) = bin2base64 bs
520
518data TransportCrypto = TransportCrypto 521data TransportCrypto = TransportCrypto
519 { transportSecret :: SecretKey 522 { transportSecret :: SecretKey
520 , transportPublic :: PublicKey 523 , transportPublic :: PublicKey
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index 2902685c..5a52450b 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -545,6 +545,7 @@ cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) non
545 seckeys <- map fst <$> atomically (readTVar (userKeys crypto)) 545 seckeys <- map fst <$> atomically (readTVar (userKeys crypto))
546 symkey <- atomically $ transportSymmetric crypto 546 symkey <- atomically $ transportSymmetric crypto
547 now <- getPOSIXTime 547 now <- getPOSIXTime
548 hPutStrLn stderr ("Decrypt cookie with n24=" ++ show n24 ++ "\n symkey= " ++ show symkey)
548 lr <- fmap join . sequence $ do -- Either Monad 549 lr <- fmap join . sequence $ do -- Either Monad
549 -- TODO: XXX: FIXME: 550 -- TODO: XXX: FIXME:
550 -- The following call to decryptSymmetric is failing every time, 551 -- The following call to decryptSymmetric is failing every time,
diff --git a/src/Network/Tox/DHT/Handlers.hs b/src/Network/Tox/DHT/Handlers.hs
index 327659a9..42937b89 100644
--- a/src/Network/Tox/DHT/Handlers.hs
+++ b/src/Network/Tox/DHT/Handlers.hs
@@ -231,6 +231,7 @@ createCookie crypto ni remoteUserKey = do
231 , dhtKey = transportPublic crypto 231 , dhtKey = transportPublic crypto
232 } 232 }
233 edta = encryptSymmetric sym n24 dta 233 edta = encryptSymmetric sym n24 dta
234 hPutStrLn stderr $ "Created cookie with n24 = 0x" ++ show n24 ++ "\n sym=" ++ show sym
234 return $ Cookie n24 edta 235 return $ Cookie n24 edta
235 236
236cookieRequestH :: TransportCrypto -> NodeInfo -> CookieRequest -> IO Cookie 237cookieRequestH :: TransportCrypto -> NodeInfo -> CookieRequest -> IO Cookie