summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto/Transport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox/Crypto/Transport.hs')
-rw-r--r--src/Network/Tox/Crypto/Transport.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index 555164f2..1c641584 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -170,12 +170,12 @@ instance Sized HandshakeData where
170 170
171instance Serialize HandshakeData where 171instance Serialize HandshakeData where
172 get = HandshakeData <$> get 172 get = HandshakeData <$> get
173 <*> (id2key <$> get) 173 <*> getPublicKey
174 <*> (fromJust . digestFromByteString <$> getBytes 64) 174 <*> (fromJust . digestFromByteString <$> getBytes 64)
175 <*> get 175 <*> get
176 put (HandshakeData n k h c) = do 176 put (HandshakeData n k h c) = do
177 put n 177 put n
178 put $ key2id k 178 putPublicKey k
179 putByteString (convert h) 179 putByteString (convert h)
180 put c 180 put c
181 181
@@ -724,15 +724,15 @@ instance HasPeerNumber PeerInfo where
724instance Serialize PeerInfo where 724instance Serialize PeerInfo where
725 get = do 725 get = do
726 w16 <- get 726 w16 <- get
727 ukey <- id2key <$> get 727 ukey <- getPublicKey
728 dkey <- id2key <$> get 728 dkey <- getPublicKey
729 w8 <- get :: Get Word8 729 w8 <- get :: Get Word8
730 PeerInfo w16 ukey dkey <$> getBytes (fromIntegral w8) 730 PeerInfo w16 ukey dkey <$> getBytes (fromIntegral w8)
731 731
732 put (PeerInfo w16 ukey dkey bs) = do 732 put (PeerInfo w16 ukey dkey bs) = do
733 put w16 733 put w16
734 put $ key2id ukey 734 putPublicKey ukey
735 put $ key2id dkey 735 putPublicKey dkey
736 let sz :: Word8 736 let sz :: Word8
737 sz = case B.length bs of 737 sz = case B.length bs of
738 n | n <= 255 -> fromIntegral n 738 n | n <= 255 -> fromIntegral n