summaryrefslogtreecommitdiff
path: root/auto_tests/encryptsave_test.c
AgeCommit message (Collapse)Author
2018-02-24Fix a bunch of compiler warnings and remove suppressions.iphydf
2018-02-18Disable lan discovery in most tests.iphydf
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2017-12-29Change toxencryptsave API to never overwrite pass keys.iphydf
2017-06-05Build tests on appveyor, the MSVC build.iphydf
Tests are not actually ran on appveyor for now, since they all fault for some reason. For now, we just build them. Also, some tests are disabled on msvc entirely, because they don't even compile. We'll need to look into those, later. They are disabled using `MSVC_DONT_BUILD`.
2017-01-28Add VLA compatibility macro for C89-ish compilers.iphydf
2016-12-22Use `tox_options_set_*` instead of direct member access.iphydf
Also added a `tox_options_copy` function for cloning an options object. This can be useful when creating several Tox instances with slightly varying options.
2016-12-22Wrap all sodium/nacl functions in crypto_core.c.iphydf
2016-12-13Add apidsl file for toxencryptsave.iphydf
This breaks the toxencryptsave API. It hides the Tox_Pass_Key struct definition.
2016-11-06Move log callback to options.iphydf
Previously, all log messages generated by tox_new (which is quite a lot) were dropped, because client code had no chance to register a logging callback, yet. This change allows setting the log callback from the beginning and removes the ability to unset it. Since the log callback is forever special, since it can't be stateless, we don't necessarily need to treat it uniformly (with `event`).
2016-09-30Remove return after no-return situation (and other cleanups).iphydf
Cleanups: - Fix header guards to not use reserved names. - Avoid name shadowing. - Removed an unused variable found by avoiding name shadowing.
2016-09-24Minor cleanups: unused vars, unreachable code, static globals.iphydf
- All global variables should be static unless they have an explicit extern declaration in a header file. - `to_compare` was not used in encryptsave and toxav tests. - `break` in switch cases is not required directly after `return`, `goto`, or a noreturn function like `abort`.
2016-09-06Improve static and const correctness.iphydf
- Any non-externally-visible declarations should be `static`. - Casting away the `const` qualifier from pointers-to-const is dangerous. All but one instance of this are now correct. The one instance where we can't keep `const` is one where toxav code actually writes to a chunk of memory marked as `const`. This code also assumes 4 byte alignment of data packets. I don't know whether that is a valid assumption, but it's likely unportable, and *not* obviously correct. - Replaced empty parameter lists with `(void)` to avoid passing parameters to it. Empty parameter lists are old style declarations for unknown number and type of arguments. - Commented out (as `#if DHT_HARDENING` block) the hardening code that was never executed. - Minor style fix: don't use `default` in enum-switches unless the number of enumerators in the default case is very large. In this case, it was 2, so we want to list them both explicitly to be warned about missing one if we add one in the future. - Removed the only two function declarations from nTox.h and put them into nTox.c. They are not used outside and nTox is not a library.
2016-09-06Make friend requests statelessGregory Mullen (grayhatter)
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-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-18Fix some compiler warnings.iphydf
2016-08-10Silence/fix some compiler warnings.iphydf
Some of these (like the incompatible pointers one) are really annoying for later refactoring.
2016-01-30Fixes.irungentoo
Fixed bug from merged PR. Don't build useless files when building with libsodium.
2015-05-27Allow empty keys in toxencryptsave.irungentoo
2015-05-22Move savedata to options struct.irungentoo
Add a way to select the type of savedata (normal savedata, load a secret key, potentially others?) to load.
2015-03-31Make keys into a struct for more programmer safetyDubslow
2015-03-31Fix minor code duplicationDubslow
2015-03-31Merge branch 'master' of https://github.com/dubslow/toxcoreirungentoo
2015-03-31Fix toxencryptsave to be consistent with new_apiDubslow
Upon my own decision, the two tox_encryped_new convenience functions were removed due to basically needing two different sets of error codes. At iphydf's suggestion the corresponding tox_get_encrypted_savedata convenience functions were removed as well.
2015-03-26Making tox_encrypted_new() use the same error codes as tox_new was a bad idea.irungentoo
They now have their own error codes.
2015-03-01Properly fixed encryptsave_test.cirungentoo
2015-02-28Update encryption autotestDubslow
2015-02-08Fixed test.irungentoo
2014-11-25Astyle autotests.irungentoo
2014-10-23fix #1124 by adding salt manip functionsdubslow
Also, all data now has the magic number prepended. This is incompatible for all but the save/load functions, but I think nothing besides the one experimental qTox branch used any of those, which is why I feel confident about the change.
2014-10-17add new test cases, cleanup astray printfdubslow
2014-10-17add load/save from key instead of pwdubslow
2014-10-08refactor toxencryptedsave to allow passphrase encryption of arbitrary datadubslow
also a minor API change for clarity
2014-10-07fix #1104dubslow
2014-09-11memzero() segfaulted for unknown reasons... probably pebkac...Dubslow
2014-09-11testing works, but doesn't pass...Dubslow