diff options
author | irungentoo <irungentoo@gmail.com> | 2014-04-22 20:28:40 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-04-22 20:28:40 -0400 |
commit | 1bfe15ee88844bdbd43052b4026202cf924ad6ca (patch) | |
tree | a740f16199cf0a263447e2084dd8906028a7b268 /toxcore/onion_announce.c | |
parent | c46ab5821d0fa8c604de52e15009e2b8da5d9c07 (diff) |
Decided pretty much how the handshake would work.
Started writing the code.
Astyled some files.
Diffstat (limited to 'toxcore/onion_announce.c')
-rw-r--r-- | toxcore/onion_announce.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 28339ee6..5bab931a 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c | |||
@@ -222,8 +222,8 @@ static int handle_announce_request(void *object, IP_Port source, uint8_t *packet | |||
222 | 222 | ||
223 | uint8_t plain[ONION_PING_ID_SIZE + crypto_box_PUBLICKEYBYTES + crypto_box_PUBLICKEYBYTES + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH]; | 223 | uint8_t plain[ONION_PING_ID_SIZE + crypto_box_PUBLICKEYBYTES + crypto_box_PUBLICKEYBYTES + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH]; |
224 | int len = decrypt_data_symmetric(shared_key, packet + 1, packet + 1 + crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES, | 224 | int len = decrypt_data_symmetric(shared_key, packet + 1, packet + 1 + crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES, |
225 | ONION_PING_ID_SIZE + crypto_box_PUBLICKEYBYTES + crypto_box_PUBLICKEYBYTES + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + | 225 | ONION_PING_ID_SIZE + crypto_box_PUBLICKEYBYTES + crypto_box_PUBLICKEYBYTES + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + |
226 | crypto_box_MACBYTES, plain); | 226 | crypto_box_MACBYTES, plain); |
227 | 227 | ||
228 | if ((uint32_t)len != sizeof(plain)) | 228 | if ((uint32_t)len != sizeof(plain)) |
229 | return 1; | 229 | return 1; |
@@ -279,7 +279,7 @@ static int handle_announce_request(void *object, IP_Port source, uint8_t *packet | |||
279 | 279 | ||
280 | uint8_t data[ONION_ANNOUNCE_RESPONSE_MAX_SIZE]; | 280 | uint8_t data[ONION_ANNOUNCE_RESPONSE_MAX_SIZE]; |
281 | len = encrypt_data_symmetric(shared_key, nonce, pl, 1 + ONION_PING_ID_SIZE + nodes_length, | 281 | len = encrypt_data_symmetric(shared_key, nonce, pl, 1 + ONION_PING_ID_SIZE + nodes_length, |
282 | data + 1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + crypto_box_NONCEBYTES); | 282 | data + 1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + crypto_box_NONCEBYTES); |
283 | 283 | ||
284 | if (len != 1 + ONION_PING_ID_SIZE + nodes_length + crypto_box_MACBYTES) | 284 | if (len != 1 + ONION_PING_ID_SIZE + nodes_length + crypto_box_MACBYTES) |
285 | return 1; | 285 | return 1; |