Commit Graph

198 Commits (ed3a794c9bf6380801ee21c816505f457b6a1348)

Author SHA1 Message Date
Roman Proskuryakov ed3a794c9b fix: compare sensitive data with sodium_memcmp
fix: make increment_nonce & increment_nonce_number independent of user-controlled input
	fix: make crypto_core more stable agains null ptr dereference
2016-01-27 02:14:59 +03:00
irungentoo 6d883f488f
Return error if file_id parameter is NULL. 2015-06-03 19:56:12 -04:00
irungentoo 240561b557 Return port error if tcp server failed to init. 2015-05-30 21:06:38 -04:00
irungentoo 8e80ced6ce
Move savedata to options struct.
Add a way to select the type of savedata (normal savedata, load a
secret key, potentially others?) to load.
2015-05-22 18:23:56 -04:00
irungentoo 53c6b26a7e
Connect to own TCP server if hosting one.
Removed useless code.
2015-05-12 20:59:28 -04:00
irungentoo 478552d338
Fixes and changes to tox_bootstrap and tox_add_tcp_relay.
Functionality of both no longer overlaps.

If address has more than 1 ip, call the internal function on all of them.
2015-05-11 12:41:53 -04:00
irungentoo 3a28a8c5fb
Added basic TCP server hosting to tox.h api.
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
2015-05-08 22:03:24 -04:00
irungentoo 3c87c84223
tox_hash fix. 2015-04-09 09:50:24 -04:00
Jfreegman 856fb583ed
API function to get last seen timestamp of friend
also removed remnants of the no longer used variable ping_lastrecv
2015-04-02 21:53:24 -04:00
Roman Pasichnyk 7d061e8d57 If length is 0, data should be ignored. 2015-03-25 08:41:01 +01:00
irungentoo b0983104d5
Renamed tox_file_send_control to tox_file_control.
Renamed tox_file_send_seek to tox_file_seek.
2015-03-21 08:58:54 -04:00
irungentoo 8c2347222a
Transfers with filelength == 0 now behave exactly like transfers of every
other size (except streaming of course).
2015-03-21 08:35:31 -04:00
irungentoo f2a017c055
Allow sending of file transfer requests with length 0 but don't allocate
any file number for them in core.

These can be used to tell friends we don't have an avatar set or to unset
a set avatar.
2015-03-20 21:15:44 -04:00
Dubslow d8da9bf709
callback_file_request_chunk -> callback_file_chunk_request
A couple of minor reasons, combined warrant a PR imo:
a) fileChunkRequested is a better signal name than fileRequestChunkReceived, and I don't want to break consistency by reordering words for just this signal
b) "request chunk" is parsed by English speakers as a verb-object combination,
   implying sending the request, not receiving, whereas "chunk requested" is
   parsed (more correctly) as an adjective-noun combo (in particular, request is
   a noun not a verb), and thus reads far more like "hey heads up we just got a request"

For instance some tests/testing code had some callbacks to *receive* chunk requests, and they were called "tox_file_request_chunk"... to receive a chunk, not request it. Now they're called "tox_file_chunk_request".

So yeah...
2015-03-19 08:38:27 -05:00
irungentoo 45cf8a744c
Merge branch 'one_more_rename' of https://github.com/dubslow/toxcore into new_api 2015-03-18 16:15:36 -04:00
irungentoo dc60d98ff1
Removed TOX_USER_STATUS_INVALID. 2015-03-18 15:47:09 -04:00
irungentoo d711362622
Merged normal message function and send action function into one
messaging function.

This removes code duplication and allows us to easily add new message
types to the api without having to add new functions.
2015-03-18 15:32:53 -04:00
Dubslow 2f65de6fd1
Move get_connection_status to self pseudonamespace, to contrast friend_get_connection_status 2015-03-18 14:18:36 -05:00
irungentoo 5b7cbc8956
Api changes.
receive to recv in file receive functions.

Added TOX_MAX_FILENAME_LENGTH define.
2015-03-18 12:54:00 -04:00
irungentoo 0beaa2fdb4
Renamed SEND_FAILED to SENDQ. 2015-03-17 17:13:25 -04:00
irungentoo 8286c2c22f
Save function renamed to tox_get_savedata() 2015-03-17 16:20:38 -04:00
irungentoo 67f6d0857a
Make sure some defines in the public api are always correct.
Make sure some assumptions are always correct.
2015-03-17 16:02:46 -04:00
irungentoo e778bfb42f
Changed INVALID_LENGTH to TOO_LONG. 2015-03-17 16:00:03 -04:00
irungentoo ea8d27259f
Added tox_file_send_seek() function to api.
This function can be used to seek an incoming file tranfer right
before accepting it.

It is meant to be used to resume incomplete file tranfers by clients.
2015-03-17 15:05:17 -04:00
irungentoo e072079620
Allow file names to be of length 0.
Pointer in callback will be NULL if length is 0.
2015-03-17 13:47:09 -04:00
irungentoo 24c70c9e84
Added and implemented file_id parameter to file tranfers.
file_id is a 32byte identifier that can be used by users to identify
file tranfers across core/client restarts in order to resume broken
file tranfers.

In avatar tranfers it corresponds to the hash of the avatar.

Added tox_file_get_file_id() function to api to obtain the file_id
of an ongoing file transfer.

