Commit Graph

40 Commits

Author SHA1 Message Date
Nick Mathewson
b006e3279f Merge remote branch 'origin/maint-0.2.1'
Conflicts:
	src/common/test.h
	src/or/test.c
2010-02-27 17:16:31 -05:00
Mike Perry
f4d6315afa Remove misc unnecessary newlines found by new check. 2010-02-22 16:52:11 -08:00
Mike Perry
2258125e1a Move CBT params into consensus. 2010-02-18 09:08:31 -08:00
Sebastian Hahn
01030a4db2 Another unit test for exit_policy_is_general_exit() 2010-02-09 09:10:03 +01:00
Sebastian Hahn
30b6fe6e9b Another unit test for exit_policy_is_general_exit() 2010-02-04 00:06:56 +01:00
Sebastian Hahn
82a5fbafab New unit test, testing for b0red's exit policy 2010-02-04 00:06:56 +01:00
Sebastian Hahn
b5b8d9e156 Another new test for exit_policy_is_general_exit() 2010-02-03 05:45:29 +01:00
Sebastian Hahn
c54e33e442 New testcase for exit_policy_is_general_exit 2010-02-03 05:44:05 +01:00
Nick Mathewson
df3812ede1 Rearrange _thread_test_func to please Coverity Scan
I believe  that since  we were allocating  *cp while holding  a mutex,
coverity deduced that  *cp must be protected by  that mutex, and later
flipped out  when we didn't  use it  that way. If  this is so,  we can
solve our problems by moving the *cp = tor_strdup(buf) part outside of
the mutex-protected code.
2010-01-25 14:12:37 -05:00
Nick Mathewson
0552deb613 Merge commit 'origin/maint-0.2.1'
Resolved conflicts in:
	configure.in
	src/or/Makefile.am
	src/tools/Makefile.am
2010-01-24 15:03:45 -05:00
Nick Mathewson
05a2473b7f Merge branch 'ewma' 2009-12-18 22:33:02 -05:00
Karsten Loesing
f80672d747 Remove duplicate words and a duplicate newline. 2009-12-18 12:55:05 +01:00
Nick Mathewson
235f1e1a96 Refactor out the 'find string at start of any line' logic.
We do this in too many places throughout the code; it's time to start
clamping down.

Also, refactor Karsten's patch to use strchr-then-strndup, rather than
malloc-then-strlcpy-then-strchr-then-clear.
2009-12-17 18:29:37 -05:00
Nick Mathewson
c210db0d41 Enhance pqueue so we can remove items from the middle.
This changes the pqueue API by requiring an additional int in every
structure that we store in a pqueue to hold the index of that structure
within the heap.
2009-12-12 19:06:38 -05:00
Nick Mathewson
69c0147ea6 Fix building from a separate build directory. 2009-11-08 00:38:46 -05:00
Karsten Loesing
56c2385157 Fix bug 1113.
Bridges do not use the default exit policy, but reject *:* by default.
2009-10-27 01:03:41 -07:00
Nick Mathewson
134ac8059b Fix the very noisy unit test memory leak of CID 420-421.
On any failing case in test_util_config_line, we would leak a couple
of strings.
2009-10-26 22:40:41 -04:00
Nick Mathewson
98cd8c5d16 Fix a very stupid coverity complaint (CID 416).
In its zeal to keep me from saying memset(x, '0', sizeof(x)), Coverity
disallows memset(x, 48, sizeof(x)).  Fine.  I'll choose a different
magic number, see if I care!
2009-10-26 22:40:41 -04:00
Nick Mathewson
cec698d29e Fix CID 409: check return value of base64_encode in tests 2009-10-26 22:40:41 -04:00
Karsten Loesing
d2b4b49ff0 Reduce log level for someone else sending us weak DH keys.
See task 1114. The most plausible explanation for someone sending us weak
DH keys is that they experiment with their Tor code or implement a new Tor
client. Usually, we don't care about such events, especially not on warn
level. If we really care about someone not following the Tor protocol, we
can set ProtocolWarnings to 1.
2009-10-25 23:47:05 -07:00
Nick Mathewson
bb22d8fc45 Add functions to serve microdescs and flavored consensuses. 2009-10-18 18:46:12 -04:00
Nick Mathewson
a19981725d Parse detached signatures and microdesc networkstatuses correctly. 2009-10-15 15:17:13 -04:00
Nick Mathewson
3471057486 Implement signatures for microdesc consensuses right.
This means we need to handle the existence of multiple flavors of signature
in a detached signatures document, generate them correctly, and so on.
2009-10-15 15:17:13 -04:00
Nick Mathewson
3b2fc659a8 Refactor consensus signature storage for multiple digests and flavors.
This patch introduces a new type called document_signature_t to represent the
signature of a consensus document.  Now, each consensus document can have up
to one document signature per voter per digest algorithm.  Also, each
detached-signatures document can have up to one signature per <voter,
algorithm, flavor>.
2009-10-15 15:17:13 -04:00
Nick Mathewson
e1ddee8bbe Code to generate, store, and parse microdescriptors and consensuses.
The consensus documents are not signed properly, not served, and not
exchanged yet.
2009-10-15 15:17:13 -04:00
Nick Mathewson
8d41e6c471 Support for encoding and decoding 256-bit digests in base64 2009-10-15 15:17:12 -04:00
Peter Palfrader
c4a5e06098 Ship test.h in release
The test suite need the test.h file to build. Add it to
noinst_HEADERS in the Makefile.am so it gets included
in the tarball that make dist produces.
2009-10-11 10:44:16 -04:00
Peter Palfrader
2f760c5461 Fix testsuite call.
tinytest_main() returns 0 on success, -1 on errors and 1 on test
failures.  So test.c should check on !=0 instead of <0.
2009-10-10 18:58:54 -04:00
Nick Mathewson
008dc890d8 Improved fix for test_memeq_hex leak.
The earlier fix would only handle the success case.  In the failing
case, test_mem_op does a goto done, which would leave the leak leaking.
2009-09-27 12:07:33 -04:00
Sebastian Hahn
a24b9e6088 Fix a memleak
Found by coverity

test_mem_op_hex was leaking memory, which showed up in a few
tests.

Also, the dir_param test had a memleak of its own.

Found by Coverity
2009-09-27 12:02:35 -04:00
Nick Mathewson
a4d6d83051 Make a NULL check in test_dir.c non-redundant.
Should quiet a coverity warning.
2009-09-27 12:01:29 -04:00
Nick Mathewson
5f20b0849c Do not distribute tinytest_demo.c in the tarball 2009-09-23 00:24:43 -04:00
Nick Mathewson
cb52e17d3d Carve out unrelated parts of test_dir_formats 2009-09-23 00:24:43 -04:00
Nick Mathewson
fa693118b1 Split directory tests into their own module.
(Also, clean up some whitespace.)
2009-09-23 00:24:43 -04:00
Nick Mathewson
050545405a Split test_util() into smaller functions. 2009-09-23 00:24:43 -04:00
Nick Mathewson
d9d0813809 Split general util and address tests into their own files. 2009-09-23 00:24:43 -04:00
Nick Mathewson
d2857d524c Split container tests into their own module 2009-09-23 00:24:43 -04:00
Nick Mathewson
cea1225199 Split crypto tests into a separate module. 2009-09-23 00:24:43 -04:00
Sebastian Hahn
410f31e576 Remove a warning on ./autogen.sh 2009-09-23 00:24:43 -04:00
Nick Mathewson
da1aa66f70 Move testing code into new src/test directory. 2009-09-23 00:24:43 -04:00