summaryrefslogtreecommitdiff
path: root/toxcore/LAN_discovery.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-12-19 02:47:42 +0000
committeriphydf <iphydf@users.noreply.github.com>2016-12-22 10:26:59 +0000
commitce29c8e7ec91d95167b2dea3aee9fd1ae1aac254 (patch)
treea288df55c44e8edf816e6abbde19a70faef73394 /toxcore/LAN_discovery.c
parent7122d2e862e028a730478d88cd61557fbed16ebf (diff)
Wrap all sodium/nacl functions in crypto_core.c.
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r--toxcore/LAN_discovery.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c
index 48e0e7bb..6778e932 100644
--- a/toxcore/LAN_discovery.c
+++ b/toxcore/LAN_discovery.c
@@ -329,7 +329,7 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack
329 return 1; 329 return 1;
330 } 330 }
331 331
332 if (length != crypto_box_PUBLICKEYBYTES + 1) { 332 if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) {
333 return 1; 333 return 1;
334 } 334 }
335 335
@@ -340,11 +340,11 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack
340 340
341int send_LANdiscovery(uint16_t port, DHT *dht) 341int send_LANdiscovery(uint16_t port, DHT *dht)
342{ 342{
343 uint8_t data[crypto_box_PUBLICKEYBYTES + 1]; 343 uint8_t data[CRYPTO_PUBLIC_KEY_SIZE + 1];
344 data[0] = NET_PACKET_LAN_DISCOVERY; 344 data[0] = NET_PACKET_LAN_DISCOVERY;
345 id_copy(data + 1, dht->self_public_key); 345 id_copy(data + 1, dht->self_public_key);
346 346
347 send_broadcasts(dht->net, port, data, 1 + crypto_box_PUBLICKEYBYTES); 347 send_broadcasts(dht->net, port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE);
348 348
349 int res = -1; 349 int res = -1;
350 IP_Port ip_port; 350 IP_Port ip_port;
@@ -355,7 +355,7 @@ int send_LANdiscovery(uint16_t port, DHT *dht)
355 ip_port.ip = broadcast_ip(AF_INET6, AF_INET6); 355 ip_port.ip = broadcast_ip(AF_INET6, AF_INET6);
356 356
357 if (ip_isset(&ip_port.ip)) { 357 if (ip_isset(&ip_port.ip)) {
358 if (sendpacket(dht->net, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES) > 0) { 358 if (sendpacket(dht->net, ip_port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE) > 0) {
359 res = 1; 359 res = 1;
360 } 360 }
361 } 361 }
@@ -365,7 +365,7 @@ int send_LANdiscovery(uint16_t port, DHT *dht)
365 ip_port.ip = broadcast_ip(dht->net->family, AF_INET); 365 ip_port.ip = broadcast_ip(dht->net->family, AF_INET);
366 366
367 if (ip_isset(&ip_port.ip)) { 367 if (ip_isset(&ip_port.ip)) {
368 if (sendpacket(dht->net, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES)) { 368 if (sendpacket(dht->net, ip_port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE)) {
369 res = 1; 369 res = 1;
370 } 370 }
371 } 371 }