Commit Graph

341 Commits

Author SHA1 Message Date
Aaron Lipinski
93b34ef9e3 move client data struct to header file 2013-08-15 12:02:56 +12:00
irungentoo
4330bfbf87 Metadata collection prevention part 1 of ???.
Crypto requests packets are packets that can be routed by nodes in the
DHT. In this pull request I have merged both Natping requests and friend
requests into one common packet (Crypto request packets). Both these
packets should now only be distinguishable by the size of the data in
them to an outside observer for an example on how to send and recieve
data with these packets see: friend_requests.c

Note that these packets are prefixed with id 32 (friend request packets)
which means this change is compatible with the currently running DHT
bootstrap servers.

Also changed small thing in DHT_test.c
2013-08-14 18:26:00 -04:00
irungentoo
a3d3d37c23 Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-08-14 10:26:27 -04:00
irungentoo
5909a13ba4 Add friend now fails if it already is in DHT. 2013-08-14 10:26:02 -04:00
irungentoo
0338c3c9e8 Merge pull request #464 from slvr/crypto-fix
Incorrect constants: s/BOXZERO/ZERO/
2013-08-14 07:10:14 -07:00
irungentoo
8eb8fb2ab5 Messenger fix from pr #461. 2013-08-14 09:52:03 -04:00
slvr
a854a730ec Reduced redundant code, added new crypto test 2013-08-14 14:46:29 +01:00
slvr
ee34b51c24 s/BOXZERO/ZERO/ 2013-08-14 14:29:39 +01:00
slvr
0b27a0cb35 Incorrect constants: s/BOXZERO/ZERO/ 2013-08-14 14:26:04 +01:00
Chris Hall
cf5ad56a4a fixing minor memory leak of friendlist 2013-08-14 17:35:15 +12:00
Chris Hall
0590d8325c removing unnecessary function pointer _isset variables 2013-08-14 17:27:10 +12:00
irungentoo
63efa44dfa Attempt to quickly fix a test. 2013-08-13 19:36:02 -04:00
irungentoo
06ccdb5b91 Simple XOR checksum added to address. 2013-08-13 19:07:59 -04:00
irungentoo
4132cdff49 clarified comment. 2013-08-13 18:30:14 -04:00
irungentoo
73163f6c98 Friend requests with different nospam fix and added saving/loading of nospam. 2013-08-13 17:25:52 -04:00
irungentoo
97f449a2f1 Fixed spam problem. (I broke the API so this will not build)
The friend address is what the byte string that you give away for people
to add you will be called.

1. Every friend address now contains a number set by the friend. This is
to prevent someone from randomly spamming people in the DHT with friend
requests and makes it so you need the person to actually give you the
address in some way to send the friend request. This number is expected
to be encrypted with the friend request. All requests that do not
contain this number will be rejected. This means the spammer can no
longer use the DHT to collect lists of valid addresses to spam. It also
enables users to quickly change the number in case a spammer gets hold
of the address and starts spamming it.

2. A 2 byte checksum will be added (not implemented yet) to prevent
people from accidentally adding random strings as friends. (NOTE that
this has nothing to do with the spam problem I just decided to add a
placeholder for it now.)
2013-08-13 09:32:31 -04:00
irungentoo
cb4f67b37a Merge pull request #441 from slvr/timer
Timer Subsystem
2013-08-13 04:14:01 -07:00
slvr
471c148090 Portabily print out uint64_t using PRIu64 2013-08-13 09:55:49 +01:00
slvr
9e3f48c165 Removed core/Messenger.c.orig
Cleanup from merge conflict.
2013-08-13 09:51:18 +01:00
slvr
4bfeb2f483 timer_new -> new_timer and timer_delete -> delete_timer to avoid name conflict 2013-08-13 09:45:11 +01:00
Andreas Schneider
6b06431e9b core: Fix a possible buffer overflow using getself_name().
If the passed buffer is smaller than MAX_NAME_LENGTH then, you
will probably overflow it.
2013-08-13 09:50:51 +02:00
slvr
a0c6296d6c Resolve Merge Conflict 2013-08-12 23:47:15 +01:00
slvr
be840b46b9 Merge remote-tracking branch 'upstream/master' into timer
Conflicts:
	core/Messenger.c
