aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2015-11-25Merge branch 'bug17686_v2_027'Nick Mathewson
2015-11-25Now that crypto_rand() cannot fail, it should return void.Nick Mathewson
2015-11-25Add crypto-initializer functions to those whose return values must be checkedNick Mathewson
2015-11-25Make crypto_seed_rng() and crypto_rand() less scary.Nick Mathewson
These functions must really never fail; so have crypto_rand() assert that it's working okay, and have crypto_seed_rng() demand that callers check its return value. Also have crypto_seed_rng() check RAND_status() before returning.
2015-11-25fixup! Add controller getinfo exit-policy/reject-privateteor (Tim Wilson-Brown)
Stop ignoring ExitPolicyRejectPrivate in getinfo exit-policy/reject-private. Fix a memory leak. Set ExitPolicyRejectPrivate in the unit tests, and make a mock function declaration static.
2015-11-25Initialize libevent before periodic eventscypherpunks
The initialization of libevent interferes with other tests so we also fork the circuit_timeout test.
2015-11-25fixup! Block OutboundBindAddressIPv[4|6]_ and configured ports on exit relaysteor (Tim Wilson-Brown)
Fix unit tests for get_interface_address6_list to assume less about the interface addresses on the system. Instead, mock get_interface_address6_list and use the mocked function to provide a range of address combinations.
2015-11-25Merge remote-tracking branch 'gtank/feature17663'Nick Mathewson
2015-11-24add SHA512 support to cryptoGeorge Tankersley
2015-11-24Use SHA256 in the replaycache, rather than SHA1teor (Tim Wilson-Brown)
This migrates away from SHA1, and provides further hash flooding protection on top of the randomised siphash implementation. Add unit tests to make sure that different inputs don't have the same hash.
2015-11-20fix "make check-spaces"Nick Mathewson
2015-11-20Fix compilation warningsNick Mathewson
2015-11-20Merge branch 'getinfo-private-exitpolicy-v4-squashed'Nick Mathewson
2015-11-20Add controller getinfo exit-policy/reject-privateteor (Tim Wilson-Brown)
exit-policy/reject-private lists the reject rules added by ExitPolicyRejectPrivate. This makes it easier for stem to display exit policies. Add unit tests for getinfo exit-policy/*. Completes ticket #17183. Patch by "teor".
2015-11-20Block OutboundBindAddressIPv[4|6]_ and configured ports on exit relaysteor (Tim Wilson-Brown)
Modify policies_parse_exit_policy_reject_private so it also blocks the addresses configured for OutboundBindAddressIPv4_ and OutboundBindAddressIPv6_, and any publicly routable port addresses on exit relays. Add and update unit tests for these functions.
2015-11-20Add unit tests for policies_parse_exit_policy_reject_privateteor (Tim Wilson-Brown)
Test that policies_parse_exit_policy_reject_private rejects supplied IPv4 and IPv6 relay addresses, and the addresses of local interfaces.
2015-11-19Merge remote-tracking branch 'teor/bug17632-no-ipv4-no-localhost-squashed'Nick Mathewson
2015-11-19Fixup #17638: ignore EINVAL from FreeBSD jails without ::1teor (Tim Wilson-Brown)
In my testing, an IPv6-only FreeBSD jail without ::1 returned EINVAL from tor_ersatz_socketpair. Let's not fail the unit test because of this - it would only ever use tor_socketpair() anyway.
2015-11-19Make tor_ersatz_socketpair work on IPv6-only systemsteor (Tim Wilson-Brown)
(But it won't work on some systems without IPv4/IPv6 localhost (some BSD jails) by design, to avoid creating sockets on routable IP addresses. However, those systems likely have the AF_UNIX socketpair, which tor prefers.) Fixes bug #17638; bugfix on a very early tor version, earlier than 22dba27d8dd5 (23 Nov 2004) / svn:r2943. Patch by "teor".
2015-11-18Merge remote-tracking branch 'teor/bug17632-no-ipv4-no-localhost'Nick Mathewson
2015-11-19Fix unit tests on systems without IPv4 or localhost addressesteor (Tim Wilson-Brown)
Make unit tests pass on IPv6-only systems, and systems without localhost addresses (like some FreeBSD jails). Fixes: * get_if_addrs_ifaddrs: systems without localhost * get_if_addrs_ioctl: only works on IPv4 systems * socket: check IPv4 and IPv6, skip on EPROTONOSUPPORT * socketpair_ersatz: uses IPv4, skip on EPROTONOSUPPORT Fixes bug #17632; bugfix on unit tests in 0.2.7.3-rc. c464a367728d was a partial fix for this issue in #17255; it was released in unit tests in 0.2.7.4-rc. Patch by "teor".
2015-11-19Really Really Fixup 86eba14ac549: Windows support, error return valuesteor (Tim Wilson-Brown)
2015-11-18Really Fixup 86eba14ac549: error return values are negativeteor (Tim Wilson-Brown)
2015-11-18Fixup 86eba14ac549: add errno.h for EPROTONOSUPPORTteor (Tim Wilson-Brown)
2015-11-18Fix unit tests on systems without IPv4 or localhost addressesteor (Tim Wilson-Brown)
Make unit tests pass on IPv6-only systems, and systems without localhost addresses (like some FreeBSD jails). Fixes: * get_if_addrs_ifaddrs: systems without localhost * get_if_addrs_ioctl: only works on IPv4 systems * socket: check IPv4 and IPv6, skip on EPROTONOSUPPORT * socketpair_ersatz: uses IPv4, skip on EPROTONOSUPPORT Fixes bug #17632; bugfix on unit tests in 0.2.7.3-rc. c464a367728d was a partial fix for this issue in #17255; it was released in unit tests in 0.2.7.4-rc. Patch by "teor".
2015-11-17Some unit tests now require that periodic events be initialized.Nick Mathewson
2015-11-13Merge remote-tracking branch 'public/ticket11150_client_only'Nick Mathewson
2015-11-12Merge branch 'karsten_bug13192_026_03_teor'Nick Mathewson
2015-11-12Rename cast_double_to_int64 to clamp_double_to_int64Nick Mathewson
2015-11-12Make round_to_next_multiple_of always round upwards.Nick Mathewson
Yes, even if it has to return a non-multiple. This prevents us from ever having a bug where we try to use it for allocation, and under-allocate.
2015-11-10Merge branch 'bug17549'Nick Mathewson
2015-11-06Fix the tortls.c unit tests to pass with OpenSSL 1.1.0-dev.Yawning Angel
The string description for the states got changed slightly.
2015-11-06Fix compilation with OpenSSL 1.1.0 --enable-gcc-warnings is set.Yawning Angel
2015-11-06"And now a better patch which builds the tests if LibreSSL is used."Nick Mathewson
Works on the latest LibreSSL (in OpenBSD-current). (Patch from 'rubiate' on #17253.
2015-10-30Merge remote-tracking branch 'rl1987/ticket16831_part2_rebased'Nick Mathewson
2015-10-29Fix GCC warnings.rl1987
2015-10-26Merge remote-tracking branch 'rl1987/bug17417_take2'Nick Mathewson
2015-10-24Avoid crashing due to double-freeing memory.rl1987
2015-10-24Seventh test case for dns_resolve_impl().rl1987
2015-10-24Sixth test case for dns_resolve_impl.rl1987
2015-10-24Add a fifth unit test.rl1987
2015-10-24Whitespace fixes.rl1987
2015-10-24Add a fourth test case.rl1987
2015-10-24Third test case for dns_resolve_impl.rl1987
2015-10-24A second test case for dns_resolve_impl.rl1987
2015-10-24Making it slightly cleaner.rl1987
2015-10-24First test case for dns_resolve_impl().rl1987
2015-10-24Using namespace macros for mock functions in test_dns.crl1987
2015-10-24Use NS_SUBMODULEs in test_dns.crl1987
2015-10-22Compilation was off by one characterNick Mathewson