Commit Graph

441 Commits

Author SHA1 Message Date
Frank Denis
e1fa9cc90c Add *_messagebytes_max() wrappers 2017-08-03 13:34:31 +02:00
Frank Denis
f02770b2ad Revert "+ sodium_alloc_overhead()"
This reverts commit c5b61d8129.
2017-08-02 14:26:56 +02:00
Frank Denis
c5b61d8129 + sodium_alloc_overhead() 2017-08-02 12:34:56 +02:00
Frank Denis
774ec67e22 Repair sodium_core test 2017-07-30 18:22:53 +02:00
Frank Denis
8a14f5c167 Don't call sodium_misuse() in the sodium_core test for Javascript/wasm targets 2017-07-30 18:10:00 +02:00
Frank Denis
0ce03b6cea misuse test: just return from main() on unsupported platforms 2017-07-30 17:54:54 +02:00
Frank Denis
180a89cb21 More tests for signatures 2017-07-29 22:42:05 +02:00
Frank Denis
b34b89ab37 secrebox: add a test with in/out buffers next to each other 2017-07-29 22:27:17 +02:00
Frank Denis
ff8bb6705a More tests for scrypt 2017-07-29 22:01:13 +02:00
Frank Denis
a3f90d6020 Indent 2017-07-29 21:49:20 +02:00
Frank Denis
63d8a896fe Test KX with a weak PK 2017-07-29 21:46:14 +02:00
Frank Denis
7ad9a46cb7 More tests 2017-07-29 21:43:18 +02:00
Frank Denis
a9a21a7dff Test Ed->X conversion with x not being a square root 2017-07-29 21:36:02 +02:00
Frank Denis
982cde1a77 Test crypto_box_open_detached() with a weak PK 2017-07-29 21:34:28 +02:00
Frank Denis
c15173de1e Turn a few calls with an insane message length into a sodium_misuse() 2017-07-29 18:37:55 +02:00
Frank Denis
8d91a32754 Add more tests for crypto_sign_ed25519_pk_to_curve25519() 2017-07-24 23:56:56 +02:00
Frank Denis
214fe473f1 Add an invalid key to the signature tests 2017-07-24 23:40:14 +02:00
Frank Denis
e1b0448205 Test crypto_secretbox_open_detached() with a NULL message pointer 2017-07-24 23:17:55 +02:00
Frank Denis
c90ddae75e Use the right state type for the auth256 test 2017-07-24 23:04:23 +02:00
Frank Denis
51a0b96f1d Test crypto_hmac_sha256_update() with empty chunks 2017-07-24 22:25:33 +02:00
Frank Denis
33d6908f9b Test crypto_auth_hmacsha256_*() 2017-07-24 22:08:07 +02:00
Frank Denis
f92c82537b More tests 2017-07-24 15:16:22 +02:00
Frank Denis
b57f9668fc More tests 2017-07-21 16:52:01 +02:00
Frank Denis
8b9b6a54be Remove error string from sodium_misuse()
Returning the name of an internal function to bindings is useless.

They need way more context to recover from these errors, and
their own backtrace will be way more useful for diagnostics.
2017-07-19 00:57:19 +02:00
Frank Denis
63cbad7506 Visual Studio doesn't like abort() chains
Let's limit this test to systems this has been tested on for the
time being.
2017-07-19 00:20:06 +02:00
Frank Denis
9df008a786 Add some invalid base64 strings to pwhash_str_verify() tests 2017-07-17 23:26:36 +02:00
Frank Denis
5d56821d3d More tests, and start testing misuse cases 2017-07-17 23:09:44 +02:00
Frank Denis
0e8d7c9268 Implement sodium_set_misuse_handler() 2017-07-17 01:00:00 +02:00
Frank Denis
9def4d9a8a Add tests for crypto_kx_*() when a single key is required 2017-07-17 00:36:55 +02:00
Frank Denis
608e103e45 Finish the Argon2id tests 2017-07-16 18:34:01 +02:00
Frank Denis
ff615b270a Fix the AES test on error path 2017-07-13 21:41:06 +02:00
Frank Denis
7cfbb5922b Dont expect EFBIG to be returned if a requested allocation is too large
Some environments return funny things such as "function not implemented",
EINVAL or "permission denied" instead.

So, don't assume anything.
2017-07-12 21:36:33 +02:00
Frank Denis
28e32dd5a2 Remove scrypt from minimal builds 2017-07-11 22:08:02 +02:00
Frank Denis
f586752afe + Argon2id tests 2017-06-28 15:49:49 +02:00
Frank Denis
7334060f43 Add a workaround for old asan versions (CentOS 7) 2017-06-23 17:30:48 +02:00
Frank Denis
c3045e2cb0 Check that SIGSEGV handlers work
Tools such as ASAN may trap violations instead of our handlers,
making the sodium_utils{2,3} test fail.

This has been documented for a long time, but it's probably better
to detect this and ignore tests depending on working signal handlers.
2017-06-23 11:11:16 +02:00
Frank Denis
efb097d957 Consistency 2017-05-19 14:58:16 +02:00
Frank Denis
b28c7bcad9 Unbreak NaCl tests (parse error near '}') 2017-05-19 14:56:31 +02:00
Jim Patterson
1fd6a4bfc2 Replace which with command for portability (#542)
The `which` command is not part of the posix standard and not available
in some environments.  The `command` command is part of the posix
standard and well supported.

See https://unix.stackexchange.com/q/85249 for a discussion about the
use of `command` instead of `which`.

If a system had `libtool` but not `which`, the build process would issue
an erroneous error stating:

    libtool is required, but wasn't found on this system

Switching to `command` corrects this problem.
2017-05-19 14:51:56 +02:00
Frank Denis
3e85167657 Fix crypto_pwhash_argon2i_str_verify() and its tests after errno changes 2017-05-12 15:09:54 +02:00
Emil Bay
94760400a6 Add crypto_pwhash_MISMATCH errno (#541)
* Add crypto_pwhash_MISMATCH errno

* Use EINVAL for invalid password

* Only set errno on mismatch
2017-05-12 14:30:26 +02:00
Frank Denis
4809639ae1 box_easy2 test: increase the minimum test size 2017-04-07 07:59:13 -07:00
Frank Denis
d4dbf0cc4f Import preliminary compilation script for webassembly
Thanks to @facekapow

This still needs quite a bit of work, so don't add to the distfiles yet
2017-03-12 17:44:29 +01:00
Frank Denis
849a35bd82 + crypto_kx_*() API
This doesn't include a full key exchange API yet.
2017-03-12 13:15:39 +01:00
Frank Denis
88c77d6aa7 Do not use a zero nonce in randombytes_buf_deterministic()
This can mitigate implications of reusing the same key across different
functions.
2017-03-09 13:57:37 +01:00
Frank Denis
8679e717db + sodium_library_minimal() and SODIUM_LIBRARY_MINIMAL 2017-03-06 09:47:09 +01:00
Frank Denis
707f4c8e08 Add ed25519ph 2017-03-05 14:45:13 +01:00
Frank Denis
2ae516079b chacha20 can only be tested with a 32-bit ic 2017-03-03 10:39:03 +01:00
Frank Denis
588c03c536 C++ compat 2017-03-03 10:29:50 +01:00
Frank Denis
e46bc4c5dd Add tests for chacha&salsa with a counter around 2^32 2017-03-03 10:14:08 +01:00