summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-03-15Merge branch 'bug21540_029_v2'Nick Mathewson
2017-03-15Correctly handle fd-drain errors on windows workqueuesNick Mathewson
Windows doesn't let you check the socket error for a socket with WSAGetLastError() and getsockopt(SO_ERROR). But getsockopt(SO_ERROR) clears the error on the socket, so you can't call it more than once per error. When we introduced recv_ni to help drain alert sockets, back in 0.2.6.3-alpha, we had the failure path for recv_ni call getsockopt() twice, though: once to check for EINTR and one to check for EAGAIN. Of course, we never got the eagain, so we treated it as an error, and warned about: "No error". The fix here is to have these functions return -errno on failure. Fixes bug 21540; bugfix on 0.2.6.3-alpha.
2017-03-15Merge branch 'maint-0.3.0'Nick Mathewson
2017-03-15Merge branch 'bug20059_024_v2' into maint-0.3.0Nick Mathewson
2017-03-15Avoid a double-mark bug when makring a pending circuit as "too old"Nick Mathewson
Fixes bug 20059; bugfix on 0.1.0.1-rc.
2017-03-15Merge branch 'deprecate_getinfo_network_status'Nick Mathewson
2017-03-15Merge remote-tracking branch 'public/feature21496'Nick Mathewson
2017-03-14Improve keccak-tiny performance by 15% on LE intelNick Mathewson
The 64-bit load and store code was generating pretty bad output with my compiler, so I extracted the code from csiphash and used that instead. Close ticket 21737
2017-03-14Log info about intro point limits when they are reached and resetteor
Depends on 21594, part of 21622.
2017-03-14Log more info when a service descriptor has the wrong number of intro pointsteor
Depends on 21598, part of 21622.
2017-03-14Create function to log service introduction point creation limitsteor
Depends on 21594, part of 21622. (Resolved merge conflict in static function declarations.
2017-03-14Create logfiles in mode 0640Nick Mathewson
Patch from toralf; closes 21729.
2017-03-13Fix some compilation warnings in {test_,}hs_descriptor.cNick Mathewson
Nothing big: just some const char[]s that should have been static, and some integer truncation warnings. Warnings not in any released Tor.
2017-03-13Add a null statement to prevent some SMARTLIST_FOREACH() bugs.Nick Mathewson
So we require that SMARTLIST_FOREACH_END() have the name of the loop variable in it. But right now the only enforcement for that is to clear the variable at the end of the loop, which is really not sufficient: I spent 45 minutes earlier today debugging an issue where I had said: SMARTLIST_FOREACH_BEGIN(spool, spooled_resource_t *, spooled) { ... } SMARTLIST_FOREACH_END(spool); This patch makes it so that ONLY loop variables can be used, by referring to the _sl_idx variable.
2017-03-13Merge branch 'maint-0.3.0'Nick Mathewson
2017-03-13Merge remote-tracking branch 'public/bug21682_030' into maint-0.3.0Nick Mathewson
2017-03-13Merge remote-tracking branch 'asn/bug21334_v3'Nick Mathewson
2017-03-13prop224: Rename padding size def to something less confusing.George Kadianakis
People felt it could refer to the descriptor header section instead of the plaintext of the superencrypted section.
2017-03-13prop224: Add unittests for decode_superencrypted().George Kadianakis
2017-03-13prop224: Move some utility crypto funcs to the top of the file.George Kadianakis
2017-03-13prop224: Fix the HS descriptor unittests.George Kadianakis
- HS descriptors are now bigger than 10kb. - encrypted_data_length_is_valid() is not that strict now.
2017-03-13prop224: Implement decoding of superencrypted HS descriptor.George Kadianakis
[Consider starting review from desc_decrypt_all() ]
2017-03-13prop224: Implement encoding of superencrypted HS descriptor.George Kadianakis
Also, relaxed the checks of encrypted_data_length_is_valid() since now only one encrypted section has padding requirements and we don't actually care to check that all the padding is there. Consider starting code review from function encode_superencrypted_data().
2017-03-13prop224: Prepare for superencrypted HS descriptors.George Kadianakis
- Refactor our HS desc crypto funcs to be able to differentiate between the superencrypted layer and the encrypted layer so that different crypto constants and padding is used in each layer. - Introduce some string constants. - Add some comments.
2017-03-10Mark GETINFO network-status as deprecated with a warningNick Mathewson
control-spec has marked it deprecated for a long time. Closes ticket 21703.
2017-03-09Merge branch 'bug21415_testfix_030'Nick Mathewson
2017-03-09Fix failing bridges+ipv6-min integration test.George Kadianakis
The bridges+ipv6-min integration test has a client with bridges: Bridge 127.0.0.1:5003 Bridge [::1]:5003 which got stuck in guard_selection_have_enough_dir_info_to_build_circuits() because it couldn't find the descriptor of both bridges. Specifically, the guard_has_descriptor() function could not find the node_t of the [::1] bridge, because the [::1] bridge had no identity digest assigned to it. After further examination, it seems that during fetching the descriptor for our bridges, we used the CERTS cell to fill the identity digest of 127.0.0.1:5003 properly. However, when we received a CERTS cell from [::1]:5003 we actually ignored its identity digest because the learned_router_identity() function was using get_configured_bridge_by_addr_port_digest() which was returning the 127.0.0.1 bridge instead of the [::1] bridge (because it prioritizes digest matching over addrport matching). The fix replaces get_configured_bridge_by_addr_port_digest() with the recent get_configured_bridge_by_exact_addr_port_digest() function. It also relaxes the constraints of the get_configured_bridge_by_exact_addr_port_digest() function by making it return bridges whose identity digest is not yet known. By using the _exact_() function, learned_router_identity() actually fills in the identity digest of the [::1] bridge, which then allows guard_has_descriptor() to find the right node_t and verify that the descriptor is there. FWIW, in the bridges+ipv6-min test both 127.0.0.1 and [::1] bridges correspond to the same node_t, which I guess makes sense given that it's actually the same underlying bridge.
2017-03-09Revert "Restore correct behavior of 0.3.0.4-rc with bridges+ipv6-min"George Kadianakis
This reverts commit 5298ab59170be74aed20e04e5378ec66eef6476e.
2017-03-09Merge remote-tracking branch 'ahf/bugs/21654'Nick Mathewson
2017-03-09Remove fgets() compatbility function and related tests.Alexander Færøy
This patch removes the `tor_fgets()` wrapper around `fgets(3)` since it is no longer needed. The function was created due to inconsistency between the returned values of `fgets(3)` on different versions of Unix when using `fgets(3)` on non-blocking file descriptors, but with the recent changes in bug #21654 we switch from unbuffered to direct I/O on non-blocking file descriptors in our utility module. We continue to use `fgets(3)` directly in the geoip and dirserv module since this usage is considered safe. This patch also removes the test-case that was created to detect differences in the implementation of `fgets(3)` as well as the changes file since these changes was not included in any releases yet. See: https://bugs.torproject.org/21654
2017-03-09Use less-than instead of not-equal-to for comparison in read loops.Alexander Færøy
This patch changes a number of read loops in the util module to use less-than comparison instead of not-equal-to comparison. We do this in the case that we have a bug elsewhere that might cause `numread` to become larger than `count` and thus become an infinite loop.
2017-03-09Add test case for get_string_from_pipe().Alexander Færøy
This patch adds a test case for the get_string_from_pipe() function found in the utility module. See: See: https://bugs.torproject.org/21654
2017-03-09Remove buffered I/O stream usage in process_handle_t.Alexander Færøy
This patch removes the buffered I/O stream usage in process_handle_t and its related utility functions. This simplifies the code and avoids racy code where we used buffered I/O on non-blocking file descriptors. See: https://bugs.torproject.org/21654
2017-03-08Merge branch 'maint-0.3.0'Nick Mathewson
2017-03-08Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-03-08Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-03-08Merge branch 'maint-0.2.7-redux' into maint-0.2.8Nick Mathewson
2017-03-08Merge branch 'maint-0.2.6' into maint-0.2.7-reduxNick Mathewson
2017-03-08Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-03-08Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-03-08Fix a memory leak in config_get_assigned_option()Nick Mathewson
This was introducd in 4d83999213712c7 in 0.3.0.3-alpha. This is bug 21682.
2017-03-08Update geoip and geoip6 to the March 7 2017 database.Karsten Loesing
2017-03-08Use read(2) instead of fgets(3) when reading process output.Alexander Færøy
This patch modifies `tor_read_all_handle()` to use read(2) instead of fgets(3) when reading the stdout from the child process. This should eliminate the race condition that can be triggered in the 'slow/util/*' tests on slower machines running OpenBSD, FreeBSD and HardenedBSD. See: https://bugs.torproject.org/21654
2017-03-07Merge branch 'maint-0.3.0'Nick Mathewson
2017-03-07Merge branch 'bug21594_030_squashed' into maint-0.3.0Nick Mathewson
2017-03-07Remove delay in hidden service introduction point checksteor
Make hidden services with 8 to 10 introduction points check for failed circuits immediately after startup. Previously, they would wait for 5 minutes before performing their first checks. Fixes bug 21594; bugfix on commit 190aac0eab9 in Tor 0.2.3.9-alpha. Reported by alecmuffett.
2017-03-06Merge remote-tracking branch 'ahf/bugs/20988'Nick Mathewson
2017-03-06Merge remote-tracking branch 'teor/bug19699'Nick Mathewson
2017-03-06Check for NULL as input to extrainfo_parse_entry_from_string()Nick Mathewson
We hope this will make the clangalyzer less worried about this function. Closes ticket 21496.
2017-03-06Fix a function name in a comment. Closes 21580Nick Mathewson