aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-05Refactor buffer APIs to put a buf_t first.Nick Mathewson
By convention, a function that frobs a foo_t should be called foo_frob, and it should have a foo_t * as its first argument. But for many of the buf_t functions, the buf_t was the final argument, which is silly.
2017-09-05Repair wide lines from previous commit.Nick Mathewson
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
2017-09-05Move buffers.c and buffers_tls.c into src/commonNick Mathewson
These are no longer tor-specific, so they can be part of the infrastructure.
2017-09-05Move the tls parts of buffers.c into buffers_tls.cNick Mathewson
2017-09-05Make buffers.c independent of or.hNick Mathewson
Also, put ext_or function in new module; it had accidentally gotten into proto_socks.c
2017-09-05Make buf_pullup() expose the pulled-up data.Nick Mathewson
This lets us drop the testing-only function buf_get_first_chunk_data(), and lets us implement proto_http and proto_socks without looking at buf_t internals.
2017-09-05Replace buf->datalen usage in proto_*.c with buf_datalen() call.Nick Mathewson
This lets us remove BUFFERS_PRIVATE from two of the modules.
2017-09-05Move protocol-specific functions out of buffers.cNick Mathewson
This commit does not change the implementation of any function: it only moves code and adds new includes as necessary. Part of #23149.
2017-09-05Not all invizbox people have the same TLD... :/Nick Mathewson
2017-09-05Remove changes files that are already merged in 0.3.1.6-rcNick Mathewson
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
"ours" merge to avoid version bump.
2017-09-05Bump to 0.3.1.6-rc-devNick Mathewson
2017-09-05forward-port the 0.3.1.6-rc changelogNick Mathewson
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-05test: Fix memory leak in hs_descriptor/decode_bad_signatureDavid Goulet
Fixes #23319 Cherry-picked from master; bug not in any released Tor.
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
"ours" merge to avoid version bump
2017-09-05Bump version to 0.3.1.6-rcNick Mathewson
2017-09-05Merge branch 'bug23331_032_01_squashed'Nick Mathewson
2017-09-05hs: Don't enter the HS v3 subsystem without a live consensusDavid Goulet
The service needs the latest SRV and set of relays for the best accurate hashring to upload its descriptor to so it needs a live consensus thus don't do anything until we have it. Fixes #23331 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-04Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-04Merge branch 'bug22752_031_simple' into maint-0.3.1Nick Mathewson
2017-09-04Merge remote-tracking branch 'dgoulet/bug23366_032_01'Nick Mathewson
2017-09-04Merge remote-tracking branch 'asn/bug23346'Nick Mathewson
2017-09-04Merge remote-tracking branch 'dgoulet/bug23327_032_01'Nick Mathewson
2017-09-04Merge branch 'bug23360_032_01'Nick Mathewson
2017-09-04hs: Remove dead code and uneeded featureDavid Goulet
When merging #20657, somehow hs_service_dir_info_changed() became unused leading to not use the re-upload to HSDir when we were missing information feature. Turns out that it is not possible to pick an HSDir with a missing descriptor because in order to compute the HSDir index, the descriptor is mandatory to have so we can know its position on the hashring. This commit removes that dead feature and fix the hs_service_dir_info_changed() not being used. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-04Merge remote-tracking branch 'asn/ticket23056_v2'Nick Mathewson
2017-09-0422752: Improve comments to explain why we're doing this fix.Nick Mathewson
Based on questions and comments from dgoulet, I've tried to fill in the reasoning about why these functions work in the way that they do, so that it will be easier for future programmers to understand why this code exists and works the way it does.
2017-09-04Merge branch 'bug22818_squashed'Nick Mathewson
2017-09-04docs: Add notes on behaviours which Rust considers undefined.Isis Lovecruft
2017-09-04docs: More Rust coding standards, based on without boats' comments.Isis Lovecruft
2017-09-04Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-04Merge remote-tracking branch 'public/bug23275_031' into maint-0.3.1Nick Mathewson
2017-08-31config: Make parse_outbound_addresses() return failuresDavid Goulet
The function was never returning an error code on failure to parse the OutboundAddress* options. In the process, it was making our test_options_validate__outbound_addresses() not test the right thing. Fixes #23366 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-30docs: More Rust coding standards w.r.t. fuzzing and safety.Isis Lovecruft
2017-08-30docs: Clarify some portions of the Rust coding standards.Isis Lovecruft
* THANKS TO Henry de Valence for review.
2017-08-30prop224: Clear list of prev hsdirs before we upload all descs.George Kadianakis
This fixes a serious bug in our hsdir set change logic: We used to add nodes in the list of previous hsdirs everytime we uploaded to a new hsdir and we only cleared the list when we built a new descriptor. This means that our prev_hsdirs list could end up with 7 hsdirs, if for some reason we ended up uploading our desc to 7 hsdirs before rebuilding our descriptor (e.g. this can happen if the set of hsdirs changed). After our previous hdsir set had 7 nodes, then our old algorithm would always think that the set has changed since it was comparing a smartlist with 7 elements against a smartlist with 6 elements. This commit fixes this bug, by clearning the prev_hsdirs list before we upload to all hsdirs. This makes sure that our prev_hsdirs list always contains the latest hsdirs!
2017-08-30prop224: Simplify HSDir set change algo.George Kadianakis
Our logic for detecting hsdir set changes was needlessly compicated: we had to sort smartlists and compare them. Instead, we can simplify things by employing the following logic: "We should reupload our descriptor if the latest HSDir set contains nodes that were not previously there"
2017-08-30prop224 test: Improve desc_reupload_logic() test with more nodes.George Kadianakis
2017-08-30prop224 test: Simplify interface for adding nodes to hash ring.George Kadianakis
We want to have tests with big hash rings so let's make it an one-liner to add nodes.
2017-08-29docs: Document coding standards, build instructions, etc. for Rust code.Isis Lovecruft
* FIXES #22818
2017-08-29hs: Implement an HS client free all functionDavid Goulet
Called from main.c, the function for now purges the hidden service directory request cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-29Changes file for bug22752 (simple version)Nick Mathewson
2017-08-29On windows, allow many entries in conscache directoriesNick Mathewson
Since we can't be sure that we can unlink enough files on windows here, let's let the number of permitted entries grow huge if it really must. We do this by letting the storagedir hold lots of entries, but still trying to keep the number of entries under the configured limit. We also have to tell consdiffmgr not to freak out if it can't actually remove enough entries. Part of a fix for bug 22752
2017-08-29On windows, don't force-unlink active conscache objects.Nick Mathewson
Part of a fix for bug 22752: We can't unlink these because Windows doesn't allow you to unlink an in-use file.
2017-08-29Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-29Merge remote-tracking branch 'dgoulet/bug22159_031_01' into maint-0.3.1Nick Mathewson
2017-08-29Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-29Add test_hs_descriptor.inc to include.am to unbreak distcheck.Nick Mathewson