diff options
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 774dd6f2..0b866940 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -498,7 +498,7 @@ static int getnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cli | |||
498 | uint8_t plain[sizeof(ping_id) + CLIENT_ID_SIZE]; | 498 | uint8_t plain[sizeof(ping_id) + CLIENT_ID_SIZE]; |
499 | uint8_t encrypt[sizeof(ping_id) + CLIENT_ID_SIZE + ENCRYPTION_PADDING]; | 499 | uint8_t encrypt[sizeof(ping_id) + CLIENT_ID_SIZE + ENCRYPTION_PADDING]; |
500 | uint8_t nonce[crypto_box_NONCEBYTES]; | 500 | uint8_t nonce[crypto_box_NONCEBYTES]; |
501 | random_nonce(nonce); | 501 | new_nonce(nonce); |
502 | 502 | ||
503 | memcpy(plain, &ping_id, sizeof(ping_id)); | 503 | memcpy(plain, &ping_id, sizeof(ping_id)); |
504 | memcpy(plain + sizeof(ping_id), client_id, CLIENT_ID_SIZE); | 504 | memcpy(plain + sizeof(ping_id), client_id, CLIENT_ID_SIZE); |
@@ -540,7 +540,7 @@ static int sendnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cl | |||
540 | uint8_t plain[sizeof(ping_id) + sizeof(Node_format) * MAX_SENT_NODES]; | 540 | uint8_t plain[sizeof(ping_id) + sizeof(Node_format) * MAX_SENT_NODES]; |
541 | uint8_t encrypt[sizeof(ping_id) + sizeof(Node_format) * MAX_SENT_NODES + ENCRYPTION_PADDING]; | 541 | uint8_t encrypt[sizeof(ping_id) + sizeof(Node_format) * MAX_SENT_NODES + ENCRYPTION_PADDING]; |
542 | uint8_t nonce[crypto_box_NONCEBYTES]; | 542 | uint8_t nonce[crypto_box_NONCEBYTES]; |
543 | random_nonce(nonce); | 543 | new_nonce(nonce); |
544 | 544 | ||
545 | memcpy(plain, &ping_id, sizeof(ping_id)); | 545 | memcpy(plain, &ping_id, sizeof(ping_id)); |
546 | memcpy(plain + sizeof(ping_id), nodes_list, num_nodes * sizeof(Node_format)); | 546 | memcpy(plain + sizeof(ping_id), nodes_list, num_nodes * sizeof(Node_format)); |