diff options
Diffstat (limited to 'toxcore/onion_announce.c')
-rw-r--r-- | toxcore/onion_announce.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 480475be..92c9e940 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c | |||
@@ -78,16 +78,17 @@ int send_announce_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uin | |||
78 | * send the packet to that person in the form of a response) | 78 | * send the packet to that person in the form of a response) |
79 | * | 79 | * |
80 | * public_key is the real public key of the node which we want to send the data of length length to. | 80 | * public_key is the real public key of the node which we want to send the data of length length to. |
81 | * nonce is the nonce to encrypt this packet with | ||
81 | * | 82 | * |
82 | * return -1 on failure. | 83 | * return -1 on failure. |
83 | * return 0 on success. | 84 | * return 0 on success. |
84 | */ | 85 | */ |
85 | int send_data_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uint8_t *data, uint16_t length) | 86 | int send_data_request(DHT *dht, Node_format *nodes, uint8_t *public_key, uint8_t *nonce, uint8_t *data, uint16_t length) |
86 | { | 87 | { |
87 | uint8_t packet[DATA_REQUEST_MIN_SIZE + length]; | 88 | uint8_t packet[DATA_REQUEST_MIN_SIZE + length]; |
88 | packet[0] = NET_PACKET_ONION_DATA_REQUEST; | 89 | packet[0] = NET_PACKET_ONION_DATA_REQUEST; |
89 | memcpy(packet + 1, public_key, crypto_box_PUBLICKEYBYTES); | 90 | memcpy(packet + 1, public_key, crypto_box_PUBLICKEYBYTES); |
90 | new_nonce(packet + 1 + crypto_box_PUBLICKEYBYTES); | 91 | memcpy(packet + 1 + crypto_box_PUBLICKEYBYTES, nonce, crypto_box_NONCEBYTES); |
91 | 92 | ||
92 | uint8_t random_public_key[crypto_box_PUBLICKEYBYTES]; | 93 | uint8_t random_public_key[crypto_box_PUBLICKEYBYTES]; |
93 | uint8_t random_secret_key[crypto_box_SECRETKEYBYTES]; | 94 | uint8_t random_secret_key[crypto_box_SECRETKEYBYTES]; |