diff options
Diffstat (limited to 'core/net_crypto.c')
-rw-r--r-- | core/net_crypto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/net_crypto.c b/core/net_crypto.c index e3757ffb..f421c37d 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -229,7 +229,7 @@ int create_request(uint8_t *send_public_key, uint8_t *send_secret_key, uint8_t * | |||
229 | if (len == -1) | 229 | if (len == -1) |
230 | return -1; | 230 | return -1; |
231 | 231 | ||
232 | packet[0] = 32; | 232 | packet[0] = NET_PACKET_CRYPTO; |
233 | memcpy(packet + 1, recv_public_key, crypto_box_PUBLICKEYBYTES); | 233 | memcpy(packet + 1, recv_public_key, crypto_box_PUBLICKEYBYTES); |
234 | memcpy(packet + 1 + crypto_box_PUBLICKEYBYTES, send_public_key, crypto_box_PUBLICKEYBYTES); | 234 | memcpy(packet + 1 + crypto_box_PUBLICKEYBYTES, send_public_key, crypto_box_PUBLICKEYBYTES); |
235 | memcpy(packet + 1 + crypto_box_PUBLICKEYBYTES * 2, nonce, crypto_box_NONCEBYTES); | 235 | memcpy(packet + 1 + crypto_box_PUBLICKEYBYTES * 2, nonce, crypto_box_NONCEBYTES); |
@@ -277,7 +277,7 @@ static int cryptopacket_handle(void *object, IP_Port source, uint8_t *packet, ui | |||
277 | { | 277 | { |
278 | DHT *dht = object; | 278 | DHT *dht = object; |
279 | 279 | ||
280 | if (packet[0] == 32) { | 280 | if (packet[0] == NET_PACKET_CRYPTO) { |
281 | if (length <= crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1 + ENCRYPTION_PADDING || | 281 | if (length <= crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1 + ENCRYPTION_PADDING || |
282 | length > MAX_DATA_SIZE + ENCRYPTION_PADDING) | 282 | length > MAX_DATA_SIZE + ENCRYPTION_PADDING) |
283 | return 1; | 283 | return 1; |
@@ -730,7 +730,7 @@ Net_Crypto *new_net_crypto(Networking_Core *net) | |||
730 | void init_cryptopackets(void *dht) | 730 | void init_cryptopackets(void *dht) |
731 | { | 731 | { |
732 | DHT *s_dht = dht; | 732 | DHT *s_dht = dht; |
733 | networking_registerhandler(s_dht->c->lossless_udp->net, 32, &cryptopacket_handle, s_dht); | 733 | networking_registerhandler(s_dht->c->lossless_udp->net, NET_PACKET_CRYPTO, &cryptopacket_handle, s_dht); |
734 | } | 734 | } |
735 | 735 | ||
736 | static void kill_timedout(Net_Crypto *c) | 736 | static void kill_timedout(Net_Crypto *c) |