diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-11-06 15:14:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-11-09 22:30:49 +0000 |
commit | aed24408db9cd8afe632a1d3f056669ae34f49be (patch) | |
tree | 77cb037490b3f97af949eb39dfdf2e1e513b61d1 /toxcore/TCP_client.c | |
parent | 42dfdf73c1dfd899a4f5a44ea1584aaf3a4ed3d2 (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_client.c')
-rw-r--r-- | toxcore/TCP_client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index caa1b73d..372f034e 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -228,7 +228,7 @@ static int generate_handshake(TCP_Client_Connection *TCP_conn) | |||
228 | random_nonce(TCP_conn->sent_nonce); | 228 | random_nonce(TCP_conn->sent_nonce); |
229 | memcpy(plain + crypto_box_PUBLICKEYBYTES, TCP_conn->sent_nonce, crypto_box_NONCEBYTES); | 229 | memcpy(plain + crypto_box_PUBLICKEYBYTES, TCP_conn->sent_nonce, crypto_box_NONCEBYTES); |
230 | memcpy(TCP_conn->last_packet, TCP_conn->self_public_key, crypto_box_PUBLICKEYBYTES); | 230 | memcpy(TCP_conn->last_packet, TCP_conn->self_public_key, crypto_box_PUBLICKEYBYTES); |
231 | new_nonce(TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES); | 231 | random_nonce(TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES); |
232 | int len = encrypt_data_symmetric(TCP_conn->shared_key, TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES, plain, | 232 | int len = encrypt_data_symmetric(TCP_conn->shared_key, TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES, plain, |
233 | sizeof(plain), TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); | 233 | sizeof(plain), TCP_conn->last_packet + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); |
234 | 234 | ||