summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos E. Garcia <carlos@cgarcia.org>2014-04-16 12:08:44 -0400
committerCarlos E. Garcia <carlos@cgarcia.org>2014-04-16 12:14:44 -0400
commitcf33c2f9ad98edc50d50e018e214bb0b6180d96d (patch)
treeb3350486775a95f5774f4352aef38de588a64af7
parent3835bc167b37a0faada3362a1f3a57632d58b6da (diff)
multiple spelling fixes
-rw-r--r--docs/Group-Chats.md8
-rw-r--r--docs/Prevent_Tracking.txt5
-rw-r--r--docs/TCP_Network.txt4
-rw-r--r--docs/av_api.md2
-rw-r--r--docs/updates/Crypto.md2
-rw-r--r--m4/pkg.m42
-rw-r--r--other/DHTnodes2
-rw-r--r--other/fun/cracker.c2
-rwxr-xr-xtoxav/msi.c24
-rwxr-xr-xtoxav/msi.h6
-rwxr-xr-xtoxav/phone.c4
-rw-r--r--toxcore/DHT.c18
-rw-r--r--toxcore/DHT.h2
-rw-r--r--toxcore/Lossless_UDP.c2
-rw-r--r--toxcore/Lossless_UDP.h2
-rw-r--r--toxcore/Messenger.c2
-rw-r--r--toxcore/Messenger.h4
-rw-r--r--toxcore/TCP_server.c2
-rw-r--r--toxcore/TCP_server.h2
-rw-r--r--toxcore/assoc.c2
-rw-r--r--toxcore/net_crypto.c2
-rw-r--r--toxcore/net_crypto.h2
-rw-r--r--toxcore/onion_client.c6
-rw-r--r--toxcore/onion_client.h4
-rw-r--r--toxcore/tox.c2
-rw-r--r--toxcore/tox.h10
26 files changed, 62 insertions, 61 deletions
diff --git a/docs/Group-Chats.md b/docs/Group-Chats.md
index e318613d..5e00b550 100644
--- a/docs/Group-Chats.md
+++ b/docs/Group-Chats.md
@@ -21,18 +21,18 @@ See DHT, currently uses the IPv6 Node_format.
21Get nodes (Request): 21Get nodes (Request):
22Packet contents: 22Packet contents:
23``` 23```
24[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce, private key of the sender and public key of the reciever:[char with a value of 48][random 8 byte (ping_id)] 24[char with a value of 48][Bob's (The receiver's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce, private key of the sender and public key of the receiver:[char with a value of 48][random 8 byte (ping_id)]
25``` 25```
26Valid replies: a send_nodes packet 26Valid replies: a send_nodes packet
27 27
28Send_nodes (response): 28Send_nodes (response):
29``` 29```
30[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce, private key of the sender and public key of the reciever:[char with a value of 49][random 8 byte (ping_id)][Nodes in node format, length=40 * (number of nodes (maximum of 6 nodes)) bytes]] 30[char with a value of 48][Bob's (The receiver's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce, private key of the sender and public key of the receiver:[char with a value of 49][random 8 byte (ping_id)][Nodes in node format, length=40 * (number of nodes (maximum of 6 nodes)) bytes]]
31``` 31```
32 32
33Broadcast packet: 33Broadcast packet:
34``` 34```
35[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][nonce][Encrypted with the nonce, private key of the sender and public key of the reciever:[char with a value of 50][Data to send to everyone]] 35[char with a value of 48][Bob's (The receiver's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][nonce][Encrypted with the nonce, private key of the sender and public key of the receiver:[char with a value of 50][Data to send to everyone]]
36``` 36```
37 37
38 38
@@ -68,4 +68,4 @@ Ban a peer
68[uint8_t message[messagelen]] 68[uint8_t message[messagelen]]
69 69
7065 - action (/me) 7065 - action (/me)
71[uint8_t message[messagelen]] \ No newline at end of file 71[uint8_t message[messagelen]]
diff --git a/docs/Prevent_Tracking.txt b/docs/Prevent_Tracking.txt
index c5f33e96..d170103f 100644
--- a/docs/Prevent_Tracking.txt
+++ b/docs/Prevent_Tracking.txt
@@ -110,7 +110,8 @@ encrypted with that temporary private key and the nonce and the public key from
110(if Node D contains the ret data for the node, it sends the stuff in this packet as a data to route response packet to the right node) 110(if Node D contains the ret data for the node, it sends the stuff in this packet as a data to route response packet to the right node)
111 111
112The data in the previous packet is in format: [real public key of sender] 112The data in the previous packet is in format: [real public key of sender]
113encrypted with real private key of the sender, the nonce in the data packet and the real public key of the reciever:[[uint8_t id][data (optional)]] 113encrypted with real private key of the sender, the nonce in the data packet and
114the real public key of the receiver:[[uint8_t id][data (optional)]]
114 115
115Data sent to us: 116Data sent to us:
116announce response packet: 117announce response packet:
@@ -153,5 +154,5 @@ Data packets:
153 154
154To tell our friend what our DHT public key is so that he can connect to us we send a data packet 155To tell our friend what our DHT public key is so that he can connect to us we send a data packet
155with id 156 and the data being:[uint64_t (in network byte order) no_replay, the packet will only be 156with id 156 and the data being:[uint64_t (in network byte order) no_replay, the packet will only be
156accepted if this number is bigger than the last one recieved] [our dht public key][Node_Format * ( 157accepted if this number is bigger than the last one received] [our dht public key][Node_Format * (
157maximum of 8) nodes closest to us so that the friend can find us faster] 158maximum of 8) nodes closest to us so that the friend can find us faster]
diff --git a/docs/TCP_Network.txt b/docs/TCP_Network.txt
index 775ccc88..9841329c 100644
--- a/docs/TCP_Network.txt
+++ b/docs/TCP_Network.txt
@@ -81,7 +81,7 @@ received
81client sent the server the public key and the public key we sent to the client, 81client sent the server the public key and the public key we sent to the client,
82the next with base nonce + 1...) 82the next with base nonce + 1...)
83 83
84The connection is set to an unconfirmed state until a packet is recieved and 84The connection is set to an unconfirmed state until a packet is received and
85decrypted correctly using the information in the handshake. 85decrypted correctly using the information in the handshake.
86 86
87each packet sent to/from the server has an id (the first byte of the plain text 87each packet sent to/from the server has an id (the first byte of the plain text
@@ -135,7 +135,7 @@ responses must be sent to the proper client.
135 135
136Ping responses must have the same ping_id as the request. 136Ping responses must have the same ping_id as the request.
137 137
138If the server recieves a ping packet he must respond with a ping response. 138If the server receives a ping packet he must respond with a ping response.
139 139
140The server will send a ping packet to clients every 30 seconds, they have 30 140The server will send a ping packet to clients every 30 seconds, they have 30
141seconds to respond, if they don't the connection is deleted. 141seconds to respond, if they don't the connection is deleted.
diff --git a/docs/av_api.md b/docs/av_api.md
index 17930144..2f536ade 100644
--- a/docs/av_api.md
+++ b/docs/av_api.md
@@ -34,7 +34,7 @@ msi_session_t* - pointer to a newly created msi session handler.
34###msi_session_t reference: 34###msi_session_t reference:
35 35
36How to handle msi session: 36How to handle msi session:
37Controling is done via callbacks and action handlers. 37Controlling is done via callbacks and action handlers.
38First register callbacks for every state/action received and make sure 38First register callbacks for every state/action received and make sure
39NOT TO PLACE SOMETHING LIKE LOOPS THAT TAKES A LOT OF TIME TO EXECUTE; every callback is being called 39NOT TO PLACE SOMETHING LIKE LOOPS THAT TAKES A LOT OF TIME TO EXECUTE; every callback is being called
40directly from event loop. You can find examples in phone.c. 40directly from event loop. You can find examples in phone.c.
diff --git a/docs/updates/Crypto.md b/docs/updates/Crypto.md
index a6c701d3..939c15e2 100644
--- a/docs/updates/Crypto.md
+++ b/docs/updates/Crypto.md
@@ -74,4 +74,4 @@ Crypto request packets
74 74
75The encrypted message is encrypted with crypto_box() (using Bobs public key, Alice's private key and the nonce (randomly generated 24 bytes)) and is a message from Alice in which she tells Bob who she is. 75The encrypted message is encrypted with crypto_box() (using Bobs public key, Alice's private key and the nonce (randomly generated 24 bytes)) and is a message from Alice in which she tells Bob who she is.
76 76
77Each node can route the request to the reciever if they are connected to him. This is to bypass bad NATs. 77Each node can route the request to the receiver if they are connected to him. This is to bypass bad NATs.
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index f26f84c9..260e1fb9 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -53,7 +53,7 @@ fi[]dnl
53# to PKG_CHECK_MODULES(), but does not set variables or print errors. 53# to PKG_CHECK_MODULES(), but does not set variables or print errors.
54# 54#
55# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 55# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
56# only at the first occurence in configure.ac, so if the first place 56# only at the first occurrence in configure.ac, so if the first place
57# it's called might be skipped (such as if it is within an "if", you 57# it's called might be skipped (such as if it is within an "if", you
58# have to call PKG_CHECK_EXISTS manually 58# have to call PKG_CHECK_EXISTS manually
59# -------------------------------------------------------------- 59# --------------------------------------------------------------
diff --git a/other/DHTnodes b/other/DHTnodes
index 35509931..0abdbbd9 100644
--- a/other/DHTnodes
+++ b/other/DHTnodes
@@ -1,3 +1,3 @@
1As maintaining 2 seperate lists of the same information seemed redundant, this list has been phased out. 1As maintaining 2 separate lists of the same information seemed redundant, this list has been phased out.
2 2
3For a current DHT node list please visit http://wiki.tox.im/nodes 3For a current DHT node list please visit http://wiki.tox.im/nodes
diff --git a/other/fun/cracker.c b/other/fun/cracker.c
index 9921df31..7b7000de 100644
--- a/other/fun/cracker.c
+++ b/other/fun/cracker.c
@@ -32,7 +32,7 @@ void print_key(uint8_t *client_id)
32int main(int argc, char *argv[]) 32int main(int argc, char *argv[])
33{ 33{
34 if (argc < 2) { 34 if (argc < 2) {
35 printf("usage: ./cracker public_key(or beggining of one in hex format)\n"); 35 printf("usage: ./cracker public_key(or beginning of one in hex format)\n");
36 return 0; 36 return 0;
37 } 37 }
38 38
diff --git a/toxav/msi.c b/toxav/msi.c
index 26e301d3..3ffb44b2 100755
--- a/toxav/msi.c
+++ b/toxav/msi.c
@@ -206,7 +206,7 @@ static inline__ const uint8_t *stringify_response ( MSIResponse response )
206 206
207#define ON_HEADER(iterator, header, descriptor, size_const) \ 207#define ON_HEADER(iterator, header, descriptor, size_const) \
208( memcmp(iterator, descriptor, size_const) == 0){ /* Okay */ \ 208( memcmp(iterator, descriptor, size_const) == 0){ /* Okay */ \
209 iterator += size_const; /* Set iterator at begining of value part */ \ 209 iterator += size_const; /* Set iterator at beginning of value part */ \
210 if ( *iterator != value_byte ) { assert(0); return -1; }\ 210 if ( *iterator != value_byte ) { assert(0); return -1; }\
211 iterator ++;\ 211 iterator ++;\
212 uint16_t _value_size = (uint16_t) *(iterator ) << 8 | \ 212 uint16_t _value_size = (uint16_t) *(iterator ) << 8 | \
@@ -225,7 +225,7 @@ static inline__ const uint8_t *stringify_response ( MSIResponse response )
225 * @param msg Container. 225 * @param msg Container.
226 * @param data The data. 226 * @param data The data.
227 * @return int 227 * @return int
228 * @retval -1 Error occured. 228 * @retval -1 Error occurred.
229 * @retval 0 Success. 229 * @retval 0 Success.
230 */ 230 */
231int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length ) 231int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length )
@@ -338,7 +338,7 @@ void free_message ( MSIMessage *msg )
338 * @param type Request or response. 338 * @param type Request or response.
339 * @param type_id Type of request/response. 339 * @param type_id Type of request/response.
340 * @return MSIMessage* Created message. 340 * @return MSIMessage* Created message.
341 * @retval NULL Error occured. 341 * @retval NULL Error occurred.
342 */ 342 */
343MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) 343MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id )
344{ 344{
@@ -367,7 +367,7 @@ MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id )
367 * 367 *
368 * @param data The data. 368 * @param data The data.
369 * @return MSIMessage* Parsed message. 369 * @return MSIMessage* Parsed message.
370 * @retval NULL Error occured. 370 * @retval NULL Error occurred.
371 */ 371 */
372MSIMessage *parse_message ( const uint8_t *data, uint16_t length ) 372MSIMessage *parse_message ( const uint8_t *data, uint16_t length )
373{ 373{
@@ -422,7 +422,7 @@ uint8_t *append_header_to_string (
422 422
423 *dest = field_byte; /* Set the first byte */ 423 *dest = field_byte; /* Set the first byte */
424 424
425 uint8_t *_getback_byte = dest + 1; /* remeber the byte we were on */ 425 uint8_t *_getback_byte = dest + 1; /* remember the byte we were on */
426 dest += 3; /* swith to 4th byte where field value starts */ 426 dest += 3; /* swith to 4th byte where field value starts */
427 427
428 /* Now set the field value and calculate it's length */ 428 /* Now set the field value and calculate it's length */
@@ -604,7 +604,7 @@ static inline__ const uint8_t *stringify_error_code ( MSICallError error_code )
604 * @param msg The message. 604 * @param msg The message.
605 * @param to Where to. 605 * @param to Where to.
606 * @return int 606 * @return int
607 * @retval -1 Error occured. 607 * @retval -1 Error occurred.
608 * @retval 0 Success. 608 * @retval 0 Success.
609 */ 609 */
610int send_message ( MSISession *session, MSIMessage *msg, uint32_t to ) 610int send_message ( MSISession *session, MSIMessage *msg, uint32_t to )
@@ -721,7 +721,7 @@ int handle_error ( MSISession *session, MSICallError errid, uint32_t to )
721 * @param msg The message. 721 * @param msg The message.
722 * @return int 722 * @return int
723 * @retval -1 No error. 723 * @retval -1 No error.
724 * @retval 0 Error occured and response sent. 724 * @retval 0 Error occurred and response sent.
725 */ 725 */
726int has_call_error ( MSISession *session, MSIMessage *msg ) 726int has_call_error ( MSISession *session, MSIMessage *msg )
727{ 727{
@@ -830,7 +830,7 @@ MSICall *init_call ( MSISession *session, int peers, int ringing_timeout )
830 * 830 *
831 * @param session Control session. 831 * @param session Control session.
832 * @return int 832 * @return int
833 * @retval -1 Error occured. 833 * @retval -1 Error occurred.
834 * @retval 0 Success. 834 * @retval 0 Success.
835 */ 835 */
836int terminate_call ( MSISession *session ) 836int terminate_call ( MSISession *session )
@@ -882,7 +882,7 @@ int handle_recv_invite ( MSISession *session, MSIMessage *msg )
882 * B calls A. Who has advantage is set bey calculating 882 * B calls A. Who has advantage is set bey calculating
883 * 'bigger' Call id and then that call id is being used in 883 * 'bigger' Call id and then that call id is being used in
884 * future. User with 'bigger' Call id has the advantage 884 * future. User with 'bigger' Call id has the advantage
885 * as in he will wait the reponse from the other. 885 * as in he will wait the response from the other.
886 */ 886 */
887 887
888 if ( call_id_bigger (session->call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */ 888 if ( call_id_bigger (session->call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */
@@ -1250,7 +1250,7 @@ void msi_register_callback ( MSICallback callback, MSICallbackID id, void* userd
1250 * @param messenger Tox* object. 1250 * @param messenger Tox* object.
1251 * @param user_agent User agent, i.e. 'Venom'; 'QT-gui' 1251 * @param user_agent User agent, i.e. 'Venom'; 'QT-gui'
1252 * @return MSISession* The created session. 1252 * @return MSISession* The created session.
1253 * @retval NULL Error occured. 1253 * @retval NULL Error occurred.
1254 */ 1254 */
1255MSISession *msi_init_session ( Messenger* messenger ) 1255MSISession *msi_init_session ( Messenger* messenger )
1256{ 1256{
@@ -1351,7 +1351,7 @@ int msi_invite ( MSISession *session, MSICallType call_type, uint32_t rngsec, ui
1351 * 1351 *
1352 * @param session Control session. 1352 * @param session Control session.
1353 * @return int 1353 * @return int
1354 * @retval -1 Error occured. 1354 * @retval -1 Error occurred.
1355 * @retval 0 Success. 1355 * @retval 0 Success.
1356 */ 1356 */
1357int msi_hangup ( MSISession *session ) 1357int msi_hangup ( MSISession *session )
@@ -1485,4 +1485,4 @@ int msi_stopcall ( MSISession *session )
1485 terminate_call ( session ); 1485 terminate_call ( session );
1486 1486
1487 return 0; 1487 return 0;
1488} \ No newline at end of file 1488}
diff --git a/toxav/msi.h b/toxav/msi.h
index 37fc07a3..39a9c792 100755
--- a/toxav/msi.h
+++ b/toxav/msi.h
@@ -82,7 +82,7 @@ typedef struct _MSICall { /* Call info structure */
82 int ringing_timer_id; /* Timer id for ringing timeout */ 82 int ringing_timer_id; /* Timer id for ringing timeout */
83 83
84 pthread_mutex_t mutex; /* It's to be assumed that call will have 84 pthread_mutex_t mutex; /* It's to be assumed that call will have
85 * seperate thread so add mutex 85 * separate thread so add mutex
86 */ 86 */
87 uint32_t *peers; 87 uint32_t *peers;
88 uint16_t peer_count; 88 uint16_t peer_count;
@@ -152,7 +152,7 @@ void msi_register_callback(MSICallback callback, MSICallbackID id, void* userdat
152 * 152 *
153 * @param messenger Tox* object. 153 * @param messenger Tox* object.
154 * @return MSISession* The created session. 154 * @return MSISession* The created session.
155 * @retval NULL Error occured. 155 * @retval NULL Error occurred.
156 */ 156 */
157MSISession *msi_init_session ( Messenger *messenger ); 157MSISession *msi_init_session ( Messenger *messenger );
158 158
@@ -183,7 +183,7 @@ int msi_invite ( MSISession *session, MSICallType call_type, uint32_t rngsec, ui
183 * 183 *
184 * @param session Control session. 184 * @param session Control session.
185 * @return int 185 * @return int
186 * @retval -1 Error occured. 186 * @retval -1 Error occurred.
187 * @retval 0 Success. 187 * @retval 0 Success.
188 */ 188 */
189int msi_hangup ( MSISession *session ); 189int msi_hangup ( MSISession *session );
diff --git a/toxav/phone.c b/toxav/phone.c
index 2b33f7e9..74f743f7 100755
--- a/toxav/phone.c
+++ b/toxav/phone.c
@@ -5,7 +5,7 @@
5 * This file is for testing/reference purposes only, hence 5 * This file is for testing/reference purposes only, hence
6 * it is _poorly_ designed and it does not fully reflect the 6 * it is _poorly_ designed and it does not fully reflect the
7 * quaility of msi nor rtp. Although toxmsi* and toxrtp* are tested 7 * quaility of msi nor rtp. Although toxmsi* and toxrtp* are tested
8 * there is always possiblity of crashes. If crash occures, 8 * there is always possibility of crashes. If crash occures,
9 * contact me ( mannol ) on either irc channel #tox-dev @ freenode.net:6667 9 * contact me ( mannol ) on either irc channel #tox-dev @ freenode.net:6667
10 * or eniz_vukovic@hotmail.com 10 * or eniz_vukovic@hotmail.com
11 * 11 *
@@ -612,7 +612,7 @@ void *decode_video_thread(void *arg)
612 612
613 } //else { 613 } //else {
614 614
615 /* TODO: request the sender to create a new i-frame immediatly */ 615 /* TODO: request the sender to create a new i-frame immediately */
616 //printf("Bad video packet\n"); 616 //printf("Bad video packet\n");
617 //} 617 //}
618 //} 618 //}
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 1089e2ff..ad496f7d 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -164,7 +164,7 @@ void get_shared_key(Shared_Keys *shared_keys, uint8_t *shared_key, uint8_t *secr
164} 164}
165 165
166/* Copy shared_key to decrypt DHT packet from client_id into shared_key 166/* Copy shared_key to decrypt DHT packet from client_id into shared_key
167 * for packets that we recieve. 167 * for packets that we receive.
168 */ 168 */
169void DHT_get_shared_key_recv(DHT *dht, uint8_t *shared_key, uint8_t *client_id) 169void DHT_get_shared_key_recv(DHT *dht, uint8_t *shared_key, uint8_t *client_id)
170{ 170{
@@ -600,7 +600,7 @@ static int replace_possible_bad( Client_data *list,
600 600
601 sort_list(list, length, comp_client_id); 601 sort_list(list, length, comp_client_id);
602 602
603 /* TODO: decide if the folowing lines should stay commented or not. 603 /* TODO: decide if the following lines should stay commented or not.
604 if (id_closest(comp_client_id, list[0].client_id, client_id) == 1) 604 if (id_closest(comp_client_id, list[0].client_id, client_id) == 1)
605 return 0;*/ 605 return 0;*/
606 606
@@ -861,20 +861,20 @@ static int getnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cli
861 861
862 uint64_t temp_time = unix_time(); 862 uint64_t temp_time = unix_time();
863 memcpy(plain_message, &temp_time, sizeof(temp_time)); 863 memcpy(plain_message, &temp_time, sizeof(temp_time));
864 Node_format reciever; 864 Node_format receiver;
865 memcpy(reciever.client_id, public_key, CLIENT_ID_SIZE); 865 memcpy(receiver.client_id, public_key, CLIENT_ID_SIZE);
866 reciever.ip_port = ip_port; 866 receiver.ip_port = ip_port;
867 memcpy(plain_message + sizeof(temp_time), &reciever, sizeof(reciever)); 867 memcpy(plain_message + sizeof(temp_time), &receiver, sizeof(receiver));
868 868
869 if (sendback_node != NULL) 869 if (sendback_node != NULL)
870 memcpy(plain_message + sizeof(temp_time) + sizeof(reciever), sendback_node, sizeof(Node_format)); 870 memcpy(plain_message + sizeof(temp_time) + sizeof(receiver), sendback_node, sizeof(Node_format));
871 else 871 else
872 memset(plain_message + sizeof(temp_time) + sizeof(reciever), 0, sizeof(Node_format)); 872 memset(plain_message + sizeof(temp_time) + sizeof(receiver), 0, sizeof(Node_format));
873 873
874 int len_m = encrypt_data_symmetric(dht->secret_symmetric_key, 874 int len_m = encrypt_data_symmetric(dht->secret_symmetric_key,
875 nonce, 875 nonce,
876 plain_message, 876 plain_message,
877 sizeof(temp_time) + sizeof(reciever) + sizeof(Node_format), 877 sizeof(temp_time) + sizeof(receiver) + sizeof(Node_format),
878 encrypted_message + crypto_secretbox_NONCEBYTES); 878 encrypted_message + crypto_secretbox_NONCEBYTES);
879 879
880 if (len_m != NODES_ENCRYPTED_MESSAGE_LENGTH - crypto_secretbox_NONCEBYTES) 880 if (len_m != NODES_ENCRYPTED_MESSAGE_LENGTH - crypto_secretbox_NONCEBYTES)
diff --git a/toxcore/DHT.h b/toxcore/DHT.h
index 3d2722f8..81f1f560 100644
--- a/toxcore/DHT.h
+++ b/toxcore/DHT.h
@@ -192,7 +192,7 @@ typedef struct {
192void get_shared_key(Shared_Keys *shared_keys, uint8_t *shared_key, uint8_t *secret_key, uint8_t *client_id); 192void get_shared_key(Shared_Keys *shared_keys, uint8_t *shared_key, uint8_t *secret_key, uint8_t *client_id);
193 193
194/* Copy shared_key to decrypt DHT packet from client_id into shared_key 194/* Copy shared_key to decrypt DHT packet from client_id into shared_key
195 * for packets that we recieve. 195 * for packets that we receive.
196 */ 196 */
197void DHT_get_shared_key_recv(DHT *dht, uint8_t *shared_key, uint8_t *client_id); 197void DHT_get_shared_key_recv(DHT *dht, uint8_t *shared_key, uint8_t *client_id);
198 198
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index c0db8a10..9a7cdcb2 100644
--- a/toxcore/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
@@ -292,7 +292,7 @@ static int new_inconnection(Lossless_UDP *ludp, IP_Port ip_port)
292} 292}
293 293
294/* 294/*
295 * return an integer corresponding to the next connection in our incoming connection list with at least numpackets in the recieve queue. 295 * return an integer corresponding to the next connection in our incoming connection list with at least numpackets in the receive queue.
296 * return -1 if there are no new incoming connections in the list. 296 * return -1 if there are no new incoming connections in the list.
297 */ 297 */
298int incoming_connection(Lossless_UDP *ludp, uint32_t numpackets) 298int incoming_connection(Lossless_UDP *ludp, uint32_t numpackets)
diff --git a/toxcore/Lossless_UDP.h b/toxcore/Lossless_UDP.h
index b23d602a..01ce05f9 100644
--- a/toxcore/Lossless_UDP.h
+++ b/toxcore/Lossless_UDP.h
@@ -156,7 +156,7 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port);
156int getconnection_id(Lossless_UDP *ludp, IP_Port ip_port); 156int getconnection_id(Lossless_UDP *ludp, IP_Port ip_port);
157 157
158/* 158/*
159 * return an integer corresponding to the next connection in our incoming connection list with at least numpackets in the recieve queue. 159 * return an integer corresponding to the next connection in our incoming connection list with at least numpackets in the receive queue.
160 * return -1 if there are no new incoming connections in the list. 160 * return -1 if there are no new incoming connections in the list.
161 */ 161 */
162int incoming_connection(Lossless_UDP *ludp, uint32_t numpackets); 162int incoming_connection(Lossless_UDP *ludp, uint32_t numpackets);
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index db5390c0..752b164d 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -2172,7 +2172,7 @@ void do_friends(Messenger *m)
2172 } 2172 }
2173 2173
2174 if (m->friendlist[i].ping_lastrecv + FRIEND_CONNECTION_TIMEOUT < temp_time) { 2174 if (m->friendlist[i].ping_lastrecv + FRIEND_CONNECTION_TIMEOUT < temp_time) {
2175 /* If we stopped recieving ping packets, kill it. */ 2175 /* If we stopped receiving ping packets, kill it. */
2176 crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); 2176 crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id);
2177 m->friendlist[i].crypt_connection_id = -1; 2177 m->friendlist[i].crypt_connection_id = -1;
2178 set_friend_status(m, i, FRIEND_CONFIRMED); 2178 set_friend_status(m, i, FRIEND_CONFIRMED);
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h
index c29b6594..43cc48f9 100644
--- a/toxcore/Messenger.h
+++ b/toxcore/Messenger.h
@@ -90,7 +90,7 @@ enum {
90/* Interval between the sending of ping packets. */ 90/* Interval between the sending of ping packets. */
91#define FRIEND_PING_INTERVAL 5 91#define FRIEND_PING_INTERVAL 5
92 92
93/* If no packets are recieved from friend in this time interval, kill the connection. */ 93/* If no packets are received from friend in this time interval, kill the connection. */
94#define FRIEND_CONNECTION_TIMEOUT (FRIEND_PING_INTERVAL * 2) 94#define FRIEND_CONNECTION_TIMEOUT (FRIEND_PING_INTERVAL * 2)
95 95
96/* USERSTATUS - 96/* USERSTATUS -
@@ -354,7 +354,7 @@ int setname(Messenger *m, uint8_t *name, uint16_t length);
354 354
355/* 355/*
356 * Get your nickname. 356 * Get your nickname.
357 * m - The messanger context to use. 357 * m - The messenger context to use.
358 * name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH bytes. 358 * name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH bytes.
359 * 359 *
360 * return length of the name. 360 * return length of the name.
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index 410111f4..7ad5ff7e 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -224,7 +224,7 @@ int read_TCP_packet(sock_t sock, uint8_t *data, uint16_t length)
224 return -1; 224 return -1;
225} 225}
226 226
227/* return length of recieved packet on success. 227/* return length of received packet on success.
228 * return 0 if could not read any packet. 228 * return 0 if could not read any packet.
229 * return -1 on failure (connection must be killed). 229 * return -1 on failure (connection must be killed).
230 */ 230 */
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h
index 498b1147..5046b8eb 100644
--- a/toxcore/TCP_server.h
+++ b/toxcore/TCP_server.h
@@ -140,7 +140,7 @@ uint16_t read_TCP_length(sock_t sock);
140 */ 140 */
141int read_TCP_packet(sock_t sock, uint8_t *data, uint16_t length); 141int read_TCP_packet(sock_t sock, uint8_t *data, uint16_t length);
142 142
143/* return length of recieved packet on success. 143/* return length of received packet on success.
144 * return 0 if could not read any packet. 144 * return 0 if could not read any packet.
145 * return -1 on failure (connection must be killed). 145 * return -1 on failure (connection must be killed).
146 */ 146 */
diff --git a/toxcore/assoc.c b/toxcore/assoc.c
index 2c1f0bad..50bc3a3e 100644
--- a/toxcore/assoc.c
+++ b/toxcore/assoc.c
@@ -28,7 +28,7 @@
28 * Candidates are kept in buckets of hash tables. The hash 28 * Candidates are kept in buckets of hash tables. The hash
29 * function is calculated from the client_id. Up to 29 * function is calculated from the client_id. Up to
30 * HASH_COLLIDE_COUNT alternative positions are tried if 30 * HASH_COLLIDE_COUNT alternative positions are tried if
31 * the inital position is already used by a different entry. 31 * the initial position is already used by a different entry.
32 * The collision function is multiplicative, not additive. 32 * The collision function is multiplicative, not additive.
33 * 33 *
34 * A new candidate can bump an existing candidate, if it is 34 * A new candidate can bump an existing candidate, if it is
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 17d2e8ff..6e5b8c82 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -284,7 +284,7 @@ int write_cryptpacket(Net_Crypto *c, int crypt_connection_id, uint8_t *data, uin
284 284
285/* Create a request to peer. 285/* Create a request to peer.
286 * send_public_key and send_secret_key are the pub/secret keys of the sender. 286 * send_public_key and send_secret_key are the pub/secret keys of the sender.
287 * recv_public_key is public key of reciever. 287 * recv_public_key is public key of receiver.
288 * packet must be an array of MAX_DATA_SIZE big. 288 * packet must be an array of MAX_DATA_SIZE big.
289 * Data represents the data we send with the request with length being the length of the data. 289 * Data represents the data we send with the request with length being the length of the data.
290 * request_id is the id of the request (32 = friend request, 254 = ping request). 290 * request_id is the id of the request (32 = friend request, 254 = ping request).
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h
index da776527..86668058 100644
--- a/toxcore/net_crypto.h
+++ b/toxcore/net_crypto.h
@@ -162,7 +162,7 @@ int write_cryptpacket(Net_Crypto *c, int crypt_connection_id, uint8_t *data, uin
162 162
163/* Create a request to peer. 163/* Create a request to peer.
164 * send_public_key and send_secret_key are the pub/secret keys of the sender. 164 * send_public_key and send_secret_key are the pub/secret keys of the sender.
165 * recv_public_key is public key of reciever. 165 * recv_public_key is public key of receiver.
166 * packet must be an array of MAX_DATA_SIZE big. 166 * packet must be an array of MAX_DATA_SIZE big.
167 * Data represents the data we send with the request with length being the length of the data. 167 * Data represents the data we send with the request with length being the length of the data.
168 * request_id is the id of the request (32 = friend request, 254 = ping request). 168 * request_id is the id of the request (32 = friend request, 254 = ping request).
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index 329b1d13..c9f60b2b 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -513,9 +513,9 @@ static int handle_fakeid_announce(void *object, uint8_t *source_pubkey, uint8_t
513 return 0; 513 return 0;
514} 514}
515/* Send data of length length to friendnum. 515/* Send data of length length to friendnum.
516 * This data will be recieved by the friend using the Onion_Data_Handlers callbacks. 516 * This data will be received by the friend using the Onion_Data_Handlers callbacks.
517 * 517 *
518 * Even if this function succeeds, the friend might not recieve any data. 518 * Even if this function succeeds, the friend might not receive any data.
519 * 519 *
520 * return the number of packets sent on success 520 * return the number of packets sent on success
521 * return -1 on failure. 521 * return -1 on failure.
@@ -578,7 +578,7 @@ int send_onion_data(Onion_Client *onion_c, int friend_num, uint8_t *data, uint32
578 578
579/* Try to send the fakeid via the DHT instead of onion 579/* Try to send the fakeid via the DHT instead of onion
580 * 580 *
581 * Even if this function succeeds, the friend might not recieve any data. 581 * Even if this function succeeds, the friend might not receive any data.
582 * 582 *
583 * return the number of packets sent on success 583 * return the number of packets sent on success
584 * return -1 on failure. 584 * return -1 on failure.
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index 4045cc0e..9c89afe5 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -172,9 +172,9 @@ int onion_getfriendip(Onion_Client *onion_c, int friend_num, IP_Port *ip_port);
172 172
173 173
174/* Send data of length length to friendnum. 174/* Send data of length length to friendnum.
175 * This data will be recieved by the friend using the Onion_Data_Handlers callbacks. 175 * This data will be received by the friend using the Onion_Data_Handlers callbacks.
176 * 176 *
177 * Even if this function succeeds, the friend might not recieve any data. 177 * Even if this function succeeds, the friend might not receive any data.
178 * 178 *
179 * return the number of packets sent on success 179 * return the number of packets sent on success
180 * return -1 on failure. 180 * return -1 on failure.
diff --git a/toxcore/tox.c b/toxcore/tox.c
index c07473dd..ec21407f 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -186,7 +186,7 @@ int tox_set_name(Tox *tox, uint8_t *name, uint16_t length)
186} 186}
187 187
188/* Get your nickname. 188/* Get your nickname.
189 * m - The messanger context to use. 189 * m - The messenger context to use.
190 * name - Pointer to a string for the name. (must be at least MAX_NAME_LENGTH) 190 * name - Pointer to a string for the name. (must be at least MAX_NAME_LENGTH)
191 * 191 *
192 * return length of the name. 192 * return length of the name.
diff --git a/toxcore/tox.h b/toxcore/tox.h
index d94c0e13..c344d366 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -210,7 +210,7 @@ int tox_set_name(Tox *tox, uint8_t *name, uint16_t length);
210 210
211/* 211/*
212 * Get your nickname. 212 * Get your nickname.
213 * m - The messanger context to use. 213 * m - The messenger context to use.
214 * name - needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes. 214 * name - needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes.
215 * 215 *
216 * return length of name. 216 * return length of name.
@@ -515,11 +515,11 @@ uint32_t tox_get_chatlist(Tox *tox, int *out_list, uint32_t list_size);
515 * tox_file_data_remaining(...) can be used to know how many bytes are left to send/receive. 515 * tox_file_data_remaining(...) can be used to know how many bytes are left to send/receive.
516 * 516 *
517 * If the connection breaks during file sending (The other person goes offline without pausing the sending and then comes back) 517 * If the connection breaks during file sending (The other person goes offline without pausing the sending and then comes back)
518 * the reciever must send a control packet with receive_send == 0 message_id = TOX_FILECONTROL_RESUME_BROKEN and the data being 518 * the receiver must send a control packet with receive_send == 0 message_id = TOX_FILECONTROL_RESUME_BROKEN and the data being
519 * a uint64_t (in host byte order) containing the number of bytes recieved. 519 * a uint64_t (in host byte order) containing the number of bytes received.
520 * 520 *
521 * If the sender recieves this packet, he must send a control packet with receive_send == 1 and control_type == TOX_FILECONTROL_ACCEPT 521 * If the sender receives this packet, he must send a control packet with receive_send == 1 and control_type == TOX_FILECONTROL_ACCEPT
522 * then he must start sending file data from the position (data , uint64_t in host byte order) recieved in the TOX_FILECONTROL_RESUME_BROKEN packet. 522 * then he must start sending file data from the position (data , uint64_t in host byte order) received in the TOX_FILECONTROL_RESUME_BROKEN packet.
523 * 523 *
524 * More to come... 524 * More to come...
525 */ 525 */