summaryrefslogtreecommitdiff
path: root/core/net_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/net_crypto.c')
-rw-r--r--core/net_crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/net_crypto.c b/core/net_crypto.c
index 376708ab..a05208ef 100644
--- a/core/net_crypto.c
+++ b/core/net_crypto.c
@@ -228,7 +228,7 @@ int create_request(uint8_t *packet, uint8_t *public_key, uint8_t *data, uint32_t
228 memcpy(temp + 1, data, length); 228 memcpy(temp + 1, data, length);
229 temp[0] = request_id; 229 temp[0] = request_id;
230 random_nonce(nonce); 230 random_nonce(nonce);
231 int len = encrypt_data(public_key, self_secret_key, nonce, temp, length, 231 int len = encrypt_data(public_key, self_secret_key, nonce, temp, length + 1,
232 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + packet); 232 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + packet);
233 if (len == -1) 233 if (len == -1)
234 return -1; 234 return -1;
@@ -287,7 +287,7 @@ static int cryptopacket_handle(IP_Port source, uint8_t * packet, uint32_t length
287 if (len == -1 || len == 0) 287 if (len == -1 || len == 0)
288 return 1; 288 return 1;
289 if (!cryptopackethandlers[number]) return 1; 289 if (!cryptopackethandlers[number]) return 1;
290 cryptopackethandlers[number](source, public_key, data, len - 1); 290 cryptopackethandlers[number](source, public_key, data, len);
291 291
292 } else { /* if request is not for us, try routing it. */ 292 } else { /* if request is not for us, try routing it. */
293 if(route_packet(packet + 1, packet, length) == length) 293 if(route_packet(packet + 1, packet, length) == length)