summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-11-06 15:14:02 +0000
committeriphydf <iphydf@users.noreply.github.com>2016-11-09 22:30:49 +0000
commitaed24408db9cd8afe632a1d3f056669ae34f49be (patch)
tree77cb037490b3f97af949eb39dfdf2e1e513b61d1 /toxcore/TCP_server.c
parent42dfdf73c1dfd899a4f5a44ea1584aaf3a4ed3d2 (diff)
Remove new_nonce function in favour of random_nonce.
`new_nonce` has been an alias for `random_nonce` for a while now. Having two names for the same operation is confusing. `random_nonce` better expresses the intent. The documentation for `new_nonce` talks about guaranteeing that the nonce is different from previous ones, which is incorrect, it's just quite likely to be different.
Diffstat (limited to 'toxcore/TCP_server.c')
-rw-r--r--toxcore/TCP_server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index 4b355a62..63c1577d 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -565,7 +565,7 @@ static int handle_TCP_handshake(TCP_Secure_Connection *con, const uint8_t *data,
565 memcpy(con->recv_nonce, plain + crypto_box_PUBLICKEYBYTES, crypto_box_NONCEBYTES); 565 memcpy(con->recv_nonce, plain + crypto_box_PUBLICKEYBYTES, crypto_box_NONCEBYTES);
566 566
567 uint8_t response[TCP_SERVER_HANDSHAKE_SIZE]; 567 uint8_t response[TCP_SERVER_HANDSHAKE_SIZE];
568 new_nonce(response); 568 random_nonce(response);
569 569
570 len = encrypt_data_symmetric(shared_key, response, resp_plain, TCP_HANDSHAKE_PLAIN_SIZE, 570 len = encrypt_data_symmetric(shared_key, response, resp_plain, TCP_HANDSHAKE_PLAIN_SIZE,
571 response + crypto_box_NONCEBYTES); 571 response + crypto_box_NONCEBYTES);