diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/Tox/Crypto/Transport.hs | 4 | ||||
-rw-r--r-- | src/Network/Tox/DHT/Transport.hs | 1 |
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 | ||
83 | parseNetCrypto :: ByteString -> SockAddr -> Either String (NetCrypto, SockAddr) | 83 | parseNetCrypto :: ByteString -> SockAddr -> Either String (NetCrypto, SockAddr) |
84 | parseNetCrypto pkt@(B.uncons -> Just (0x1a,_)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetHandshake <$> runGet get pkt | 84 | parseNetCrypto (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetHandshake <$> runGet get pkt |
85 | parseNetCrypto pkt@(B.uncons -> Just (0x1b,_)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetCrypto <$> runGet get pkt | 85 | parseNetCrypto (B.uncons -> Just (0x1b,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) . NetCrypto <$> runGet get pkt |
86 | parseNetCrypto _ _ = Left "parseNetCrypto: ?" | 86 | parseNetCrypto _ _ = Left "parseNetCrypto: ?" |
87 | 87 | ||
88 | encodeNetCrypto :: NetCrypto -> SockAddr -> (ByteString, SockAddr) | 88 | encodeNetCrypto :: 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 | ||
375 | instance Sized CookieData where | 376 | instance Sized CookieData where |
376 | size = ConstSize 72 | 377 | size = ConstSize 72 |