summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-02 04:08:54 -0400
committerjoe <joe@jerkface.net>2018-06-02 04:08:54 -0400
commitbc8c61dd7933f1cacd91282c0476f7bc46795daf (patch)
treea1a70df0fecd312152bc7ad421457dc28cf7e18e /src/Network/Tox/Crypto
parent1a2e32e7ae1e6e2e9e02ae4fefeb3645e4fb6028 (diff)
Change Cookie -> Cookie Encrypted
Diffstat (limited to 'src/Network/Tox/Crypto')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs4
-rw-r--r--src/Network/Tox/Crypto/Transport.hs10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index f650a815..56fb4dcf 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -222,7 +222,7 @@ data NetCryptoSession = NCrypto
222 , ncTheirBaseNonce :: TVar (UponHandshake Nonce24) -- base nonce + packet number 222 , ncTheirBaseNonce :: TVar (UponHandshake Nonce24) -- base nonce + packet number
223 , ncMyPacketNonce :: TVar Nonce24 -- base nonce + packet number 223 , ncMyPacketNonce :: TVar Nonce24 -- base nonce + packet number
224 , ncHandShake :: TVar (UponHandshake (Handshake Encrypted)) 224 , ncHandShake :: TVar (UponHandshake (Handshake Encrypted))
225 , ncCookie :: TVar (UponCookie Cookie) -- ^ Cookie issued by remote peer 225 , ncCookie :: TVar (UponCookie (Cookie Encrypted)) -- ^ Cookie issued by remote peer
226 , ncTheirDHTKey :: UponDHTKey PublicKey 226 , ncTheirDHTKey :: UponDHTKey PublicKey
227 , ncTheirSessionPublic :: TVar (UponHandshake PublicKey) 227 , ncTheirSessionPublic :: TVar (UponHandshake PublicKey)
228 , ncSessionSecret :: SecretKey 228 , ncSessionSecret :: SecretKey
@@ -387,7 +387,7 @@ newSessionsState crypto unrechook hooks = do
387data HandshakeParams 387data HandshakeParams
388 = HParam 388 = HParam
389 { hpTheirBaseNonce :: Maybe Nonce24 -- ignore and generate your own 389 { hpTheirBaseNonce :: Maybe Nonce24 -- ignore and generate your own
390 , hpOtherCookie :: Cookie 390 , hpOtherCookie :: Cookie Encrypted
391 , hpTheirSessionKeyPublic :: Maybe PublicKey 391 , hpTheirSessionKeyPublic :: Maybe PublicKey
392 , hpMySecretKey :: SecretKey 392 , hpMySecretKey :: SecretKey
393 , hpCookieRemotePubkey :: PublicKey 393 , hpCookieRemotePubkey :: PublicKey
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index 0588da4b..e23d1865 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -99,7 +99,7 @@ data Handshake (f :: * -> *) = Handshake
99 -- response packet with a cookie in it. It may also be obtained in the 99 -- response packet with a cookie in it. It may also be obtained in the
100 -- handshake packet by a peer receiving a handshake packet (Other 100 -- handshake packet by a peer receiving a handshake packet (Other
101 -- Cookie). 101 -- Cookie).
102 handshakeCookie :: Cookie 102 handshakeCookie :: Cookie f
103 -- The nonce is a nonce used to encrypt the encrypted part of the handshake 103 -- The nonce is a nonce used to encrypt the encrypted part of the handshake
104 -- packet. 104 -- packet.
105 , handshakeNonce :: Nonce24 105 , handshakeNonce :: Nonce24
@@ -113,10 +113,10 @@ instance Serialize (Handshake Encrypted) where
113 put (Handshake cookie n24 dta) = put cookie >> put n24 >> put dta 113 put (Handshake cookie n24 dta) = put cookie >> put n24 >> put dta
114 114
115data HandshakeData = HandshakeData 115data HandshakeData = HandshakeData
116 { baseNonce :: Nonce24 116 { baseNonce :: Nonce24 -- ^ [24 bytes base nonce]
117 , sessionKey :: PublicKey 117 , sessionKey :: PublicKey -- ^ [session public key of the peer (32 bytes)]
118 , cookieHash :: Digest SHA512 118 , cookieHash :: Digest SHA512 -- ^ [sha512 hash of the entire Cookie sitting outside the encrypted part]
119 , otherCookie :: Cookie 119 , otherCookie :: Cookie Encrypted -- ^ [Other Cookie (used by the other to respond to the handshake packet)]
120 } 120 }
121 121
122instance Sized HandshakeData where 122instance Sized HandshakeData where