summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2016-06-20Add tor_htonll/ntohll functionsDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-06-20util: zero target buffer of base*_encode/decodeDavid Goulet
Make sure to memset(0) the destination buffer so we don't leave any uninitialized data. Fixes #19462 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-20Small coverage improvements on compat.cNick Mathewson
2016-06-20compat.c coverage: simplify under-tested alloc_getcwd.Nick Mathewson
Yes, HURD lacks PATH_MAX. But we already limited the maximum buffer to 4096, so why not just use that?
2016-06-20More coverage in backtrace.cNick Mathewson
2016-06-20Merge branch 'bug14013_029_01_squashed'Nick Mathewson
2016-06-20Make base16_decodes return number of decoded bytesnikkolasg
base16_decodes() now returns the number of decoded bytes. It's interface changes from returning a "int" to a "ssize_t". Every callsite now checks the returned value. Fixes #14013 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-19Changes file for 19063; use the BUG macroNick Mathewson
2016-06-19Fix #19063: Add check in utility macroU+039b
2016-06-19Merge branch 'zlib_coverage_squashed'Nick Mathewson
2016-06-19Mark some torgzip lines as unreachable/untestable.Nick Mathewson
2016-06-19Remove a ridiculous realloc call from torgzip.cNick Mathewson
realloc()ing a thing in order to try to save memory on it just doesn't make sense with today's allocators. Instead, let's use the fact that whenever we decompress something, either it isn't too big, or we chop it up, or we reallocate it.
2016-06-19Remove support for zlib <= 1.1Nick Mathewson
zlib 1.2 came out in 2003; earlier versions should be dead by now. Our workaround code was only preventing us from using the gzip encoding (if we decide to do so), and having some dead code linger around in torgzip.c
2016-06-19Merge remote-tracking branch 'public/thread_coverage'Nick Mathewson
2016-06-18Keep make check-spaces happyAndrea Shepard
2016-06-17Merge branch 'bug18280_029_03_nm_squashed'Nick Mathewson
2016-06-17Fix base32 API to take any source length in bytesDavid Goulet
Fixes #18280 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-06-17Use the Autoconf macro AC_USE_SYSTEM_EXTENSIONScypherpunks
The Autoconf macro AC_USE_SYSTEM_EXTENSIONS defines preprocessor macros which turn on extensions to C and POSIX. The macro also makes it easier for developers to use the extensions without needing (or forgetting) to define them manually. The macro can be safely used because it was introduced in Autoconf 2.60 and Tor requires Autoconf 2.63 and above.
2016-06-16Mark an abort() as unreachable.Nick Mathewson
2016-06-16Remove parse_config_line_from_str aliasNick Mathewson
All of our code just uses parse_config_line_from_str_verbose.
2016-06-16Mark code unreachable in unescape_string()Nick Mathewson
Also, add tests for it in case someday it does become reachable.
2016-06-16Tests for message rate-limitingNick Mathewson
Also note a bug in the rate-limiting message.
2016-06-16I believe I found some dead code in our time parsing functionsNick Mathewson
2016-06-16tests for size_mul_check__()Nick Mathewson
it's important, and we should make sure we got it right.
2016-06-16Correct the rounding behavior on tv_mdiff.Nick Mathewson
Fix for bug 19428.
2016-06-16add LCOV_EXCL for unreachable exit() blocks in src/commonNick Mathewson
2016-06-15Mark src/common tor_assert(0)/tor_fragile_assert() unreached for coverageNick Mathewson
I audited this to make sure I was only marking ones that really should be unreachable.
2016-06-14Use ENABLE/DISABLE_GCC_WARNING in masater.Nick Mathewson
2016-06-14Merge branch 'maint-0.2.8'Nick Mathewson
2016-06-14Resolve the remaining openssl "-Wredundant-decls" warnings.Nick Mathewson
Another part of 19406
2016-06-14Merge branch 'maint-0.2.8'Nick Mathewson
2016-06-14Bug 19406: OpenSSL removed SSL_R_RECORD_TOO_LARGE in 1.1.0.Yawning Angel
This is a logging onlu change, we were suppressing the severity down to INFO when it occured (treating it as "Mostly harmless"). Now it is no more.
2016-06-14Bug 19406: OpenSSL made RSA and DH opaque in 1.1.0.Yawning Angel
There's accessors to get at things, but it ends up being rather cumbersome. The only place where behavior should change is that the code will fail instead of attempting to generate a new DH key if our internal sanity check fails. Like the previous commit, this probably breaks snapshots prior to pre5.
2016-06-14Bug 19406: OpenSSL changed the Thread API in 1.1.0 again.Yawning Angel
Instead of `ERR_remove_thread_state()` having a modified prototype, it now has the old prototype and a deprecation annotation. Since it's pointless to add extra complexity just to remain compatible with an old OpenSSL development snapshot, update the code to work with 1.1.0pre5 and later.
2016-06-12Keep make check-spaces happyAndrea Shepard
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-06-11Add the -Wextra-semi warning from clang, and fix the cases where it triggersNick Mathewson
2016-06-11Use autoconf, not gcc version, to decide which warnings we haveNick Mathewson
This gives more accurate results under Clang, which can only help us detect more warnings in more places. Fixes bug 19216; bugfix on 0.2.0.1-alpha
2016-06-11Add -Wfloat-conversion for GCC >= 4.9Nick Mathewson
This caught quite a few minor issues in our unit tests and elsewhere in our code.
2016-06-11Enable -Wnull-dereference (GCC >=6.1), and fix the easy casesNick Mathewson
This warning, IIUC, means that the compiler doesn't like it when it sees a NULL check _after_ we've already dereferenced the variable. In such cases, it considers itself free to eliminate the NULL check. There are a couple of tricky cases: One was the case related to the fact that tor_addr_to_in6() can return NULL if it gets a non-AF_INET6 address. The fix was to create a variant which asserts on the address type, and never returns NULL.
2016-06-09Reduce make check-spaces noiseAndrea Shepard
2016-06-08Mark the unreachable lines in compat_{,p}threads and workqueueNick Mathewson
These are all related to failures from functions that either can't fail as we call them, or where we cannot provoke failure.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-05-27Enable the -Waggregate-return warningNick Mathewson
Suppress it in the one spot in the code where we actually do want to allow an aggregate return in order to call the mallinfo() API.
2016-05-27Use ENABLE_GCC_WARNING and DISABLE_GCC_WARNING in tortls.cNick Mathewson
Previously we'd done this ad hoc.
2016-05-27Add support for temporarily suppressing a warningNick Mathewson
There are a few places where we want to disable a warning: for example, when it's impossible to call a legacy API without triggering it, or when it's impossible to include an external header without triggering it. This pile of macros uses GCC's c99 _Pragma support, plus the usual macro trickery, to enable and disable warnings.
2016-05-25Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-25Merge branch 'bug19161_028_v2' into maint-0.2.8Nick Mathewson
2016-05-25Merge branch 'maint-0.2.8'Nick Mathewson