If not set, core will generate a random one.
2015-03-17 13:44:48 -04:00
iphydf fa7c21f95c New API fixups. 2015-03-16 13:12:25 +00:00
irungentoo 08585e5b60
Merge branch 'new_api_patch' of https://github.com/Impyy/toxcore into new_api 2015-03-15 18:41:00 -04:00
irungentoo ec659491b2
Avatar hash is now the filename of the file transfer instead of the
first 32 bytes.

Enforce length of filename in core when transfer is an avatar type
transfer to make things more safe.
2015-03-15 18:35:22 -04:00
Impyy 409897f7ae Initialize Tox_Options with default values in tox_options_new 2015-03-15 12:47:59 +01:00
irungentoo 8e2957ec50
Merge branch 'newer_api' of https://github.com/dubslow/toxcore into new_api 2015-03-13 15:29:34 -04:00
Dubslow 64fefb6f43
revert to TOX_FILE_KIND 2015-03-13 12:34:14 -05:00
irungentoo 96d9cef66c
File kind is now a uint32_t.
This allows clients to agree on what numbers mean what without having
it be set in core.
2015-03-13 13:00:35 -04:00
irungentoo 669975c226
tox_file_send_chunk() must now send data the same length as requested
in the requested chunk callback.

For zero size transfers if the data sent is not the same length, the
file is assumed to be done.
2015-03-13 12:40:21 -04:00
irungentoo eec1042695
tox_friend_get_public_key() now does nothing when public_key is NULL. 2015-03-13 08:36:07 -04:00
Dubslow 3bf259f69d Convert core code depending on the api 2015-03-12 18:23:14 -05:00
irungentoo 8dc2db2025
Added position parameter to tox_file_send_chunk().
This is done so that the function now has the same parameters as the
request chunk callback.
2015-03-12 15:17:34 -04:00
irungentoo 28d707662b
Fixed tox_new issue. 2015-03-12 13:11:28 -04:00
irungentoo 7afab000f7
tox_new now sets error to TOX_ERR_NEW_PORT_ALLOC when binding to port fails. 2015-03-12 13:03:14 -04:00
irungentoo 4ee017078b
tox_new() fixes.
If data is NULL and length non zero, TOX_ERR_NEW_NULL is set.

error is set to TOX_ERR_NEW_LOAD_BAD_FORMAT when load fails.
2015-03-12 12:19:59 -04:00
Dubslow 91274495bc
This is a combination of 11 commits.
The first commit's message is:
TOX_STATUS -> TOX_USER_STATUS, is more specific

  This is the 2nd commit message:

I pretty strongly believe tox_iteration needs to be renamed to a verb

There are several other noun functions in the API, but none of them *do* things.
I think even tox_do is better than tox_iteration.

tox_do_interval is one possibility, but I'm open to suggestions.

  This is the 3rd commit message:

private_key -> secret_key

This is more consistent with modern/NaCl/elliptic cryptography, and also "pk", meaning public key, is all over other toxcore code and documentation. This will eliminate ambiguity.

  This is the 4th commit message:

Rename some functions for pseudo-namespace consistency

The enum change results in long enum types, but I think consistency trumps
having a few less characters.

  This is the 5th commit message:

TOX_FILE_KIND -> TOX_FILE_TYPE

This is more of an English thing than a consistency thing, but
TOX_FILE_KIND sounds funnier/stranger to me than TOX_FILE_TYPE.

  This is the 6th commit message:

More specific file control function names

  This is the 7th commit message:

Rename custom packet functions for pseudo-namespace consistency

This also has the issue with long enums... but I still think consistent enum names are better

  This is the 8th commit message:

Rename functions for pseudo-namespace consistency

  This is the 9th commit message:

Consistency with https://github.com/sonOfRa/tox4j/blob/master/doc/core-design.md#naming-conventions and the rest of the api

  This is the 10th commit message:

Fix errors in previous function rename commits

  This is the 11th commit message:

Shorten one error enum name
2015-03-11 17:09:06 -05:00
irungentoo 43fe6e71bd
tox_callback_connection_status() implemented.
Attempted fix of connection checking to make it more stable.
2015-03-11 15:37:25 -04:00
irungentoo 572484f06e
Use .h for tox_old instead of .c to not break some of my build commands. 2015-03-11 13:51:11 -04:00
irungentoo 88a8a079b6
Implemented the 3 low level network information functions.
Added tox_get_udp_port() to tests.
2015-03-11 08:09:45 -04:00
irungentoo 916b6aa734
Added group chat functions to the public api.
Since the functions are not new api like I put them in tox_old.{c,h}
2015-03-10 18:54:01 -04:00
irungentoo 0207fcdfb0
Implementation of new api file transfers.
Everything should work except resuming.
2015-03-10 17:31:50 -04:00
saneki 6e8762b30a Allow for specifying the port range to use in Tox_Options 2015-02-27 11:58:00 -06:00
irungentoo c5b03cdd9a
Implemented custom packet functions in new api. 2015-02-26 13:17:22 -05:00
irungentoo 837d4698bb
Fixed bug. 2015-02-25 19:50:18 -05:00
irungentoo ca21569a9d
Implemented callbacks. 2015-02-20 18:17:32 -05:00