aboutsummaryrefslogtreecommitdiff
path: root/src/or/policies.c
Commit message (Collapse)AuthorAge
* Merge branch 'bug11108'Nick Mathewson2014-03-06
|\
| * Warn if ports are specified in {Socks,Dir}PolicyNick Mathewson2014-03-03
| | | | | | | | | | | | | | | | | | | | We have ignored any ports listed here since 80365b989 (0.0.7rc1), but we didn't warn the user that we were ignoring them. This patch adds a warning if you put explicit ports in any of the options {Socks,Dir}Policy or AuthDir{Reject,Invalid,BadDir,BadExit}. It also adjusts the manpage to say that ports are ignored. Fixes ticket 11108.
* | Merge remote-tracking branch 'arma/ticket5528'Nick Mathewson2014-03-05
|\ \ | |/ |/| | | | | | | Conflicts: src/or/router.c src/test/test_dir.c
| * use me->addr when adding our address to our exit policyRoger Dingledine2013-02-09
| | | | | | | | (rather than me->address)
* | Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson2014-02-12
| | | | | | | | | | | | | | | | | | | | I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
* | On END_REASON_EXITPOLICY, mark circuit as unusable for that address.Nick Mathewson2013-03-11
|/ | | | | | | | | | Also, don't call the exit node 'reject *' unless our decision to pick that node was based on a non-summarized version of that node's exit policy. rransom and arma came up with the ideas for this fix. Fix for 7582; the summary-related part is a bugfix on 0.2.3.2-alpha.
* Rename log() to tor_log() for loggingNick Mathewson2013-02-01
| | | | | | | | | | | | | This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
* Rename *_isin to *_containsNick Mathewson2013-01-16
| | | | | | | | | | | This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
* Update the copyright date to 201.Nick Mathewson2013-01-16
|
* fix some typosRoger Dingledine2012-12-03
|
* Fix a bug in policy_is_reject_star() that was making IPv4 exits breakNick Mathewson2012-11-14
| | | | | | | | IPv4-only exits have an implicit "reject [::]/0", which was making policy_is_reject_star() return 1 for them, making us refuse to do hostname lookups. This fix chanes policy_is_reject_star() to ask about which family we meant.
* Add an IPv6Exit configuration optionNick Mathewson2012-11-14
| | | | | Don't advertise an IPv6 exit policy, or accept IPv6 exit requests, if IPv6Exit is not true.
* Add IPv6 support to compare_to_addr_to_node_policyNick Mathewson2012-11-14
|
* Better policy support for IPv6Nick Mathewson2012-11-14
| | | | | | | | | | | Now, "accept *:80" means "accept all addresses on port 80", and not just IPv4. For just v4, say "accept *4:80"; for just v6 say "accept *6:80". We can parse these policies from torrc just fine, and we should be successfully keeping them out of descriptors for now. We also now include appropriate IPv6 addresses in "reject private:*"
* Add a new family-specific syntax for tor_addr_parse_mask_portsNick Mathewson2012-11-14
| | | | | | | | | | | | | | By default, "*" means "All IPv4 addresses" with tor_addr_parse_mask_ports, so I won't break anything. But if the new EXTENDED_STAR flag is provided, then * means "any address", *4 means "any IPv4 address" (that is, 0.0.0.0/0), and "*6" means "any IPv6 address" (that is, [::]/0). This is going to let us have a syntax for specifying exit policies in torrc that won't drive people mad. Also, add a bunch of unit tests for tor_addr_parse_mask_ports to test these new features, and to increase coverage.
* Merge remote-tracking branch 'linus/bug5053-bug5055'Nick Mathewson2012-11-04
|\ | | | | | | | | Conflicts: src/or/geoip.c
| * Name variables more consistently.Linus Nordberg2012-10-22
| |
| * Add GeoIP database for IPv6 addressesnils2012-10-17
| |
| * Rename address family specific IPv4 geoip functions in preparation for IPv6 ↵nils2012-10-17
| | | | | | | | support
* | Merge branch 'maint-0.2.3'Roger Dingledine2012-10-23
|\ \
| * | Let 0.2.3 clients exit to internal addresses if they wantRoger Dingledine2012-10-23
| | | | | | | | | | | | | | | | | | | | | Clients now consider the ClientRejectInternalAddresses config option when using a microdescriptor consensus stanza to decide whether an exit relay would allow exiting to an internal address. Fixes bug 7190; bugfix on 0.2.3.1-alpha.
* | | fix typoRoger Dingledine2012-10-23
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.3'Nick Mathewson2012-10-23
|\| | | |/ |/|
| * Fix parse_short_policy (bug 7192.)Nick Mathewson2012-10-23
| | | | | | | | | | | | | | | | | | | | | | Our implementation of parse_short_policy was screwed up: it would ignore the last character of every short policy. Obviously, that's broken. This patch fixes the busted behavior, and adds a bunch of unit tests to make sure the rest of that function is okay. Fixes bug 7192; fix on 0.2.3.1-alpha.
| * add a unit test to expose bug 7192Roger Dingledine2012-10-22
| |
* | Merge remote-tracking branch 'origin/maint-0.2.3'Nick Mathewson2012-08-27
|\|
| * Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3Nick Mathewson2012-08-27
| |\ | | | | | | | | | | | | Conflicts: src/or/policies.c
| | * Do not assert when comparing a null address/port against a policyNick Mathewson2012-08-27
| | | | | | | | | | | | | | | This can create a remote crash opportunity for/against directory authorities.
* | | Merge remote-tracking branch 'public/bug5124'Nick Mathewson2012-08-17
|\ \ \ | |/ / |/| |
| * | Never emit the "opt" prefix in any directory stuffNick Mathewson2012-06-28
| | | | | | | | | | | | Fix for bug 5124.
* | | Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/ENDNick Mathewson2012-07-17
|/ / | | | | | | | | | | | | | | | | | | | | The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when you have a nice short loop body, but using it for long bodies makes your preprocessor tell the compiler that all the code is on the same line. That causes grief, since compiler warnings and debugger lines will all refer to that one line. So, here's a new style rule: SMARTLIST_FOREACH blocks need to be short.
* | Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
| |
* | Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson2012-06-04
| | | | | | | | | | | | | | | | Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
* | whitespace fixRoger Dingledine2012-02-29
| |
* | document a cool attack that we evaluatedRoger Dingledine2012-02-17
| |
* | Rename nonconformant identifiers.Nick Mathewson2012-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug 4893. These changes are pure mechanical, and were generated with this perl script: /usr/bin/perl -w -i.bak -p s/crypto_pk_env_t/crypto_pk_t/g; s/crypto_dh_env_t/crypto_dh_t/g; s/crypto_cipher_env_t/crypto_cipher_t/g; s/crypto_digest_env_t/crypto_digest_t/g; s/aes_free_cipher/aes_cipher_free/g; s/crypto_free_cipher_env/crypto_cipher_free/g; s/crypto_free_digest_env/crypto_digest_free/g; s/crypto_free_pk_env/crypto_pk_free/g; s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g; s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g; s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g; s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g; s/crypto_new_cipher_env/crypto_cipher_new/g; s/crypto_new_digest_env/crypto_digest_new/g; s/crypto_new_digest256_env/crypto_digest256_new/g; s/crypto_new_pk_env/crypto_pk_new/g; s/crypto_create_crypto_env/crypto_cipher_new/g; s/connection_create_listener/connection_listener_new/g; s/smartlist_create/smartlist_new/g; s/transport_create/transport_new/g;
* | fix crash bug in original feature4207 branchRoger Dingledine2012-01-16
| | | | | | | | | | PLURAL() assumes that the plural is the canonical name for the option, so now it is.
* | Convert instances of tor_malloc+tor_snprintf into tor_asprintfNick Mathewson2012-01-16
| | | | | | | | | | | | | | | | | | | | These were found by looking for tor_snprintf() instances that were preceeded closely by tor_malloc(), though I probably converted some more snprintfs as well. (In every case, make sure that the length variable (if any) is removed, renamed, or lowered, so that anything else that might have assumed a longer buffer doesn't exist.)
* | Comment fixups on 4207 suggested by armaNick Mathewson2012-01-16
| |
* | Allow authorities to baddir/badexit/invalid/reject nodes by ccNick Mathewson2012-01-13
| | | | | | | | Implements ticket #4207
* | Remove compare_addr_to_node_policyNick Mathewson2011-07-15
| | | | | | | | | | | | | | | | Instead, use compare_tor_addr_to_node_policy everywhere. One advantage of this is that compare_tor_addr_to_node_policy can better distinguish 0.0.0.0 from "unknown", which caused a nasty bug with microdesc users.
* | Treat null address as "unknown", not "rejected" in md policyNick Mathewson2011-07-15
| | | | | | | | | | | | | | | | | | | | Previously, we had an issue where we'd treat an unknown address as 0, which turned into "0.0.0.0", which looked like a rejected address. This meant in practice that as soon as we started doing comparisons of unknown uint32 addresses to short policies, we'd get 'rejected' right away. Because of the circumstances under which this would be called, it would only happen when we had local DNS cached entries and we were looking to launch new circuits.
* | Remove compare_addr_to_addr_policyNick Mathewson2011-07-15
| | | | | | | | | | Nothing used it but the unit tests; everything else knows to use compare_tor_addr_to_addr_policy instead.
* | Remove a redundant condition in compare_addr_to_node_policyNick Mathewson2011-07-08
| | | | | | | | | | | | A && A == A. Found by frosty_un
* | Don't shadow parameters with local variablesNick Mathewson2011-07-01
| | | | | | | | | | | | | | | | This is a little error-prone when the local has a different type from the parameter, and is very error-prone with both have the same type. Let's not do this. Fixes CID #437,438,439,440,441.
* | Make the get_options() return constNick Mathewson2011-06-14
| | | | | | | | | | | | | | | | This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-14
|\|
| * Don't use signed 1-bit bitfieldsSebastian Hahn2011-06-08
| | | | | | | | | | This was harmless, we never compared it to anything but itself or 0. But Coverity complained, and it had a point.
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-03-06
|\|
| * Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-03-06
| |\ | | | | | | | | | | | | Conflicts: src/or/policies.c