summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-12-19 15:27:46 +0000
committeriphydf <iphydf@users.noreply.github.com>2016-12-22 10:26:59 +0000
commit2328cb74abccd563f0cd8d14d30e5314822d321e (patch)
treeb61581536d448a8846dc333b44c9b56e24605a1f /toxcore/DHT.c
parentce29c8e7ec91d95167b2dea3aee9fd1ae1aac254 (diff)
Improve documentation of crypto_core.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index e31405fd..23faf57b 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -197,7 +197,7 @@ int create_request(const uint8_t *send_public_key, const uint8_t *send_secret_ke
197 197
198 uint8_t *nonce = packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2; 198 uint8_t *nonce = packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2;
199 random_nonce(nonce); 199 random_nonce(nonce);
200 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function 200 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): crypto_memzero before exit function
201 memcpy(temp + 1, data, length); 201 memcpy(temp + 1, data, length);
202 temp[0] = request_id; 202 temp[0] = request_id;
203 int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1, 203 int len = encrypt_data(recv_public_key, send_secret_key, nonce, temp, length + 1,
@@ -238,7 +238,7 @@ int handle_request(const uint8_t *self_public_key, const uint8_t *self_secret_ke
238 238
239 memcpy(public_key, packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_PUBLIC_KEY_SIZE); 239 memcpy(public_key, packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_PUBLIC_KEY_SIZE);
240 const uint8_t *nonce = packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2; 240 const uint8_t *nonce = packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2;
241 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): sodium_memzero before exit function 241 uint8_t temp[MAX_CRYPTO_REQUEST_SIZE]; // TODO(irungentoo): crypto_memzero before exit function
242 int len1 = decrypt_data(public_key, self_secret_key, nonce, 242 int len1 = decrypt_data(public_key, self_secret_key, nonce,
243 packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE, 243 packet + 1 + CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE,
244 length - (CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE + 1), temp); 244 length - (CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE + 1), temp);