summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2019-01-03Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2019-01-03Detect openssl bug 7712 and work around it.Nick Mathewson
In theory it would be better to detect this bug in advance, but this approach is much simpler, and therefore safer to backport. This closes tor issue 28973.
2018-11-15Merge branch 'bug25573-034-typefix' into maint-0.3.4Nick Mathewson
2018-11-13Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-11-13Merge branch 'maint-0.2.9' into maint-0.3.3Nick Mathewson
2018-11-12Fix a compiler warning in aes.c.Nick Mathewson
Apparently some freebsd compilers can't tell that 'c' will never be used uninitialized. Fixes bug 28413; bugfix on 0.2.9.3-alpha when we added support for longer AES keys to this function.
2018-11-11Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-11-11Merge branch 'maint-0.2.9' into maint-0.3.3Nick Mathewson
2018-11-11Fix a bug in usage of SSL_set1_groups_list()Nick Mathewson
Apparently, even though the manpage says it returns an int, it can return a long instead and cause a warning. Bug not in any released Tor. Part of #28399
2018-11-09Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-11-09Merge branch 'maint-0.2.9' into maint-0.3.3Nick Mathewson
2018-11-09Always declare groups when building with openssl 1.1.1 APIsNick Mathewson
Failing to do on clients was causing TLS 1.3 negotiation to fail. Fixes bug 28245; bugfix on 0.2.9.15, when we added TLS 1.3 support.
2018-10-15Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-15Merge branch 'maint-0.2.9' into maint-0.3.3Nick Mathewson
2018-10-15Fix make check-spaces.Nick Mathewson
2018-10-15Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-15Adjust tor_assert_unreached()Nick Mathewson
This version of the macro makes it obvious to the compiler that "tor_assert_unreached()" will always abort().
2018-10-15Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-15Merge branch 'maint-0.2.9' into maint-0.3.3Nick Mathewson
2018-10-15Explain a bit more about branch prediction in the unit-test caseNick Mathewson
2018-09-24Fix the 0.3.4 part of bug 27781 (arm compilation)Nick Mathewson
Because with arm on OpenSSL <1.1 we don't define USE_EVP_AES_CTR, we need to include crypto_util.h here.
2018-09-14Revise our assertion and bug macros to work with -WparenthesesNick Mathewson
On GCC and Clang, there's a feature to warn you about bad conditionals like "if (a = b)", which should be "if (a == b)". However, they don't warn you if there are extra parentheses around "a = b". Unfortunately, the tor_assert() macro and all of its kin have been passing their inputs through stuff like PREDICT_UNLIKELY(expr) or PREDICT_UNLIKELY(!(expr)), both of which expand to stuff with more parentheses around "expr", thus suppressing these warnings. To fix this, this patch introduces new macros that do not wrap expr. They're only used when GCC or Clang is enabled (both define __GNUC__), since they require GCC's "({statement expression})" syntax extension. They're only used when we're building the unit-test variant of the object files, since they suppress the branch-prediction hints. I've confirmed that tor_assert(), tor_assert_nonfatal(), tor_assert_nonfatal_once(), BUG(), and IF_BUG_ONCE() all now give compiler warnings when their argument is an assignment expression. Fixes bug 27709. Bugfix on 0.0.6, where we first introduced the "tor_assert()" macro.
2018-09-14Make circuitmux ewma timing test more tolerant on 32bit osxNick Mathewson
Since we use a 32-bit approximation for millisecond conversion here, we can't expect so much precision. Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
2018-09-14Avoid integer overflow on fast 32-bit millisecond conversion.Nick Mathewson
Multiply-then-divide is more accurate, but it runs into trouble when our input is above INT32_MAX/numerator. So when our value is too large, do divide-then-multiply instead. Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
2018-09-14Use a slightly more accurate formula for OSX 32-bit msec conversionNick Mathewson
We use an optimized but less accurate formula for converting coarse time differences to milliseconds on 32-bit OSX platforms, so that we can avoid 64-bit division. The old numbers were off by 0.4%. The new numbers are off by .006%. This should make the unit tests a bit cleaner, and our tolerances a bit closer.
2018-09-07Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-09-07Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-07Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-09-07Tell openssl to build its TLS contexts with security level 1Nick Mathewson
Fixes bug 27344, where we'd break compatibility with old tors by rejecting RSA1024 and DH1024.
2018-09-07Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-09-07Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-07Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-09-07Windows: Silence a spurious warning in the GetAdaptersAddresses castteor
GetProcAddress() returns FARPROC, which is (long long int(*)()) on 64-bit Windows: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx But GetAdaptersAddresses() is (long unsigned int(*)()), on both 32-bit and 64-bit Windows: https://docs.microsoft.com/en-us/windows/desktop/api/iphlpapi/nf-iphlpapi-getadaptersaddresses So gcc 8 issues a spurious "incompatible function pointer" warning about the cast to GetAdaptersAddresses_fn_t. Silence this warning by casting to a void function pointer, before the cast to GetAdaptersAddresses_fn_t. This issue is already fixed by 26481 in 0.3.5 and later, by removing the lookup and cast. Fixes bug 27465; bugfix on 0.2.3.11-alpha.
2018-08-29Mark smartlist_bsearch as taking a const list.Mike Perry
It does not modify the actual list.
2018-08-21Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-08-21Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-08-21Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-08-20Use our x509 wrapper code in tor_tls_cert_matches_key()Nick Mathewson
This allows us to mock our own tor_tls_get_peer_certificate() function in order to test ..cert_matches_key(), which will in turn allow us to simplify test_tortls_cert_matches_key() considerably. Prep work for the fix for 27226.
2018-08-15Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-08-08Detect broken stdatomic.h, and pretend that it isn't there at allNick Mathewson
I hope that the debian clang maintainers will look at debian bug 903709 soon. But until they do, this should keep our users and our CI happy on sid with clang. Closes ticket 26779.
2018-08-08Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-08-08Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-08-08Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-08-08Fix crash when calling openat with sandbox enabled #25440Daniel Pinto
The seccomp rule for the openat syscall checks for the AT_FDCWD constant. Because this constant is usually a negative value, a cast to unsigned int is necessary to make sure it does not get converted to uint64_t used by seccomp. More info on: https://github.com/seccomp/libseccomp/issues/69#issuecomment-273805980
2018-07-30Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-07-30Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-07-26Don't disable an unsupported compiler warningTaylor Yu
Conditionalize the pragma that temporarily disables -Wunused-const-variable. Some versions of gcc don't support it. We need to do this because of an apparent bug in some libzstd headers. Fixes bug 26785; bugfix on 0.3.2.11.
2018-06-20eol@eof is still the law in 0.3.4 :(Nick Mathewson
2018-06-20Fix clang warnings introduced by 9f2b887c5d251b93ee9def708Nick Mathewson
2018-06-13Merge remote-tracking branch 'rl1987/bug24891'Nick Mathewson