aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'public/bug6853'Nick Mathewson2012-09-17
|\
| * Parse votes with >31 flags correctlyNick Mathewson2012-09-17
| | | | | | | | | | | | | | We were doing (1<<p) to generate a flag at position p, but we should have been doing (U64_LITERAL(1)<<p). Fixes bug 6861; bugfix on 0.2.0.3-alpha; reported pseudonymously.
* | document why we only allow 64 flags in votesNick Mathewson2012-09-14
| |
* | Reject votes (not consensuses) with >64 known-flagsNick Mathewson2012-09-13
| | | | | | | | | | | | | | | | | | Our flag voting code needs to handle unrecognized flags, so it stores them in a 64-bit bitfield. But we never actually checked for too many flags, so we were potentially doing stuff like U64_LITERAL(1)<<flagnum with flagnum >= 64. That's undefined behavior. Fix for bug 6833; bugfix on 0.2.0.1-alpha.
* | Merge remote-tracking branch 'origin/maint-0.2.3'Nick Mathewson2012-09-13
|\|
| * Avoid undefined behaviour when parsing HS protocol versionsRobert Ransom2012-09-13
| | | | | | | | | | | | | | Fixes bug 6827; bugfix on c58675ca728f12b42f65e5b8964ae695c2e0ec2d (when the v2 HS desc parser was implemented). Found by asn.
* | Remove version_supports checks for versions before 0.2.2.Nick Mathewson2012-09-07
| |
* | Merge branch 'bug5535_only_rebased'Nick Mathewson2012-09-04
|\ \
| * | Add IPv6 OR port to microdesc_t and populate it.Linus Nordberg2012-09-04
| |/
* / Have directory authorities vote on IPv6 OR ports according to the specLinus Nordberg2012-09-04
|/ | | | | | | | | | | | | | Define new new consensus method 14 adding "a" lines to vote and consensus documents. From proposal 186: As with other data in the vote derived from the descriptor, the consensus will include whichever set of "a" lines are given by the most authorities who voted for the descriptor digest that will be used for the router. This patch implements this.
* Merge remote-tracking branch 'public/bug6404' into maint-0.2.3Nick Mathewson2012-08-21
|\
| * Warn at parse time for routerstatus entry missing a microdesc consensusNick Mathewson2012-07-31
| | | | | | | | | | | | | | | | In 0.2.3.18-rc, we started warning on this case while building a list of missing microdescriptor digests. That turned out to spam the logs; instead let's warn at parse time. Partial fix for bug 6404.
* | Don't infer we have a FooPort from the presence of a FooPort lineNick Mathewson2012-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to the changes we started making with SocksPort and friends in 0.2.3.3-alpha, any of our code that did "if (options->Sockport)" became wrong, since "SocksPort 0" would make that test true whereas using the default SocksPort value would make it false. (We didn't actually do "if (options->SockPort)" but we did have tests for TransPort. When we moved DirPort, ORPort, and ControlPort over to the same system in 0.2.3.9-alpha, the problem got worse, since our code is littered with checks for DirPort and ORPort as booleans. This code renames the current linelist-based FooPort options to FooPort_lines, and adds new FooPort_set options which get set at parse-and-validate time on the or_options_t. FooPort_set is true iff we will actually try to open a listener of the given type. (I renamed the FooPort options rather than leave them alone so that every previous user of a FooPort would need to get inspected, and so that any new code that forgetfully uses FooPort will need fail to compile.) Fix for bug 6507.
* | Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3Nick Mathewson2012-08-03
|\ \ | |/ |/|
| * Avoid possible segfault when handling networkstatus vote with bad flavorNick Mathewson2012-08-03
| | | | | | | | Fix for 6530; fix on 0.2.2.6-alpha.
* | 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.
* | Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson2012-06-15
| |
* | Resolve about 24 DOCDOCsNick Mathewson2012-06-05
| |
* | 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.
* | Resolve all currently pending DOCDOC items in masterNick Mathewson2012-06-04
| |
* | Fix O(n^2) performance when parsing a big pile of extrainfosNick Mathewson2012-05-10
| | | | | | | | | | | | | | | | | | We were doing an O(n) strlen in router_get_extrainfo_hash() for every one we tried to parse. Instead, have router_get_extrainfo_hash() take the length of the extrainfo as an argument, so that when it's called from extrainfo_parse_from_string(), it doesn't do a strlen() over the whole pile of extrainfos.
* | Check more thoroughly for dups when parsing networkstatus parametersNick Mathewson2012-05-07
| | | | | | | | | | | | See changes file for details. Partial fix for bug 5786; fix on 0.2.2.2-alpha.
* | Make base64_decode in rend_parse_client_keys more foolproofNick Mathewson2012-04-19
| | | | | | | | | | | | | | | | | | In general, whenever we can, we should be doing base64_decode(buf, sizeof(buf), s, strlen(s)), and not base_64_decode(buf, expr1, s, expr2) where we hope that expr1 is a good name for the size of buf and expr2 is a good formula for the length of the base64 expression in s.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2012-04-19
|\|
| * Fix a log-uninitialized-buffer bug.Nick Mathewson2012-04-18
| | | | | | | | Fix for 5647; bugfix on 0.2.1.5-alpha.
* | Fix comment typoRobert Ransom2012-03-30
| |
* | Refactor the API for setting up a block cipher.Nick Mathewson2012-03-27
| | | | | | | | | | It allows us more flexibility on the backend if the user needs to specify the key and IV at setup time.
* | Fix a check-spaces complaintSebastian Hahn2012-02-12
| |
* | Allow 0.2.3.x clients to use 0.2.2.x bridges.Roger Dingledine2012-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the client would ask the bridge for microdescriptors, which are only supported in 0.2.3.x and later, and then fail to bootstrap when it didn't get the answers it wanted. Fixes bug 4013; bugfix on 0.2.3.2-alpha. The fix here is to revert to using normal descriptors if any of our bridges are known to not support microdescs. This is not ideal, a) because we'll start downloading a microdesc consensus as soon as we get a bridge descriptor, and that will waste time if we later get a bridge descriptor that tells us we don't like microdescriptors; and b) by changing our mind we're leaking to our other bridges that we have an old-version bridge. The alternate fix would have been to change we_use_microdescriptors_for_circuits() to ask if *any* of our bridges can support microdescriptors, and then change the directory logic that picks a bridge to only select from those that do. For people living in the future, where 0.2.2.x is obsolete, there won't be a difference. Note that in either of these potential fixes, we have risk of oscillation if our one funny-looking bridges goes away / comes back.
* | 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;
* | Initial support for simplest use of prop186 or-address linesNick Mathewson2011-11-30
| | | | | | | | | | This lets a routerinfo_t have a single IPv6 or-address, and adds support for formatting and parsing those lines.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-11-07
|\|
| * Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-11-07
| |\
| | * Fix remotely triggerable assert during ip decryptionDan Rosenberg2011-11-06
| | | | | | | | | | | | Fixes bug 4410.
* | | Merge branch 'maint-0.2.2_secfix' into master_secfixSebastian Hahn2011-10-27
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/common/tortls.c src/or/connection_or.c src/or/dirserv.c src/or/or.h
| * | Make tor_version_same_series non-staticRobert Ransom2011-10-26
| | |
* | | Stop using addr_port_lookup as an address splitting functionNick Mathewson2011-10-11
| | | | | | | | | | | | | | | | | | It's too risky to have a function where if you leave one parameter NULL, it splits up address:port strings, but if you set it, it does hostname resolution.
* | | Fix names of functions that convert strings to addrsNick Mathewson2011-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-09-09
|\| | | | | | | | | | | | | | | | | Conflicts: configure.in src/or/circuitbuild.c
| * | Use %f with printf-style formatting, not %lfNick Mathewson2011-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp.
* | | Only use optimistic data with exits that support itNick Mathewson2011-07-18
| | | | | | | | | | | | | | | | | | | | | This adds a little code complexity: we need to remember for each node whether it supports the right feature, and then check for each connection whether it's exiting at such a node. We store this in a flag in the edge_connection_t, and set that flag at link time.
* | | 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.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-14
|\| |
| * | Remove a few dead assignments during router parsingSebastian Hahn2011-06-08
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-03
|\| |
| * | Reject 128-byte keys that are not 1024-bitNick Mathewson2011-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we added the check for key size, we required that the keys be 128 bytes. But RSA_size (which defers to BN_num_bytes) will return 128 for keys of length 1017..1024. This patch adds a new crypto_pk_num_bits() that returns the actual number of significant bits in the modulus, and uses that to enforce key sizes. Also, credit the original bug3318 in the changes file.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-01
|\| |
| * | Report wrong key sizes correctlyNick Mathewson2011-06-01
| | | | | | | | | | | | | | | | | | | | | | | | When we introduced NEED_KEY_1024 in routerparse.c back in 0.2.0.1-alpha, I forgot to add a *8 when logging the length of a bad-length key. Bugfix for 3318 on 0.2.0.1-alpha.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conflicts were mainly caused by the routerinfo->node transition. Conflicts: src/or/circuitbuild.c src/or/command.c src/or/connection_edge.c src/or/directory.c src/or/dirserv.c src/or/relay.c src/or/rendservice.c src/or/routerlist.c