diff options
author | Coren[m] <Break@Ocean> | 2013-09-13 18:43:04 +0200 |
---|---|---|
committer | Coren[m] <Break@Ocean> | 2013-09-13 18:43:04 +0200 |
commit | d2603cf169b1b2d860f2b851590f5ae2be01011c (patch) | |
tree | 7dace65882f2e367f6b32f8df2a94d1d3e75b46c /toxcore/DHT.c | |
parent | 87f5f9d4eb8dc41cb9173a7bdf01ab095a341fdb (diff) | |
parent | 339dcd60707ea7b46f5c450569d32f852a1c0be7 (diff) |
Merge remote-tracking branch 'upstream/master' into MessengerLoadSave
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)); |