summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2017-04-27Fix use-after-free bug in storage_dir sandbox code.Nick Mathewson
2017-04-25Use x-lzma, not x-lzma2, as the identifierNick Mathewson
2017-04-25Function to convert compression methods to/from strings.Nick Mathewson
2017-04-25Teach cov-exclude to detect runaway LCOV_EXCL_START linesNick Mathewson
Also, fix two instances of runaway LCOV_EXCL_START lines.
2017-04-25Whitespace fixes.Nick Mathewson
2017-04-25Merge branch 'unified_compress_squashed'Nick Mathewson
2017-04-25zlib: Turn UINT_MAX overrun into an error, not an assert.Nick Mathewson
2017-04-25Add a "best compression" flag.Nick Mathewson
2017-04-25Combine all *compress/*uncompress backend function into oneNick Mathewson
Since we have a streaming API for each compression backend, we don't need a non-streaming API for each: we can build a common non-streaming API at the front-end.
2017-04-25Use atomic counters for compressor allocation.Nick Mathewson
2017-04-25Rename shadowing variable in compress_zlib.c.Alexander Færøy
This patch renames the `compress` parameter of the `tor_zlib_compress_new()` function to `_compress` to avoid shadowing the `compress()` function in zlib.h.
2017-04-25Merge branch 'ahf_prop278_21662_squashed'Nick Mathewson
2017-04-25Fix newlines in compression headers.Alexander Færøy
See: https://bugs.torproject.org/21662
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-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-25Add Zstandard support.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Add LZMA support.Alexander Færøy
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-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-15Expand cpuworker API to allow other work typesNick Mathewson
2017-04-15Add a config_line_prepend() functionNick Mathewson
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-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
2017-04-07Merge branch 'ticket21842_squashed'Nick Mathewson
2017-04-07Remove tor-checkkey as obsoleteNick Mathewson
CVE-2008-0166 is long gone, and we no longer need a helper tool to dump out public key moduli so folks can detect it. Closes ticket 21842.
2017-04-07Never read off the end of a buffer in base32_encode()Nick Mathewson
When we "fixed" #18280 in 4e4a7d2b0c199227252a742541461ec4cc35d358 in 0291 it appears that we introduced a bug: The base32_encode function can read off the end of the input buffer, if the input buffer size modulo 5 is not equal to 0 or 3. This is not completely horrible, for two reasons: * The extra bits that are read are never actually used: so this is only a crash when asan is enabled, in the worst case. Not a data leak. * The input sizes passed to base32_encode are only ever multiples of 5. They are all either DIGEST_LEN (20), REND_SERVICE_ID_LEN (10), sizeof(rand_bytes) in addressmap.c (10), or an input in crypto.c that is forced to a multiple of 5. So this bug can't actually trigger in today's Tor. Closes bug 21894; bugfix on 0.2.9.1-alpha.
2017-04-07Comment fix. (Catalyst spotted this)Nick Mathewson
2017-04-07Merge branch 'isolate_openssl'Nick Mathewson
2017-04-07Make the warnings about terminating nuls a bit strongerNick Mathewson
It looks like 32_encoded_size/64_encode_size APIs are inconsistent not only in the number of "d"s they have, but also in whether they count the terminating NUL. Taylor noted this in 86477f4e3fedb316, but I think we should note the inconsistently more loudly in order to avoid trouble. (I ran into trouble with this when writing 30b13fd82e243713c6a0d.)
2017-04-06Use baseXX length macros in baseXX_encode()Taylor Yu
Use the new baseXX length macros to clean up the length checks in the baseXX_encode() functions.
2017-04-06Add macros for baseXX encoding lengthsTaylor Yu
2017-04-06Make CEIL_DIV() slightly more overflow-safeTaylor Yu
2017-04-06Explain config_line_find() behavior on duplicates.Nick Mathewson
2017-04-06Add an assertion to config_line_append().Nick Mathewson
2017-04-06Add some "labeled storagedir" abstractions.Nick Mathewson
These add a tiny bit of structure on top of the regular storagedir abstractions in order to store key-value lists at the head of each document.
2017-04-04Move config line parsing function to confline.cNick Mathewson
2017-04-04Move config_line_t functions from confparse.c into common.Nick Mathewson
I'm doing this to storagedir to used config_line_t.