Commit Graph

44 Commits

Author SHA1 Message Date
iphydf
074051078d
chore: Make all top level comments doxygen style /**.
This allows tokstyle to match them between header and source.
2022-02-04 22:43:02 +00:00
iphydf
aa64ecc34e
cleanup: Sync comments in all toxcore/*.[ch]. 2021-12-22 10:48:53 +00:00
iphydf
f49168e209
chore: Make all function comments doxygen style /** comments.
This way, they become eligible for the tokstyle comment sync check.
2021-12-22 10:48:53 +00:00
iphydf
fd32c87707
cleanup: Don't include "config.h" unless needed.
Currently only `crypto_core_mem.c` needs this. We should try not to
depend on configure'd values. Also note: config.h is only created and
used in the autotools build. In CMake, we pass `-D` flags directly.
2021-12-12 22:18:38 +00:00
iphydf
11ad5471b9
Use spdx license identifier instead of GPL blurb. 2020-03-14 13:06:19 +00:00
iphydf
473cde24d8
Update copyright to 2018. 2018-08-26 18:57:29 +00:00
iphydf
76e1d05da6
Use named function types for friend_requests callbacks.
Also:
* `#define` must be scoped. If it's used outside a scope, it must be
  defined outside that scope (global `#define` does not need a matching
  `#undef`).
2018-07-08 22:02:52 +00:00
iphydf
be797d4b03
Move system header includes from network.h to network.c 2018-05-20 15:42:42 +00:00
iphydf
3f73dfa7f1
Use const more in C code. 2018-02-18 13:01:16 +00:00
iphydf
d8fcac5b4f
Make Friend_Requests a module-private type. 2018-01-14 16:16:30 +00:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
iphydf
8f96ca6d86
Update license headers and remove redundant file name comment.
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
2017-01-19 00:01:44 +00:00
iphydf
ce29c8e7ec
Wrap all sodium/nacl functions in crypto_core.c. 2016-12-22 10:26:59 +00:00
iphydf
15cb426166
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
2016-09-24 21:53:50 +01:00
iphydf
0aa2840164
Group #include directives in 3-4 groups.
1. Current module (if C file).
2. Headers from current library.
3. Headers from other library (e.g. toxcore includes in toxav).
4. System headers.
2016-09-13 00:32:02 +01:00
Gregory Mullen (grayhatter)
aad1e0ad3f
Make friend requests stateless
Messenger is slightly twisty when it comes to sending connection status
callbacks It will very likely need at the very least a partial refactor to
clean it up a bit. Toxcore shouldn't need void *userdata as deep as is
currently does.

(amend 1) Because of the nature of toxcore connection callbacks, I decided to
change this commit from statelessness for connections changes to statelessness
for friend requests. It's simpler this was and doesn't include doing anything
foolish in the time between commits.

group fixup because grayhatter doesn't want to do it

"arguably correct" is not how you write security sensitive code

Clear a compiler warning about types within a function.
2016-09-06 02:22:04 -07:00
iphydf
633da98ae6
Add braces to all if statements. 2016-08-31 20:04:16 +01:00
Roman Proskuryakov
23b0c9cded fix: replace memset with sodium_memzero for sensitive data 2016-01-27 02:17:40 +03:00
irungentoo
c6a59e64b7
Updated types in Messenger callbacks to fit with the ones in the new api.
Friend number changed from int32_t to uint32_t.
Some lengths changed to size_t.
2015-02-17 15:49:22 -05:00
irungentoo
b83ff00c27
Code cleanups. 2015-01-28 20:48:07 -05:00
irungentoo
6bbb939855
Cleaned up packet length types in toxcore.
They are now all uint16_t instead of sometimes being uint32_t.

Replaced some other uint32_t with unsigned ints.
2014-11-21 20:18:29 -05:00
irungentoo
5555f01e27
Send friend request with connection if for some reason (groupchats) we
are already connected to the friend but they have not added us yet.
2014-10-04 16:49:17 -04:00
irungentoo
750c75a47d
Astyled code. 2014-06-15 10:36:57 -04:00
Marc Schütz
920a87be35 Const correctness in toxcore/friend_requests.c 2014-06-13 22:18:37 +02:00
irungentoo
07936960df
Astyle and fixes. 2014-06-10 18:35:55 -04:00
Marc Schütz
99d5940140 Const correctness in various interdependent files 2014-06-10 20:54:48 +02:00
irungentoo
384750af8c
Major cleanups.
Fixed circular dependency between DHT and net_crypto: DHT no longer
depends on net_crypto.

Moved the crypto request packets functions to crypto core and DHT.

Cleaned up/added some defines that can be used to get the true maximum
length of things like the friends request message.

MAX_DATA_SIZE has been replaced in most places by more appropriate defines.
2014-04-23 11:35:40 -04:00
irungentoo
09d9d34a93
Removed deprecated function from public api.
Added upper length check to friendreq_handlepacket().
2014-04-19 17:50:10 -04:00
irungentoo
8815956f0a Small cleanups. 2014-04-19 16:52:29 -04:00
irungentoo
235ce56855
Fixed possible buffer overflow in function to send friend requests. 2014-04-19 16:18:07 -04:00
irungentoo
04001b2ec3 Friends client id is now removed from the request received list when he is deleted. 2014-03-21 19:27:17 -04:00
irungentoo
5babb281c0 Friend request callback now contains the Tox object. 2014-03-16 13:24:39 -04:00
irungentoo
f3becc62e8 Strings now no longer need to be NULL terminated. 2014-02-23 10:23:55 -05:00
irungentoo
704c27c66c All strings should now be forced terminated when received. 2014-02-12 13:14:25 -05:00
irungentoo
cd2474a2f6 Incorporated onion into Tox.
Fixed a couple of issues related to that.
2014-01-17 13:35:40 -05:00
irungentoo
74b13a9fcf Friend requests from friends are now discarded. 2013-11-27 14:18:39 -05:00
Coren[m]
0a4c3d7e2e Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*
unix_time():
- returns local value for current epoch
- value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT()

is_timeout():
- uses the local value for current epoch

id_cpy()/id_eq() => id_copy()/id_equal():
- centralized duplicate definitions
- replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
2013-10-24 22:32:28 +02:00
Coren[m]
bcb283cf45 big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6 2013-09-10 16:36:20 +02:00
Coren[m]
a128e3ff8f network.h:
- global: added sock_t
- Networking_Core: added family (currently always AF_INET) and port
- sendpacket(): changed signature to require (Networking_Core *) instead of sock_t

*.c:
- sendpacket()-calls: replaced *->net->sock with *->net
2013-09-09 13:56:03 +02:00
Jin^eLD
e092eee869 Allow to build vs nacl instead of libsodium
By default libsodium is used. Only if --enable-nacl is specified, then
nacl will be used instead of libsodium.

Pass locations of nacl headers and libraries by using the following
options:

--with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/
--with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-06 22:54:45 +03:00
JamoBox
433cc9c8b2 Even more comment updates. 2013-09-02 13:41:43 +01:00
Kostya
25563ac070 Fixed build errors. 2013-08-30 03:28:50 -04:00
pete
82b8927af7 Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard. 2013-08-29 22:17:51 +01:00
jin-eld
e658892793 Rename core directory because of autoconf name clash
While doing the checks configure might generate "core" files and will
then try to remove them. Having a "core" directory generates an error
while runing the configure script.

There's no workaround but to rename the core directory.
2013-08-24 03:25:07 +03:00