summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2015-10-02Make test_tortls compile without warningsNick Mathewson
2015-10-02Merge remote-tracking branch 'twstrike/tortls_tests'Nick Mathewson
2015-10-02Fix check-spaces complaintsNick Mathewson
2015-10-02Merge remote-tracking branch 'sebastian/bug17026'Nick Mathewson
2015-10-02Clean up compat_libevent testsNick Mathewson
2015-10-02Merge remote-tracking branch 'twstrike/compat_libevent_tests'Nick Mathewson
2015-09-30Document syslog_identity_tag for add_syslog_logPeter Palfrader
2015-09-30Add SyslogIdentityTagPeter Palfrader
When logging to syslog, allow a tag to be added to the syslog identity ("Tor"), i.e. the string prepended to every log message. The tag can be configured by setting SyslogIdentityTag and defaults to none. Setting it to "foo" will cause logs to be tagged as "Tor-foo". Closes: #17194.
2015-09-29Add checks and unit tests for get_interface_address* failureteor (Tim Wilson-Brown)
Ensure that either a valid address is returned in address pointers, or that the address data is zeroed on error. Ensure that free_interface_address6_list handles NULL lists. Add unit tests for get_interface_address* failure cases. Fixes bug #17173. Patch by fk/teor, not in any released version of tor.
2015-09-29get_interface_address6_list(): Bring back a return code checkFabian Keil
... that was removed by 31eb486c46 which first appeared in 0.2.7.3-rc. If tor is running in a ElectroBSD (or FreeBSD) jail it can't get any IP addresses that aren't assigned to the jail by looking at the interfaces and (by design) the get_interface_address6_via_udp_socket_hack() fallback doesn't work either. The missing return code check resulted in tor_addr_is_internal() complaining about a "non-IP address of type 49", due to reading uninitialised memory. Fixes #17173.
2015-09-16Merge remote-tracking branch 'public/bug17047'Nick Mathewson
2015-09-16Merge branch 'bug17027-reject-private-all-interfaces-v2' into bug16069-bug17027teor (Tim Wilson-Brown)
src/test/test_policy.c: Merged calls to policies_parse_exit_policy by adding additional arguments. fixup to remaining instance of ~EXIT_POLICY_IPV6_ENABLED. Compacting logic test now produces previous list length of 4, corrected this. src/config/torrc.sample.in: src/config/torrc.minimal.in-staging: Merged torrc modification dates in favour of latest.
2015-09-16ExitPolicyRejectPrivate rejects local IPv6 address and interface addressesteor (Tim Wilson-Brown)
ExitPolicyRejectPrivate now rejects more local addresses by default: * the relay's published IPv6 address (if any), and * any publicly routable IPv4 or IPv6 addresses on any local interfaces. This resolves a security issue for IPv6 Exits and multihomed Exits that trust connections originating from localhost. Resolves ticket 17027. Patch by "teor". Patch on 42b8fb5a1523 (11 Nov 2007), released in 0.2.0.11-alpha.
2015-09-15Add tests for compat_libeventOla Bini
2015-09-15Add tests for tortls.cOla Bini
2015-09-16ExitPolicy accept6/reject6 produces IPv6 wildcard addresses onlyteor (Tim Wilson-Brown)
In previous versions of Tor, ExitPolicy accept6/reject6 * produced policy entries for IPv4 and IPv6 wildcard addresses. To reduce operator confusion, change accept6/reject6 * to only produce an IPv6 wildcard address. Resolves bug #16069. Patch on 2eb7eafc9d78 and a96c0affcb4c (25 Oct 2012), released in 0.2.4.7-alpha.
2015-09-16Ignore accept6/reject6 IPv4, warn about unexpected rule outcomesteor (Tim Wilson-Brown)
When parsing torrc ExitPolicies, we now warn if: * an IPv4 address is used on an accept6 or reject6 line. The line is ignored, but the rest of the policy items in the list are used. (accept/reject continue to allow both IPv4 and IPv6 addresses in torrcs.) * a "private" address alias is used on an accept6 or reject6 line. The line filters both IPv4 and IPv6 private addresses, disregarding the 6 in accept6/reject6. When parsing torrc ExitPolicies, we now issue an info-level message: * when expanding an accept/reject * line to include both IPv4 and IPv6 wildcard addresses. In each instance, usage advice is provided to avoid the message. Partial fix for ticket 16069. Patch by "teor". Patch on 2eb7eafc9d78 and a96c0affcb4c (25 Oct 2012), released in 0.2.4.7-alpha.
2015-09-15Add get_interface_address[6]_list for a list of interface IP addressesteor (Tim Wilson-Brown)
Add get_interface_address[6]_list by refactoring get_interface_address6. Add unit tests for new and existing functions. Preparation for ticket 17027. Patch by "teor". Patch on 42b8fb5a1523 (11 Nov 2007), released in 0.2.0.11-alpha.
2015-09-14Update comments about ExitPolicy parsingteor (Tim Wilson-Brown)
Fix incomplete and incorrect comments. Comment changes only.
2015-09-13Use SSL_get_client_ciphers() on openssl 1.1+, not SSL_get_ciphers...Nick Mathewson
(which isn't correct.) Fixes bug 17047; bugfix on 0.2.7.2-alpha, introduced by the merge in 0030765e04d8dfe3dfaf8124b01a4d578b7d8ceb, apparently.
2015-09-09Keep unused smartlist storage zeroedSebastian Hahn
Helps catch bugs with our smartlist usage and shouldn't be too expensive. If it shows up in profiles we can re-investigate.
2015-09-08Handle negative inputs to crypto_random_time_range().Nick Mathewson
(These inputs are possible when Shadow starts the world at time_t 0, and breaks our assumption that Tor didn't exist in the 1970s.) Fixes regression introduced in 241e6b09. Fixes #16980.
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-21Ensure worker threads actually exit when it is timeSebastian Hahn
This includes a small refactoring to use a new enum (workqueue_reply_t) for the return values instead of just ints.
2015-08-18Merge branch 'decouple_controller_events_squashed'Nick Mathewson
2015-08-18Log meaningful messages before failing on windows with threadlocal.Nick Mathewson
2015-08-18Improve threadlocal documentationNick Mathewson
2015-08-18Add comments for thread-local storage functionsNick Mathewson
2015-08-18Use thread-local storage to block event_queue recursion.Nick Mathewson
2015-08-17Merge remote-tracking branch 'public/bug16741_026'Nick Mathewson
2015-08-17Merge remote-tracking branch 'yawning/feature16533'Nick Mathewson
2015-08-13Fix some types on container fnsNick Mathewson
2015-08-12Use ed25519-donna's batch verification support when applicable.Yawning Angel
The code was always in our Ed25519 wrappers, so enable it when using the ed25519-donna backend, and deal with the mocking related crypto_rand silliness. Implements feature 16533.
2015-08-12Add crypto_rand_unmocked, which is crypto_rand without mocking.Yawning Angel
There is odd issues with calling crypto_rand from our copy of ed25519-donna, due to mocking that are not easily resolved.
2015-08-11Merge branch 'bug16389_027_03_squashed'Nick Mathewson
2015-08-11Fix typo in comment about digest256map_tDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Fix windows compilationNick Mathewson
2015-08-10Merge remote-tracking branch 'public/feature16734'Nick Mathewson
2015-08-07Check for EINTR correctly on windowsNick Mathewson
(even though these are nonblocking calls and EINTR shouldn't be possible). Also, log what error we're seing if drain_fn fails.
2015-08-05Add a compat function to check how much disk space is free.Nick Mathewson
Closes ticket 16734.
2015-08-05Set the open file limit to the current value before changing itDavid Goulet
If setrlimit() failed, max_out wasn't set in set_max_file_descriptors() ending in a state where we don't use ULIMIT_BUFFER for things like tor private key files. Also fix the set_max_file_descriptors() documentation. Fixes #16274 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-04Switch order of unblocking threads and releasing the mutex.cypherpunks
According to POSIX, the mutex must be locked by the thread calling the signal functions to ensure predictable scheduling behavior. Found the issue using Helgrind which gave the warning `dubious: associated lock is not held by any thread`.
2015-07-31Move formatting functions around.Nick Mathewson
The base64 and base32 functions used to be in crypto.c; crypto_format.h had no header; some general-purpose functions were in crypto_curve25519.c. This patch makes a {crypto,util}_format.[ch], and puts more functions there. Small modules are beautiful!
2015-07-30Add get_max_sockets() and remove dead codeDavid Goulet
The control port was using set_max_file_descriptors() with a limit set to 0 to query the number of maximum socket Tor can use. With the recent changes to that function, a check was introduced to make sure a user can not set a value below the amount we reserved for non socket. This commit adds get_max_sockets() that returns the value of max_sockets so we can stop using that "setter" function to get the current value. Finally, the dead code is removed that is the code that checked for limit equal to 0. From now on, set_max_file_descriptors() should never be used with a limit set to 0 for a valid use case. Fixes #16697 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-30Wrap windows-only C files in #ifdef _WIN32Nick Mathewson
This should make some scripts and IDEs happier.
2015-07-27Allow a single trailing `.` when validating FQDNs from SOCKS.Yawning Angel
URI syntax (and DNS syntax) allows for a single trailing `.` to explicitly distinguish between a relative and absolute (fully-qualified) domain name. While this is redundant in that RFC 1928 DOMAINNAME addresses are *always* fully-qualified, certain clients blindly pass the trailing `.` along in the request. Fixes bug 16674; bugfix on 0.2.6.2-alpha.
2015-07-23Fix a couple more msvc issues, reported by gisle vanemNick Mathewson
2015-07-22Merge branch 'ticket2325_squashed'Nick Mathewson
2015-07-21Fix some potential memory leaks in the thread pool code.cypherpunks
2015-07-20Document the torrc format as thoroughly as possibleNick Mathewson
Closes ticket 2325