summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Network/Tox/Crypto/Transport.hs4
-rw-r--r--src/Network/Tox/DHT/Transport.hs1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index 141ef792..1444ffca 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -81,8 +81,8 @@ data NetCrypto
81 | NetCrypto (CryptoPacket Encrypted) 81 | NetCrypto (CryptoPacket Encrypted)
82 82
83parseNetCrypto :: ByteString -> SockAddr -> Either String (NetCrypto, SockAddr) 83parseNetCrypto :: ByteString -> SockAddr -> Either String (NetCrypto, SockAddr)
84parseNetCrypto pkt@(B.uncons -> Just (0x1a,_)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetHandshake <$> runGet get pkt 84parseNetCrypto (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetHandshake <$> runGet get pkt
85parseNetCrypto pkt@(B.uncons -> Just (0x1b,_)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetCrypto <$> runGet get pkt 85parseNetCrypto (B.uncons -> Just (0x1b,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetCrypto <$> runGet get pkt
86parseNetCrypto _ _ = Left "parseNetCrypto: ?" 86parseNetCrypto _ _ = Left "parseNetCrypto: ?"
87 87
88encodeNetCrypto :: NetCrypto -> SockAddr -> (ByteString, SockAddr) 88encodeNetCrypto :: NetCrypto -> SockAddr -> (ByteString, SockAddr)
diff --git a/src/Network/Tox/DHT/Transport.hs b/src/Network/Tox/DHT/Transport.hs
index f7feea3b..59b22673 100644
--- a/src/Network/Tox/DHT/Transport.hs
+++ b/src/Network/Tox/DHT/Transport.hs
@@ -371,6 +371,7 @@ data CookieData = CookieData -- 16 (mac)
371 , longTermKey :: PublicKey -- 32 371 , longTermKey :: PublicKey -- 32
372 , dhtKey :: PublicKey -- + 32 372 , dhtKey :: PublicKey -- + 32
373 } -- = 88 bytes when encrypted. 373 } -- = 88 bytes when encrypted.
374 deriving Show
374 375
375instance Sized CookieData where 376instance Sized CookieData where
376 size = ConstSize 72 377 size = ConstSize 72