2013-08-12 23:08:48 +01:00
slvr
a56d87cd3f remember to call timer_poll 2013-08-12 14:54:40 +01:00
slvr
c6b496d85b Messenger Timer 2013-08-12 14:44:59 +01:00
slvr
f3511db29b Added LAN discovery timer 2013-08-12 14:19:25 +01:00
alek900
8d3e68b74d Added support for userdata in callbacks 2013-08-12 14:23:46 +02:00
slvr
1a39c397c5 Implemented Deadline Timer and timer_test 2013-08-12 13:08:03 +01:00
Chris Hall
4293c4b1e6 Messenger refactor - redid work from pull request 79
Moves static state out of Messenger.c and into a Messenger struct
Purely stylistic, no functional changes were made.

This commit also changed all the callers of Messenger as they now have
to pass an instance of the Messenger struct to messenger functions.

Also removed some uses of the 'static' keyword at the beginning of
function definitions when the function was already declared static, as
these caused gcc to whine.
2013-08-12 21:37:38 +12:00
alek900
ed3b036862 Send our current status and name to friend that just came online.
Our username and status might have changed while our friend was offline.
2013-08-11 23:10:12 +02:00
Maxim Biro
e427197580 Fixed a mistake 2013-08-11 16:56:02 -04:00
Maxim Biro
ee95bf08af Fixed a typo 2013-08-11 16:52:43 -04:00
Maxim Biro
eaa7d3e0a0 Replaced friendstatus with connectionstatus 2013-08-11 14:57:47 -04:00
Maxim Biro
440871bda1 Fixed warnings on Windows 2013-08-11 14:17:02 -04:00
irungentoo
3a2d453165 Merge pull request #429 from dparnell/pristine
Fixed m_sendmessage to return the ID of the message sent
2013-08-11 06:59:26 -07:00
irungentoo
31bf4aece7 Merge pull request #427 from Alek900/master
m_addfriend triggerd m_callback_friendstatus with a friendid thats not yet returned from m_addfriend
2013-08-11 06:28:35 -07:00
Daniel Parnell
6c0db66a01 Fixed m_sendmessage to return the ID of the message sent 2013-08-11 22:15:07 +10:00
alek900
851c52571f m_addfriend triggerd m_callback_friendstatus with a friendid thats not returned yet from m_addfriend 2013-08-11 13:02:02 +02:00
irungentoo
8e05bcb5f9 Merge pull request #422 from slvr/crypto-speed-boost
Cryptography speed boost
2013-08-10 16:20:54 -07:00
irungentoo
e37fd0c607 That define doesn't belong here. 2013-08-10 19:04:00 -04:00
slvr
5b6465528f handle_ping_response function signature correction 2013-08-10 19:55:54 +01:00
slvr
da8ef89e9d Merge remote-tracking branch 'upstream/master' into pr 2013-08-10 19:20:56 +01:00
slvr
a5f34764d2 Ensure encrypt_precompute is called when status == CONN_ESTABLISHED 2013-08-10 18:46:11 +01:00
slvr
021852d494 Implemented encrypt_data_fast, decrypt_data_fast and crypto tests 2013-08-10 17:41:32 +01:00
slvr
7f27fcaf37 tabs -> spaces 2013-08-10 11:27:36 +01:00
slvr
8f6f8e221d networking_poll: receivepacket(&ip_port, data, &length) == -1 2013-08-10 03:02:00 +01:00
irungentoo
341de59bb6 Fixed possible bug. 2013-08-09 20:32:51 -04:00
slvr
da01bafc83 core/substrate.h wasn't supposed to be here 2013-08-10 01:08:18 +01:00
slvr
75c2dd4cb9 fixed typo: handle_ping_request -> handle_ping_response 2013-08-10 01:03:30 +01:00
slvr
951dbc1258 Updated initMessenger 2013-08-10 00:54:43 +01:00