aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-25Remove `tor_compress_memory_level()`.Alexander Færøy
This patch splits up `tor_compress_memory_level()` into static functions in the individual compression backends, which allows us to tune the values per compression backend rather than globally. See: https://bugs.torproject.org/21662
2017-04-25Use switch-statement in tor_{compress,uncompress}.Alexander Færøy
Use a switch-statement in `tor_compress()` and `tor_uncompress()` for the given `compress_method_t` parameter. This allows us to have the compiler detect if we forgot add a handler in these functions for a newly added enumeration value. See: https://bugs.torproject.org/21662
2017-04-25Use `tor_compress_supports_method()` before printing library versions.Alexander Færøy
This patch ensures that Tor checks if a given compression method is supported before printing the version string when calling `tor --library-versions`. Additionally, we use the `tor_compress_supports_method()` to check if a given version is supported for Tor's start-up version string, but here we print "N/A" if a given compression method is unavailable. See: https://bugs.torproject.org/21662
2017-04-25Add API entry-point for getting compression method version numbers.Alexander Færøy
This patch adds `tor_compress_version_str()` and `tor_compress_header_version_str()` to get the version strings of the different compression schema providers. Both functions returns `NULL` in case a given `compress_method_t` is unknown or unsupported. See: https://bugs.torproject.org/21662
2017-04-25Add function to check if a given compression method is supported.Alexander Færøy
This patch adds support for checking if a given `compress_method_t` is supported by the currently running Tor instance using `tor_compress_supports_method()`. See: https://bugs.torproject.org/21662
2017-04-25Add `tor_compress_get_total_allocation()` function.Alexander Færøy
This patch adds the `tor_compress_get_total_allocation()` which returns an approximate number of bytes currently in use by all the different compression backends. See: https://bugs.torproject.org/21662
2017-04-25Display LZMA and Zstandard versions when starting Tor.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Show liblzma and libzstd versions in `tor --library-versions`.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Add Zstandard support.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Add --enable-zstd to our configure script.Alexander Færøy
This patch adds support for enabling support for Zstandard to our configure script. By default, the --enable-zstd option is set to "auto" which means if libzstd is available we'll build Tor with Zstandard support. See: https://bugs.torproject.org/21662
2017-04-25Add LZMA support.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Add --enable-lzma to our configure script.Alexander Færøy
This patch adds support for enabling support for LZMA to our configure script. By default, the --enable-lzma option is set to "auto" which means if liblzma is available we'll build Tor with LZMA support. See: https://bugs.torproject.org/21662
2017-04-25Use a switch-statement when checking for compression method.Alexander Færøy
This patch changes the way `tor_compress_new()`, `tor_compress_process()`, and `tor_compress_free()` handles different compression methods. This should give us compiler warnings in case an additional compression method is added, but the developer forgets to add handlers in the three aforementioned functions. See https://bugs.torproject.org/21663
2017-04-25Add `compress_zlib.obj` to `src/common/Makefile.nmake`.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-25Rename the `torgzip` module to `compress`.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-25Move zlib compression code into its own module.Alexander Færøy
This patch refactors the `torgzip` module to allow us to extend a common compression API to support multiple compression backends. Additionally we move the gzip/zlib code into its own module under the name `compress_zlib`. See https://bugs.torproject.org/21664
2017-04-18Expose `tor_compress_is_compression_bomb()` as part of the public ↵Alexander Færøy
compression API. This patch exposes the old `is_compression_bomb()` function as a public API as part of the compression module. See https://bugs.torproject.org/21663
2017-04-18Expose `tor_compress_memory_level()` as a public function in the compression ↵Alexander Færøy
module. This patch makes the internal `get_memlevel()` a part of the public compression API as `tor_compress_memory_level()`. See https://bugs.torproject.org/21663
2017-04-18Rename `write_to_buf_zlib()` to `write_to_buf_compress()`.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-18Rename `zlib_state` to `compress_state` in the test_buffers.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-18Rename `zlib_state` to `compress_state` in `dir_connection_t`.Alexander Færøy
This patch renames the `zlib_state` field in `dir_connection_t` to `compress_state`. See https://bugs.torproject.org/21663
2017-04-17Refactor the streaming compression code.Alexander Færøy
This patch refactors our streaming compression code to allow us to extend it with non-zlib/non-gzip based compression schemas. See https://bugs.torproject.org/21663
2017-04-17Rename `tor_gzip_{compress,uncompress}` to `tor_{compress,uncompress}`.Alexander Færøy
To allow us to use the API name `tor_compress` and `tor_uncompress` as the main entry-point for all compression/uncompression and not just gzip and zlib. See https://bugs.torproject.org/21663
2017-04-17Rename `zlib_compression_level_t` to `compression_level_t`.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-17Remove unused function `is_gzip_supported()`.Alexander Færøy
This patch removes the unused `is_gzip_supported()` and changes the documentation string around the `compress_method_t` enumeration to explicitly state that both `ZLIB_METHOD` and `GZIP_METHOD` are both always supported. Zlib version 1.2.0 was released on the 9'th of March, 2003 according to their ChangeLog. See https://bugs.torproject.org/21663
2017-04-17Fix whitespace in test_util_gzip() around `OP_*``.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-17Use tt_int_op() over tt_assert() and do explicit NULL checks in ↵Alexander Færøy
test_util_gzip(). This patch changes some of the tt_assert() usage in test_util_gzip() to use tt_int_op() to get better error messages upon failure. Additionally we move to use explicit NULL checks. See https://bugs.torproject.org/21663
2017-04-13Merge branch 'ticket21891_031_01_squashed'Nick Mathewson
2017-04-13hs: Make the service list pruning function publicDavid Goulet
The reason for making the temporary list public is to keep it encapsulated in the rendservice subsystem so the prop224 code does not have direct access to it and can only affect it through the rendservice pruning function. It also has been modified to not take list as arguments but rather use the global lists (main and temporary ones) because prop224 code will call it to actually prune the rendservice's lists. The function does the needed rotation of pointers between those lists and then prune if needed. In order to make the unit test work and not completely horrible, there is a "impl_" version of the function that doesn't free memory, it simply moves pointers around. It is directly used in the unit test and two setter functions for those lists' pointer have been added only for unit test. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-13fix wide linesNick Mathewson
2017-04-13Merge branch 'ticket21889_031_01_squashed'Nick Mathewson
2017-04-13hs: Add service-side circuitmap API.George Kadianakis
Now we have separate getters and setters for service-side and relay-side. I took this approach over adding arguments to the already existing methods to have more explicit type-checking, and also because some functions would grow too large and dirty. This commit also fixes every callsite to use the new function names which modifies the legacy HS (v2) and the prop224 (v3) code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-13Merge remote-tracking branch 'dgoulet/bug21155_031_02'Nick Mathewson
2017-04-13Merge remote-tracking branch 'dgoulet/ticket21919_031_01'Nick Mathewson
2017-04-13Merge branch 'asn/prop224-ntor-v2-squashed'Nick Mathewson
2017-04-13prop224: Add Python integration tests for HS ntor.George Kadianakis
This test is identical to the ./src/test/test_ntor.sh integration test.
2017-04-13prop224: Add basic HS ntor unittest.George Kadianakis
The test checks that introduce1/rendezvous1 key material is generated correctly both for client-side and service-side.
2017-04-13prop224: Add module that performs the HS ntor handshake.George Kadianakis
and also does the key expansion.
2017-04-12hs: Make check-spaces happy after renameDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-11hs: Change trunnel prop224 cell's namespaceDavid Goulet
One of the goals of this change is to have trunnel API/ABI being more explicit so we namespace them with "trn_*". Furthermore, we can now create hs_cells.[ch] without having to confuse it with trunnel which used to be "hs_cell_*" before that change. Here are the perl line that were used for this rename: perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/*/*.[ch] perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/trunnel/hs/*.trunnel perl -i -pe 's/hs_cell_/trn_cell_/g;' src/*/*.[ch] perl -i -pe 's/hs_cell_/trn_cell_/g;' src/trunnel/hs/*.trunnel And then "./scripts/codegen/run_trunnel.sh" with trunnel commit id 613fb1b98e58504e2b84ef56b1602b6380629043. Fixes #21919 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-10config: Warn if EntryNodes and HiddenService are used togetherDavid Goulet
Pinning EntryNodes along with hidden services can be possibly harmful (for instance #14917 and #21155) so at the very least warn the operator if this is the case. Fixes #21155 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-10Merge remote-tracking branch 'dgoulet/bug16706_031_01'Nick Mathewson
2017-04-10Fix some no-longer-reasonable unit tests for base64_decode()Nick Mathewson
These tests tried to use ridiculously large buffer sizes to check the sanity-checking in the code; but since the sanity-checking changed, these need to change too.
2017-04-10changes file for 17868Nick Mathewson
2017-04-07Remove SR_COMMIT_LEN workaroundTaylor Yu
Now that base64_decode() checks the destination buffer length against the actual number of bytes as they're produced, shared_random.c no longer needs the "SR_COMMIT_LEN+2" workaround.
2017-04-07Remove base64_decode_nopad()Taylor Yu
Remove base64_decode_nopad() because it is redundant now that base64_decode() correctly handles both padded and unpadded base64 encodings with "right-sized" output buffers.
2017-04-07Test odd-sized base64 decodesTaylor Yu
Test base64_decode() with odd sized decoded lengths, including unpadded encodings and padded encodings with "right-sized" output buffers. Convert calls to base64_decode_nopad() to base64_decode() because base64_decode_nopad() is redundant.
2017-04-07Make base64_decode() check actual decoded lengthTaylor Yu
base64_decode() was applying an overly conservative check on the output buffer length that could incorrectly produce an error if the input encoding contained padding or newlines. Fix this by checking the output buffer length against the actual decoded length produced during decoding.
2017-04-07Merge branch 'maint-0.3.0'Nick Mathewson
2017-04-07Merge remote-tracking branch 'public/bug21894_029' into maint-0.3.0Nick Mathewson