summaryrefslogtreecommitdiff
path: root/toxcore/crypto_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/crypto_core.c')
-rw-r--r--toxcore/crypto_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/crypto_core.c b/toxcore/crypto_core.c
index bcfd7e60..8f7572ab 100644
--- a/toxcore/crypto_core.c
+++ b/toxcore/crypto_core.c
@@ -157,7 +157,7 @@ int decrypt_data(const uint8_t *public_key, const uint8_t *secret_key, const uin
157/* Increment the given nonce by 1. */ 157/* Increment the given nonce by 1. */
158void increment_nonce(uint8_t *nonce) 158void increment_nonce(uint8_t *nonce)
159{ 159{
160 /* FIXME use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian) 160 /* TODO(irungentoo): use increment_nonce_number(nonce, 1) or sodium_increment (change to little endian)
161 * NOTE don't use breaks inside this loop 161 * NOTE don't use breaks inside this loop
162 * In particular, make sure, as far as possible, 162 * In particular, make sure, as far as possible,
163 * that loop bounds and their potential underflow or overflow 163 * that loop bounds and their potential underflow or overflow
@@ -240,7 +240,7 @@ int create_request(const uint8_t *send_public_key, const uint8_t *send_secret_ke
240 240
241 uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; 241 uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2;
242 new_nonce(nonce); 242 new_nonce(nonce);
243 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function 243 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function
244 memcpy(temp + 1, data, length); 244 memcpy(temp + 1, data, length);
245 temp[0] = request_id; 245 temp[0] = request_id;
246 int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1, 246 int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1,
@@ -281,7 +281,7 @@ int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_ke
281 281
282 memcpy(public_key, packet + 1 + crypto_box_PUBLICKEYBYTES, crypto_box_PUBLICKEYBYTES); 282 memcpy(public_key, packet + 1 + crypto_box_PUBLICKEYBYTES, crypto_box_PUBLICKEYBYTES);
283 const uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2; 283 const uint8_t *nonce = packet + 1 + crypto_box_PUBLICKEYBYTES * 2;
284 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // FIXME sodium_memzero before exit function 284 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function
285 int len1 = decrypt_data(public_key, self_secret_key, nonce, 285 int len1 = decrypt_data(public_key, self_secret_key, nonce,
286 packet + 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES, 286 packet + 1 + crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES,
287 length - (crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1), temp); 287 length - (crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + 1), temp);