diff options
-rw-r--r-- | docs/Prevent_Tracking.txt | 3 | ||||
-rw-r--r-- | docs/Tox_middle_level_network_protocol.txt | 16 | ||||
-rw-r--r-- | other/bootstrap_daemon/tox-bootstrapd.c | 2 | ||||
-rw-r--r-- | toxav/msi.c | 4 | ||||
-rw-r--r-- | toxav/toxav.c | 6 | ||||
-rw-r--r-- | toxav/toxav.h | 4 | ||||
-rw-r--r-- | toxcore/Messenger.c | 2 | ||||
-rw-r--r-- | toxcore/crypto_core.c | 2 | ||||
-rw-r--r-- | toxcore/crypto_core.h | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.c | 12 | ||||
-rw-r--r-- | toxcore/net_crypto.h | 4 | ||||
-rw-r--r-- | toxdns/toxdns.c | 2 | ||||
-rw-r--r-- | toxdns/toxdns.h | 2 |
13 files changed, 31 insertions, 30 deletions
diff --git a/docs/Prevent_Tracking.txt b/docs/Prevent_Tracking.txt index 86402110..a641f02c 100644 --- a/docs/Prevent_Tracking.txt +++ b/docs/Prevent_Tracking.txt | |||
@@ -119,7 +119,8 @@ announce response packet: | |||
119 | encrypted with the DHT private key of Node D, the public key in the request and the nonce:[[uint8_t is_stored] | 119 | encrypted with the DHT private key of Node D, the public key in the request and the nonce:[[uint8_t is_stored] |
120 | [(32 bytes) ping_id if is_stored is 0 or 2, public key that must be used to send data packets if is_stored is 1][Node_Format * (maximum of 8)]] | 120 | [(32 bytes) ping_id if is_stored is 0 or 2, public key that must be used to send data packets if is_stored is 1][Node_Format * (maximum of 8)]] |
121 | (if the is_stored is not 0, it means the information to reach the client id we are searching for is stored on this node) | 121 | (if the is_stored is not 0, it means the information to reach the client id we are searching for is stored on this node) |
122 | is_stored is 2 as a response to a peer trying to announce himself to tell the peer that he is currently annouced successfully. | 122 | is_stored is 2 as a response to a peer trying to announce himself to tell the |
123 | peer that he is currently announced successfully. | ||
123 | 124 | ||
124 | data to route response packet: | 125 | data to route response packet: |
125 | [uint8_t packet id (134)][nonce][temporary just generated public key] | 126 | [uint8_t packet id (134)][nonce][temporary just generated public key] |
diff --git a/docs/Tox_middle_level_network_protocol.txt b/docs/Tox_middle_level_network_protocol.txt index ff894246..ca561474 100644 --- a/docs/Tox_middle_level_network_protocol.txt +++ b/docs/Tox_middle_level_network_protocol.txt | |||
@@ -43,13 +43,13 @@ cookie request packet: | |||
43 | bytes)][Encrypted message containing: [Senders real public key (32 | 43 | bytes)][Encrypted message containing: [Senders real public key (32 |
44 | bytes)][padding (32 bytes)][uint64_t number (must be sent | 44 | bytes)][padding (32 bytes)][uint64_t number (must be sent |
45 | back untouched in cookie response)]] | 45 | back untouched in cookie response)]] |
46 | Encrypted message is encrypted with sender DHT private key, recievers DHT | 46 | Encrypted message is encrypted with sender DHT private key, receivers DHT |
47 | public key and the nonce. | 47 | public key and the nonce. |
48 | 48 | ||
49 | cookie response packet: | 49 | cookie response packet: |
50 | [uint8_t 25][Random nonce (24 bytes)][Encrypted message containing: | 50 | [uint8_t 25][Random nonce (24 bytes)][Encrypted message containing: |
51 | [Cookie][uint64_t number (that was sent in the request)]] | 51 | [Cookie][uint64_t number (that was sent in the request)]] |
52 | Encrypted message is encrypted with sender DHT private key, recievers DHT | 52 | Encrypted message is encrypted with sender DHT private key, receivers DHT |
53 | public key and the nonce. | 53 | public key and the nonce. |
54 | 54 | ||
55 | The Cookie should be basically: | 55 | The Cookie should be basically: |
@@ -110,11 +110,11 @@ packet request packet: [uint8_t (1)][uint8_t num][uint8_t num][uint8_t | |||
110 | num]...[uint8_t num] | 110 | num]...[uint8_t num] |
111 | 111 | ||
112 | the list of nums are a list of packet numbers the other is requesting. | 112 | the list of nums are a list of packet numbers the other is requesting. |
113 | to get the real packet numbers from this list take the recvbuffers buffer_start | 113 | to get the real packet numbers from this list take the recvbuffers buffer_start |
114 | from the packet, substract 1 to it and put it in packet_num then start from the | 114 | from the packet, subtract 1 to it and put it in packet_num then start from the |
115 | beggining of the num list: if num is zero, add 255 to packet_num then do the | 115 | beginning of the num list: if num is zero, add 255 to packet_num then do the |
116 | next num. if num isn't zero, add its value to packet_num, note that the other | 116 | next num. if num isn't zero, add its value to packet_num, note that the other |
117 | has requested we send this packet again to them then continue to the next num in | 117 | has requested we send this packet again to them then continue to the next num in |
118 | the list. | 118 | the list. |
119 | 119 | ||
120 | 120 | ||
diff --git a/other/bootstrap_daemon/tox-bootstrapd.c b/other/bootstrap_daemon/tox-bootstrapd.c index a5d1c525..e4cadb35 100644 --- a/other/bootstrap_daemon/tox-bootstrapd.c +++ b/other/bootstrap_daemon/tox-bootstrapd.c | |||
@@ -187,7 +187,7 @@ void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int | |||
187 | config_setting_t *elem = config_setting_get_elem(ports_array, i); | 187 | config_setting_t *elem = config_setting_get_elem(ports_array, i); |
188 | 188 | ||
189 | if (elem == NULL) { | 189 | if (elem == NULL) { |
190 | // it's NULL if `ports_array` is not an array (we have that check ealier) or if `i` is out of range, which should not be | 190 | // it's NULL if `ports_array` is not an array (we have that check earlier) or if `i` is out of range, which should not be |
191 | syslog(LOG_WARNING, "Port #%d: Something went wrong while parsing the port. Stopping reading ports.\n", i); | 191 | syslog(LOG_WARNING, "Port #%d: Something went wrong while parsing the port. Stopping reading ports.\n", i); |
192 | break; | 192 | break; |
193 | } | 193 | } |
diff --git a/toxav/msi.c b/toxav/msi.c index 91742c35..dad32afe 100644 --- a/toxav/msi.c +++ b/toxav/msi.c | |||
@@ -618,7 +618,7 @@ static void *timer_poll( void *arg ) | |||
618 | LOGGER_ERROR("Failed to execute timer at: %d!", handler->timers[0]->timeout); | 618 | LOGGER_ERROR("Failed to execute timer at: %d!", handler->timers[0]->timeout); |
619 | free(args); | 619 | free(args); |
620 | } else { | 620 | } else { |
621 | LOGGER_DEBUG("Exectued timer assigned at: %d", handler->timers[0]->timeout); | 621 | LOGGER_DEBUG("Executed timer assigned at: %d", handler->timers[0]->timeout); |
622 | } | 622 | } |
623 | 623 | ||
624 | timer_release(handler, handler->timers[0]->idx, 0); | 624 | timer_release(handler, handler->timers[0]->idx, 0); |
@@ -1436,7 +1436,7 @@ static void msi_handle_packet ( Messenger *messenger, int source, const uint8_t | |||
1436 | MSIMessage *msg; | 1436 | MSIMessage *msg; |
1437 | 1437 | ||
1438 | if ( !length ) { | 1438 | if ( !length ) { |
1439 | LOGGER_WARNING("Lenght param negative"); | 1439 | LOGGER_WARNING("Length param negative"); |
1440 | return; | 1440 | return; |
1441 | } | 1441 | } |
1442 | 1442 | ||
diff --git a/toxav/toxav.c b/toxav/toxav.c index cd0ec70e..7cba031e 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -230,7 +230,7 @@ void toxav_register_callstate_callback ( ToxAv *av, ToxAVCallback callback, ToxA | |||
230 | } | 230 | } |
231 | 231 | ||
232 | /** | 232 | /** |
233 | * @brief Register callback for recieving audio data | 233 | * @brief Register callback for receiving audio data |
234 | * | 234 | * |
235 | * @param callback The callback | 235 | * @param callback The callback |
236 | * @return void | 236 | * @return void |
@@ -243,7 +243,7 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in | |||
243 | } | 243 | } |
244 | 244 | ||
245 | /** | 245 | /** |
246 | * @brief Register callback for recieving video data | 246 | * @brief Register callback for receiving video data |
247 | * | 247 | * |
248 | * @param callback The callback | 248 | * @param callback The callback |
249 | * @return void | 249 | * @return void |
@@ -1091,7 +1091,7 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg) | |||
1091 | if (i == 0) { | 1091 | if (i == 0) { |
1092 | /* piece of current frame */ | 1092 | /* piece of current frame */ |
1093 | } else if (i > 0 && i < 128) { | 1093 | } else if (i > 0 && i < 128) { |
1094 | /* recieved a piece of a frame ahead, flush current frame and start reading this new frame */ | 1094 | /* received a piece of a frame ahead, flush current frame and start reading this new frame */ |
1095 | DECODE_PACKET *p = malloc(sizeof(DECODE_PACKET) + call->frame_limit); | 1095 | DECODE_PACKET *p = malloc(sizeof(DECODE_PACKET) + call->frame_limit); |
1096 | 1096 | ||
1097 | if (p) { | 1097 | if (p) { |
diff --git a/toxav/toxav.h b/toxav/toxav.h index e31c7aad..34c8be5d 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -167,7 +167,7 @@ void toxav_kill(ToxAv *av); | |||
167 | void toxav_register_callstate_callback (ToxAv *av, ToxAVCallback callback, ToxAvCallbackID id, void *userdata); | 167 | void toxav_register_callstate_callback (ToxAv *av, ToxAVCallback callback, ToxAvCallbackID id, void *userdata); |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * @brief Register callback for recieving audio data | 170 | * @brief Register callback for receiving audio data |
171 | * | 171 | * |
172 | * @param av Handler. | 172 | * @param av Handler. |
173 | * @param callback The callback | 173 | * @param callback The callback |
@@ -177,7 +177,7 @@ void toxav_register_audio_recv_callback (ToxAv *av, void (*callback)(ToxAv *, in | |||
177 | void *user_data); | 177 | void *user_data); |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * @brief Register callback for recieving video data | 180 | * @brief Register callback for receiving video data |
181 | * | 181 | * |
182 | * @param av Handler. | 182 | * @param av Handler. |
183 | * @param callback The callback | 183 | * @param callback The callback |
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 7ea89ea6..930ad67c 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -1949,7 +1949,7 @@ static void check_friend_request_timed_out(Messenger *m, uint32_t i, uint64_t t) | |||
1949 | 1949 | ||
1950 | if (f->friendrequest_lastsent + f->friendrequest_timeout < t) { | 1950 | if (f->friendrequest_lastsent + f->friendrequest_timeout < t) { |
1951 | set_friend_status(m, i, FRIEND_ADDED); | 1951 | set_friend_status(m, i, FRIEND_ADDED); |
1952 | /* Double the default timeout everytime if friendrequest is assumed | 1952 | /* Double the default timeout every time if friendrequest is assumed |
1953 | * to have been sent unsuccessfully. | 1953 | * to have been sent unsuccessfully. |
1954 | */ | 1954 | */ |
1955 | f->friendrequest_timeout *= 2; | 1955 | f->friendrequest_timeout *= 2; |
diff --git a/toxcore/crypto_core.c b/toxcore/crypto_core.c index 1799b600..32d07208 100644 --- a/toxcore/crypto_core.c +++ b/toxcore/crypto_core.c | |||
@@ -210,7 +210,7 @@ void new_nonce(uint8_t *nonce) | |||
210 | 210 | ||
211 | /* Create a request to peer. | 211 | /* Create a request to peer. |
212 | * send_public_key and send_secret_key are the pub/secret keys of the sender. | 212 | * send_public_key and send_secret_key are the pub/secret keys of the sender. |
213 | * recv_public_key is public key of reciever. | 213 | * recv_public_key is public key of receiver. |
214 | * packet must be an array of MAX_CRYPTO_REQUEST_SIZE big. | 214 | * packet must be an array of MAX_CRYPTO_REQUEST_SIZE big. |
215 | * Data represents the data we send with the request with length being the length of the data. | 215 | * Data represents the data we send with the request with length being the length of the data. |
216 | * request_id is the id of the request (32 = friend request, 254 = ping request). | 216 | * request_id is the id of the request (32 = friend request, 254 = ping request). |
diff --git a/toxcore/crypto_core.h b/toxcore/crypto_core.h index 7362d49e..f19a9790 100644 --- a/toxcore/crypto_core.h +++ b/toxcore/crypto_core.h | |||
@@ -129,7 +129,7 @@ void new_nonce(uint8_t *nonce); | |||
129 | 129 | ||
130 | /* Create a request to peer. | 130 | /* Create a request to peer. |
131 | * send_public_key and send_secret_key are the pub/secret keys of the sender. | 131 | * send_public_key and send_secret_key are the pub/secret keys of the sender. |
132 | * recv_public_key is public key of reciever. | 132 | * recv_public_key is public key of receiver. |
133 | * packet must be an array of MAX_CRYPTO_REQUEST_SIZE big. | 133 | * packet must be an array of MAX_CRYPTO_REQUEST_SIZE big. |
134 | * Data represents the data we send with the request with length being the length of the data. | 134 | * Data represents the data we send with the request with length being the length of the data. |
135 | * request_id is the id of the request (32 = friend request, 254 = ping request). | 135 | * request_id is the id of the request (32 = friend request, 254 = ping request). |
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 13b6625c..172e439b 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -657,7 +657,7 @@ static int generate_request_packet(uint8_t *data, uint16_t length, const Packets | |||
657 | } | 657 | } |
658 | 658 | ||
659 | /* Handle a request data packet. | 659 | /* Handle a request data packet. |
660 | * Remove all the packets the other recieved from the array. | 660 | * Remove all the packets the other received from the array. |
661 | * | 661 | * |
662 | * return -1 on failure. | 662 | * return -1 on failure. |
663 | * return number of requested packets on success. | 663 | * return number of requested packets on success. |
@@ -1084,7 +1084,7 @@ static int send_kill_packet(Net_Crypto *c, int crypt_connection_id) | |||
1084 | &kill_packet, sizeof(kill_packet)); | 1084 | &kill_packet, sizeof(kill_packet)); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | /* Handle a recieved data packet. | 1087 | /* Handle a received data packet. |
1088 | * | 1088 | * |
1089 | * return -1 on failure. | 1089 | * return -1 on failure. |
1090 | * return 0 on success. | 1090 | * return 0 on success. |
@@ -1181,7 +1181,7 @@ static int handle_data_packet_helper(const Net_Crypto *c, int crypt_connection_i | |||
1181 | return 0; | 1181 | return 0; |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | /* Handle a packet that was recieved for the connection. | 1184 | /* Handle a packet that was received for the connection. |
1185 | * | 1185 | * |
1186 | * return -1 on failure. | 1186 | * return -1 on failure. |
1187 | * return 0 on success. | 1187 | * return 0 on success. |
@@ -1387,7 +1387,7 @@ static int getcryptconnection_id_dht_pubkey(const Net_Crypto *c, const uint8_t * | |||
1387 | } | 1387 | } |
1388 | 1388 | ||
1389 | /* Add a source to the crypto connection. | 1389 | /* Add a source to the crypto connection. |
1390 | * This is to be used only when we have recieved a packet from that source. | 1390 | * This is to be used only when we have received a packet from that source. |
1391 | * | 1391 | * |
1392 | * return -1 on failure. | 1392 | * return -1 on failure. |
1393 | * return positive number on success. | 1393 | * return positive number on success. |
@@ -1990,7 +1990,7 @@ int send_tcp_onion_request(Net_Crypto *c, const uint8_t *data, uint16_t length) | |||
1990 | return -1; | 1990 | return -1; |
1991 | } | 1991 | } |
1992 | 1992 | ||
1993 | /* Set the function to be called when an onion response packet is recieved by one of the TCP connections. | 1993 | /* Set the function to be called when an onion response packet is received by one of the TCP connections. |
1994 | */ | 1994 | */ |
1995 | void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, | 1995 | void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, |
1996 | uint16_t length), void *object) | 1996 | uint16_t length), void *object) |
@@ -2290,7 +2290,7 @@ static int udp_handle_packet(void *object, IP_Port source, const uint8_t *packet | |||
2290 | return 0; | 2290 | return 0; |
2291 | } | 2291 | } |
2292 | 2292 | ||
2293 | /* The dT for the average packet recieving rate calculations. | 2293 | /* The dT for the average packet receiving rate calculations. |
2294 | Also used as the */ | 2294 | Also used as the */ |
2295 | #define PACKET_COUNTER_AVERAGE_INTERVAL 100 | 2295 | #define PACKET_COUNTER_AVERAGE_INTERVAL 100 |
2296 | 2296 | ||
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index 054bcbb1..f43e74c2 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -56,7 +56,7 @@ | |||
56 | before giving up. */ | 56 | before giving up. */ |
57 | #define MAX_NUM_SENDPACKET_TRIES 8 | 57 | #define MAX_NUM_SENDPACKET_TRIES 8 |
58 | 58 | ||
59 | /* The timeout of no recieved UDP packets before the direct UDP connection is considered dead. */ | 59 | /* The timeout of no received UDP packets before the direct UDP connection is considered dead. */ |
60 | #define UDP_DIRECT_TIMEOUT (MAX_NUM_SENDPACKET_TRIES * CRYPTO_SEND_PACKET_INTERVAL * 2) | 60 | #define UDP_DIRECT_TIMEOUT (MAX_NUM_SENDPACKET_TRIES * CRYPTO_SEND_PACKET_INTERVAL * 2) |
61 | 61 | ||
62 | #define PACKET_ID_PADDING 0 | 62 | #define PACKET_ID_PADDING 0 |
@@ -341,7 +341,7 @@ int add_tcp_relay_peer(Net_Crypto *c, int crypt_connection_id, IP_Port ip_port, | |||
341 | */ | 341 | */ |
342 | int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key); | 342 | int add_tcp_relay(Net_Crypto *c, IP_Port ip_port, const uint8_t *public_key); |
343 | 343 | ||
344 | /* Set the function to be called when an onion response packet is recieved by one of the TCP connections. | 344 | /* Set the function to be called when an onion response packet is received by one of the TCP connections. |
345 | */ | 345 | */ |
346 | void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, | 346 | void tcp_onion_response_handler(Net_Crypto *c, int (*tcp_onion_callback)(void *object, const uint8_t *data, |
347 | uint16_t length), void *object); | 347 | uint16_t length), void *object); |
diff --git a/toxdns/toxdns.c b/toxdns/toxdns.c index 7a7a052d..186ea82b 100644 --- a/toxdns/toxdns.c +++ b/toxdns/toxdns.c | |||
@@ -95,7 +95,7 @@ void tox_dns3_kill(void *dns3_object) | |||
95 | * This is what the string returned looks like: | 95 | * This is what the string returned looks like: |
96 | * 4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc | 96 | * 4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc |
97 | * | 97 | * |
98 | * returns length of string on sucess. | 98 | * returns length of string on success. |
99 | * returns -1 on failure. | 99 | * returns -1 on failure. |
100 | */ | 100 | */ |
101 | int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string_max_len, uint32_t *request_id, | 101 | int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string_max_len, uint32_t *request_id, |
diff --git a/toxdns/toxdns.h b/toxdns/toxdns.h index a0cc323b..bbcbea80 100644 --- a/toxdns/toxdns.h +++ b/toxdns/toxdns.h | |||
@@ -61,7 +61,7 @@ void tox_dns3_kill(void *dns3_object); | |||
61 | * This is what the string returned looks like: | 61 | * This is what the string returned looks like: |
62 | * 4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc | 62 | * 4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc |
63 | * | 63 | * |
64 | * returns length of string on sucess. | 64 | * returns length of string on success. |
65 | * returns -1 on failure. | 65 | * returns -1 on failure. |
66 | */ | 66 | */ |
67 | int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string_max_len, uint32_t *request_id, | 67 | int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string_max_len, uint32_t *request_id, |