Nick Mathewson
5ca0d6daf0
Mark many private tortls.h APIs as openssl-only.
...
This change lets us remove the openssl/ssl.h include from
test_link_handshake.c.
2017-03-31 10:04:45 -04:00
Nick Mathewson
7505f452c8
Run the copyright update script.
2017-03-15 16:13:17 -04:00
Nick Mathewson
24551d64ad
Merge branch 'maint-0.2.9'
2017-02-01 10:39:59 -05:00
rubiate
e9ec818c28
Support LibreSSL with opaque structures
...
Determining if OpenSSL structures are opaque now uses an autoconf check
instead of comparing the version number. Some definitions have been
moved to their own check as assumptions which were true for OpenSSL
with opaque structures did not hold for LibreSSL. Closes ticket 21359.
2017-02-01 10:30:49 -05:00
Nick Mathewson
61612f980d
Merge branch 'maint-0.2.9'
2016-11-06 20:24:29 -05:00
Nick Mathewson
def41e93bd
In test_tortls_classify_client_ciphers(), s/ECDH/ECDHE/
...
(We weren't actually using these ciphers; we were just requing that
ciphers of that name existed.)
Patch from rubiate. Fixes 20460
2016-11-06 20:23:40 -05:00
Nick Mathewson
0b4221f98d
Make the current time an argument to x509 cert-checking functions
...
This makes the code a bit cleaner by having more of the functions be
pure functions that don't depend on the current time.
2016-11-03 08:37:22 -04:00
Nick Mathewson
5e30e26c6d
Chop another ~93 RSA key generations out of the unit tests
...
We have a mock for our RSA key generation function, so we now wire
it to pk_generate(). This covers all the cases that were not using
pk_generate() before -- all ~93 of them.
2016-09-09 09:45:50 -04:00
Nick Mathewson
63e34e9e49
Reinstate a couple of teardown_capture_of_logs that I missed
...
Patch from rubiate. See #19999
2016-09-08 19:49:21 -04:00
Nick Mathewson
deb294ff53
Simplify log_test_helpers interface
...
Previously, you needed to store the previous log severity in a local
variable, and it wasn't clear if you were allowed to call these
functions more than once.
2016-09-08 15:03:11 -04:00
Nick Mathewson
b0a9e54705
Resolve more BUG warnings in the unit tests
2016-09-08 14:39:20 -04:00
Nick Mathewson
69dce09031
Do not call tor_tls_server_info_callback(NULL) from tests.
...
This isn't valid behavior, and it causes a crash when you run
the unit tests at --debug.
I've added an IF_BUG_ONCE() check for this case.
2016-08-31 13:18:13 -04:00
Nick Mathewson
05e2750ea7
whoops; blank line
2016-06-14 20:21:59 -04:00
Nick Mathewson
3bffdf05d1
use new-form macros to disable -Wredundant-decls
2016-06-14 12:22:52 -04:00
Nick Mathewson
df4fa92a88
Merge branch 'maint-0.2.8'
2016-06-14 12:17:24 -04:00
Yawning Angel
c5e2f7b944
Bug 19406: Fix the unit tests to work with OpenSSL 1.1.x
...
Just as it says on the tin. Don't need to fully disable any tests and
reduce coverage either. Yay me.
2016-06-14 12:13:09 -04:00
Nick Mathewson
53a3b39da1
Add -Wmissing-variable-declarations, with attendant fixes
...
This is a big-ish patch, but it's very straightforward. Under this
clang warning, we're not actually allowed to have a global variable
without a previous extern declaration for it. The cases where we
violated this rule fall into three roughly equal groups:
* Stuff that should have been static.
* Stuff that was global but where the extern was local to some
other C file.
* Stuff that was only global when built for the unit tests, that
needed a conditional extern in the headers.
The first two were IMO genuine problems; the last is a wart of how
we build tests.
2016-06-11 10:11:54 -04:00
Nick Mathewson
493499a339
Add -Wfloat-conversion for GCC >= 4.9
...
This caught quite a few minor issues in our unit tests and elsewhere
in our code.
2016-06-11 10:11:52 -04:00
Nick Mathewson
57699de005
Update the copyright year.
2016-02-27 18:48:19 +01:00
Nick Mathewson
882e0fbd76
Merge branch 'bug17795'
2016-02-23 07:25:12 -05:00
Nick Mathewson
8a4bba06d2
Rename crypto_digest_all, and digests_t.
...
They are no longer "all" digests, but only the "common" digests.
Part of 17795.
This is an automated patch I made with a couple of perl one-liners:
perl -i -pe 's/crypto_digest_all/crypto_common_digests/g;' src/*/*.[ch]
perl -i -pe 's/\bdigests_t\b/common_digests_t/g;' src/*/*.[ch]
2016-02-10 15:28:19 -05:00
Nick Mathewson
31a27729b9
Fix spaces.
2016-02-06 14:00:24 -05:00
Nick Mathewson
fa52b6f075
Make tortls unit tests pass with LibreSSL.
...
Part of the fix for 17921.
2016-02-03 11:31:57 -05:00
Nick Mathewson
27582325dc
Make Tor build happily with OpenSSL master and libressl.
...
Also tested with 1.0.0t and 1.0.2f.
Closes ticket 19784.
Closes most of 17921. (Still need to make some tests pass.)
2016-02-03 11:13:12 -05:00
teor (Tim Wilson-Brown)
e3da5ad6e3
Replace incorrect use of snprintf in unit tests with tor_snprintf
...
This avoids a potential out of bounds write.
2016-02-01 09:50:43 -05:00
teor (Tim Wilson-Brown)
f7b2ae91e9
Make all unit tests independent of log message order and count
2016-02-01 09:50:43 -05:00
Nick Mathewson
6b5b1a02d4
Fix a coverity NULL-pointer deref warning in the tortls tests.
...
Also, make our cert validation code more NULL-resistant.
This is CID 1327891.
2015-12-18 10:25:15 -05:00
Nick Mathewson
2e99371eb9
Looks like I added one X509_free too many :(
2015-12-18 10:20:14 -05:00
Nick Mathewson
2e74d182b2
Fix remaining memory leaks in unit tests.
2015-12-18 09:58:14 -05:00
Nick Mathewson
a56fb58d6e
Fix some memory leaks in the unit tests
2015-12-15 14:00:08 -05:00
Nick Mathewson
9ce431f032
Fix spaces.
2015-12-08 12:37:36 -05:00
Nick Mathewson
fe46fffd98
Fix test_tortls.c to no longer test failing crypto_rand.
...
(crypto_rand is no longer allowed to fail.)
Closes bug 17686; bug not in any released tor. (No backport, since
the tortls tests aren't in 0.2.7)
2015-11-26 09:34:44 -05:00
Nick Mathewson
d467227323
Merge remote-tracking branch 'public/ticket11150_client_only'
2015-11-13 09:58:16 -05:00
Nick Mathewson
0a3eed5f20
Merge branch 'bug17549'
2015-11-10 10:40:31 -05:00
Yawning Angel
6512df34a4
Fix the tortls.c unit tests to pass with OpenSSL 1.1.0-dev.
...
The string description for the states got changed slightly.
2015-11-06 19:42:39 +00:00
Yawning Angel
89cb2e467d
Fix compilation with OpenSSL 1.1.0 --enable-gcc-warnings is set.
2015-11-06 19:12:43 +00:00
Nick Mathewson
af80d472f7
"And now a better patch which builds the tests if LibreSSL is used."
...
Works on the latest LibreSSL (in OpenBSD-current).
(Patch from 'rubiate' on #17253 .
2015-11-06 10:58:00 -05:00
rl1987
e2f9c7d54f
Avoid crashing due to double-freeing memory.
2015-10-24 16:21:35 +03:00
Nick Mathewson
5e9f2384cf
Fix various coverity-found issues
2015-10-21 16:01:29 -04:00
Nick Mathewson
79b3c4a8a3
Yet more memory leaks closed in test_tortls
2015-10-21 14:30:34 -04:00
Nick Mathewson
13ff8e31ba
More memory leaks closed in test_tortls
2015-10-21 14:19:43 -04:00
Nick Mathewson
f5a002f69b
Fix another pile of test_tortls memory leaks
2015-10-21 14:06:13 -04:00
Nick Mathewson
eead861266
More leaks to fix.
2015-10-21 13:12:19 -04:00
Nick Mathewson
2acf72795a
resolve some leaks in test_tortls.c
2015-10-21 12:41:00 -04:00
Nick Mathewson
bd1a137893
Remove the client-side code for the v1 and v2 tls handshakes.
...
(This is safe since super-old Tor servers are no longer allowed on
the network.)
Closes the client-side part of 11150.
2015-10-07 10:04:12 -04:00
Nick Mathewson
20ec030d9b
Fix compilation with openssl 1.1 by forcibly disabling some tests
...
Some of these tests can be ported to work with openssl 1.1, but
probably some can't.
2015-10-06 09:59:47 -04:00
Nick Mathewson
94669c829c
Allow case-insensitive match in test_tortls_debug_state_callback
2015-10-06 09:40:56 -04:00
Nick Mathewson
3c67823957
Perhaps this is the permutation of headers that will please everything
2015-10-02 18:44:55 +02:00
Nick Mathewson
b31cdf4ad6
Try to fix mingw build.
2015-10-02 18:31:43 +02:00
Nick Mathewson
561d4136ac
These logs seem openssl-version-dependent
2015-10-02 17:56:10 +02:00