diff options
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r-- | toxcore/onion_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 97ef3b84..a85a07a2 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -50,7 +50,7 @@ static int new_sendback(Onion_Client *onion_c, uint32_t num, uint8_t *public_key | |||
50 | { | 50 | { |
51 | uint8_t plain[sizeof(uint32_t) + sizeof(uint64_t) + crypto_box_PUBLICKEYBYTES + sizeof(IP_Port)]; | 51 | uint8_t plain[sizeof(uint32_t) + sizeof(uint64_t) + crypto_box_PUBLICKEYBYTES + sizeof(IP_Port)]; |
52 | uint64_t time = unix_time(); | 52 | uint64_t time = unix_time(); |
53 | new_nonce(sendback); | 53 | random_nonce(sendback); |
54 | memcpy(plain, &num, sizeof(uint32_t)); | 54 | memcpy(plain, &num, sizeof(uint32_t)); |
55 | memcpy(plain + sizeof(uint32_t), &time, sizeof(uint64_t)); | 55 | memcpy(plain + sizeof(uint32_t), &time, sizeof(uint64_t)); |
56 | memcpy(plain + sizeof(uint32_t) + sizeof(uint64_t), public_key, crypto_box_PUBLICKEYBYTES); | 56 | memcpy(plain + sizeof(uint32_t) + sizeof(uint64_t), public_key, crypto_box_PUBLICKEYBYTES); |
@@ -420,7 +420,7 @@ int send_onion_data(Onion_Client *onion_c, int friend_num, uint8_t *data, uint32 | |||
420 | return -1; | 420 | return -1; |
421 | 421 | ||
422 | uint8_t nonce[crypto_box_NONCEBYTES]; | 422 | uint8_t nonce[crypto_box_NONCEBYTES]; |
423 | new_nonce(nonce); | 423 | random_nonce(nonce); |
424 | 424 | ||
425 | uint8_t packet[DATA_IN_RESPONSE_MIN_SIZE + length]; | 425 | uint8_t packet[DATA_IN_RESPONSE_MIN_SIZE + length]; |
426 | memcpy(packet, onion_c->dht->c->self_public_key, crypto_box_PUBLICKEYBYTES); | 426 | memcpy(packet, onion_c->dht->c->self_public_key, crypto_box_PUBLICKEYBYTES); |