summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2015-12-08Fix memory leak by circuit marked for close listcypherpunks
This commit fixes a memory leak introduced by commit 8b4e5b7ee902fb7fa07767410a18433d752c7aef.
2015-12-08Merge branch 'maint-0.2.7'Nick Mathewson
2015-12-08Format IPv6 policies correctly.Nick Mathewson
Previously we'd suppressed the mask-bits field in the output when formatting a policy if it was >=32. But that should be a >=128 if we're talking about IPv6. Since we didn't put these in descriptors, this bug affects only log messages and controller outputs. Fix for bug 16056. The code in question was new in 0.2.0, but the bug was introduced in 0.2.4 when we started supporting IPv6 exits.
2015-12-07Merge remote-tracking branch 'teor/exitpolicy-multicast'Nick Mathewson
2015-12-07Comment-only change to connection_get_by_type_addr_port_purposeteor (Tim Wilson-Brown)
connection_get_by_type_addr_port_purpose also ignores connections that are marked for close.
2015-12-07Comment-only changes to connection_connectteor (Tim Wilson-Brown)
port is in host order (addr is tor_addr_t, endianness is abstracted). addr and port can be different to conn->addr and conn->port if connecting via a proxy.
2015-12-07Move a comment in router_get_my_descriptor to the correct lineteor (Tim Wilson-Brown)
2015-12-07Update comment: get_connection_array no longer takes "n"teor (Tim Wilson-Brown)
2015-12-07Consistently ignore multicast in internal reject private exit policiesteor (Tim Wilson-Brown)
Consistently ignore multicast addresses when automatically generating reject private exit policies. Closes ticket 17763. Bug fix on 10a6390deb3c9, not in any released version of Tor. Patch by "teor".
2015-11-30Merge branch 'maint-0.2.7'Nick Mathewson
2015-11-30Fix undefined behavior caused by memory overlapcypherpunks
The tor_cert_get_checkable_sig function uses the signing key included in the certificate (if available) when a separate public key is not given. When the signature is valid, the tor_cert_checksig function copies the public key from the checkable structure to the public key field of the certificate signing key. In situations where the separate public key is not given but the certificate includes a signing key, the source and destination pointers in the copy operation are equal and invoke undefined behavior. Undefined behaviour is avoided by ensuring both pointers are different.
2015-11-27More fixes/debugging attempts for 17659Nick Mathewson
2015-11-27Add a stack trace for help debugging one part of 17659Nick Mathewson
2015-11-27Merge branch 'fix-policies-memory-v2-squashed'Nick Mathewson
2015-11-27Fix use-after-free of stack memory in getinfo_helper_policiesteor (Tim Wilson-Brown)
2015-11-27Fix use-after-free of stack memory in policies_parse_exit_policy*teor (Tim Wilson-Brown)
Change the function names & comments to make the copying explicit.
2015-11-27Check magic number in connection_ap_attach_pendingNick Mathewson
2015-11-26improve log messages to try to track down #17659Nick Mathewson
2015-11-26Correctly free a smartlist in getinfo_helper_policiesteor (Tim Wilson-Brown)
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-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-25Merge branch 'bug17654_try1'Nick Mathewson
2015-11-25Merge remote-tracking branch 'public/decouple_dir_request_failed'Nick Mathewson
2015-11-25Fix a logic error in connection_tls_continue_handshake().Nick Mathewson
(If we take the branch above this assertion, than we *didn't* have a v1 handshake. So if we don't take the branch, we did. So if we reach this assertion, we must be running as a server, since clients no longer attempt v1 handshakes.) Fix for bug 17654; bugfix on 9d019a7db725dca3dfdbf8d4dbc3b51835e0b49e. Bug not in any released Tor.
2015-11-25Merge remote-tracking branch 'teor/comments-20151123'Nick Mathewson
2015-11-25Merge remote-tracking branch 'teor/feature8961-replaycache-sha256'Nick Mathewson
2015-11-25Merge branch 'maint-0.2.7'Nick Mathewson
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-23Fix: use the right list in find_expiring_intro_point()David Goulet
The wrong list was used when looking up expired intro points in a rend service object causing what we think could be reachability issues and triggering a BUG log. Fixes #16702 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-11-23fix two typos in commentsRoger Dingledine
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-20Refactor router_dump_exit_policy_to_stringteor (Tim Wilson-Brown)
Split out policy_dump_to_string to use it in getinfo_helper_policies.
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-20Refactor policies_parse_exit_policy_internalteor (Tim Wilson-Brown)
Move the code that rejects publicly routable exit relay addresses to policies_parse_exit_policy_reject_private. Add addr_policy_append_reject_addr_list and use it to reject interface addresses. This removes the duplicate reject checks on local_address and ipv6_local_address, but duplicates will be removed by exit_policy_remove_redundancies at the end of the function. This also removes the info-level logging on rejected interface addresses. Instead, log a debug-level message in addr_policy_append_reject_addr. This simplifies policies_parse_exit_policy_internal and prepares for reporting these addresses over the control port in #17183.
2015-11-19Merge remote-tracking branch 'public/decouple_conn_attach_2'Nick Mathewson
2015-11-18Fix a startup time assert caused by periodic events not being initialized.Yawning Angel
Loading a on disk bridge descriptor causes a directory download to be scheduled, which asserts due to the periodic events not being initialized yet. Fixes bug #17635, not in any released version of tor.
2015-11-17windows already has a CALLBACK macro...Nick Mathewson
2015-11-17Don't relaunch dir requests recursively if connection_connect() returns -1Nick Mathewson
Closes ticket 17589.
2015-11-17Fix a server-side crash on DNS initNick Mathewson
2015-11-17Some unit tests now require that periodic events be initialized.Nick Mathewson
2015-11-17Free pending_entry_connections on shutdown.Nick Mathewson
2015-11-17Be more conservative in scanning the list of pending streamsNick Mathewson
Now we only re-scan the list in the cases we did before: when we have a new circuit that we should try attaching to, or when we have added a new stream that we haven't tried to attach yet. This is part of 17590.
2015-11-17Decouple ..attach_circuit() from most of its callers.Nick Mathewson
Long ago we used to call connection_ap_handshake_attach_circuit() only in a few places, since connection_ap_attach_pending() attaches all the pending connections, and does so regularly. But this turned out to have a performance problem: it would introduce a delay to launching or connecting a stream. We couldn't just call connection_ap_attach_pending() every time we make a new connection, since it walks the whole connection list. So we started calling connection_ap_attach_pending all over, instead! But that's kind of ugly and messes up our callgraph. So instead, we now have connection_ap_attach_pending() use a list only of the pending connections, so we can call it much more frequently. We have a separate function to scan the whole connection array to see if we missed adding anything, and log a warning if so. Closes ticket #17590
2015-11-17Whoops; in this context the EV_TIMEOUT flag is neededNick Mathewson
2015-11-17Merge branch 'bug3199_redux_3'Nick Mathewson