aboutsummaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2017-09-29Make some assertions nonfatal to help prevent bug23690 recurrence.Nick Mathewson
2017-09-28Better error handling when trying to compress/decompress into empty buffer.Alexander Færøy
This patch ensures that we return TOR_COMPRESS_BUFFER_FULL in case we have a input bytes left to process, but are out of output buffer or in case we need to finish where the compression implementation might need to write an epilogue. See: https://bugs.torproject.org/23551
2017-09-28Fix whitespace issue in compress.cAlexander Færøy
2017-09-28Fix typo in buffers.c.Alexander Færøy
2017-09-28Improve unit test coverage for compression code.Nick Mathewson
These tests try uncompressing garbage, verify that we won't make compression bombs, and verify that we won't uncompress compression bombs.
2017-09-28Fix spelling: compressing, not compresingNick Mathewson
2017-09-28Correct docs for config_lines_dup_and_filterNick Mathewson
2017-09-28Move around some LCOV_EXCLs in src/commonNick Mathewson
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
2017-09-28Note an unreachable (?) section in buffers.cNick Mathewson
2017-09-20Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-20in zstd compression, fix 32 bit buildAndreas Stieger
format '%lu' expects argument of type 'long unsigned int', but argument ... has type 'size_t' Closes ticket 23568.
2017-09-19Add a BASE32_DIGEST_LEN defineDavid Goulet
Use this value instead of hardcoded values of 32 everywhere. This also addresses the use of REND_DESC_ID_V2_LEN_BASE32 in hs_lookup_last_hid_serv_request() for the HSDir encoded identity digest length which is accurate but semantically wrong. Fixes #23305. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15Split some long #if lines to make the #endif annotator happyNick Mathewson
2017-09-15Merge branch 'bug23487_029'Nick Mathewson
2017-09-15Use different variable names for pw_uid usagesNick Mathewson
Catalyst points out that using pw_uid for two different purposes here is likely to be confusing.
2017-09-15Merge remote-tracking branch 'dgoulet/ticket12541_032_02'Nick Mathewson
2017-09-15sched: Add sandbox support for KISTDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Explain the restrictions on divisor in round*_to_next_multiple_ofteor
Closes 23528.
2017-09-12Fix warnings about passing uninitialized buffers into functionsNick Mathewson
Most of these buffers were never actually inspected, but it's still bad style.
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-09-12clang scan-build: Fix "dead increment" warnings.Nick Mathewson
For the most part, these indicated a spot where the code could have been better.
2017-09-12Log correctly on owner/user mismatch.Nick Mathewson
Found with clang's scan-build while looking at dead assignments. Fixes bug 23487; bugfix on 1135405c8c6ea31 in 0.2.9.1-alpha
2017-09-12One more implicit fallthrough warning to fix on GCC 7Nick Mathewson
2017-09-11Fix mixed-sign comparison warning in fix for 22797.Nick Mathewson
2017-09-11Merge branch 'teor-bug22797-025' into maint-0.2.9Nick Mathewson
2017-09-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-11Extract the important parts of the run-pending-timers function.Nick Mathewson
Our unit tests will need this, so that they can simulate advancing time without getting libevent involved.
2017-09-08Merge branch 'ticket20119'Nick Mathewson
2017-09-07Add a module comment to util_bug.hNick Mathewson
Closes ticket 22824.
2017-09-06Better error on failure to load seccomp2 sandboxNick Mathewson
There are two reasons this is likeliest to happen -- no kernel support, and some bug in Tor. We'll ask people to check the former before they report. Closes 23090.
2017-09-06Exit when we can't write to a configured pid fileNick Mathewson
This is probably what the user wants, according to 20119.
2017-09-05Make preferred_chunk_size nonstatic, and add a prefix to itNick Mathewson
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-08-28Merge branch 'bug22802_squashed'Nick Mathewson
2017-08-28Don't fall back to _atoi64Nick Mathewson
We only did this on windows when building with MSVC 6 and earlier, which is now considered a screamingly bad idea.
2017-08-28Don't use "0" as a "base" argument to tor_parse_*().Nick Mathewson
Telling these functions to autodetect the numeric base has lead to trouble in the past. Fixes bug 22469. Bugfix on 0.2.2.various.
2017-08-25Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-24Fix a needless line-continuation in aes.cNick Mathewson
coccinelle was getting confused
2017-08-24Apply test-operator-cleanup to src/common too.Nick Mathewson
2017-08-24Merge branch 'feature22976_squashed'Nick Mathewson
2017-08-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-09Treat a bad tor_spawn_background() as a BUG().Nick Mathewson
The contract is that, if may_spawn_background_process() is 0, you're not even allowed to try to spawn a process.
2017-08-09Add a 'NoExec' option that causes tor_spawn_background() to failNick Mathewson
Core of an implementation for 22976.
2017-08-09Remove the #if 0ed code that was supposed to let the sandbox allow execNick Mathewson