diff options
author | joe <joe@jerkface.net> | 2017-07-11 14:07:46 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-07-11 14:07:46 -0400 |
commit | 883545312ff1e354302f8b4733d77b0abc8a4025 (patch) | |
tree | 74a03fdd4b89075d7d11e1a901413fb385a66748 /src/Network/DatagramServer | |
parent | 42c7e85689505fc719088c613f1dc4bc52752643 (diff) |
FIXME: Should be using qryNonce instead of msgNonce.
Diffstat (limited to 'src/Network/DatagramServer')
-rw-r--r-- | src/Network/DatagramServer/Tox.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/DatagramServer/Tox.hs b/src/Network/DatagramServer/Tox.hs index ead077bb..cf39e7e1 100644 --- a/src/Network/DatagramServer/Tox.hs +++ b/src/Network/DatagramServer/Tox.hs | |||
@@ -395,7 +395,7 @@ instance Envelope Message where | |||
395 | 395 | ||
396 | envelopePayload = msgPayload | 396 | envelopePayload = msgPayload |
397 | 397 | ||
398 | envelopeTransaction = msgNonce | 398 | envelopeTransaction = msgNonce -- FIXME: should be decrypted nonce |
399 | 399 | ||
400 | envelopeClass Message { msgType = Ping } = Query Ping | 400 | envelopeClass Message { msgType = Ping } = Query Ping |
401 | envelopeClass Message { msgType = Pong } = Response Nothing | 401 | envelopeClass Message { msgType = Pong } = Response Nothing |
@@ -414,6 +414,8 @@ instance Envelope Message where | |||
414 | , msgPayload = q | 414 | , msgPayload = q |
415 | } | 415 | } |
416 | 416 | ||
417 | -- FIXME: Should generate encrypted nonces. | ||
418 | -- Should be unpredictable. | ||
417 | uniqueTransactionId cnt = do | 419 | uniqueTransactionId cnt = do |
418 | return $ either (error "failed to create TransactionId") TID | 420 | return $ either (error "failed to create TransactionId") TID |
419 | $ S.decode $ Char8.pack (take 24 $ show cnt ++ repeat ' ') | 421 | $ S.decode $ Char8.pack (take 24 $ show cnt ++ repeat ' ') |