aboutsummaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2019-06-26resolve: consistently parse IP addresses in square bracketsteor
When parsing addreses via Tor's internal DNS lookup API: * reject IPv4 addresses in square brackets (with or without a port), * accept IPv6 addresses in square brackets (with or without a port), and * accept IPv6 addresses without square brackets, as long as they have no port. This change completes the work started in 23082, making address parsing consistent between tor's internal DNS lookup and address parsing APIs. Fixes bug 30721; bugfix on 0.2.1.5-alpha.
2019-05-30Merge branch 'tor-github/pr/1054'David Goulet
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
2019-05-29Merge branch 'ticket30561_029' into ticket30561_035Nick Mathewson
2019-05-29Use MAP_INHERIT_ZERO or MAP_INHERIT_NONE if available.Taylor R Campbell
Fixes assertion failure in tests on NetBSD: slow/prob_distr/stochastic_log_logistic: [forking] May 25 03:56:58.091 [err] tor_assertion_failed_(): Bug: src/lib/crypt_ops/crypto_rand_fast.c:184: crypto_fast_rng_new_from_seed: Assertion inherit != INHERIT_RES_KEEP failed; aborting. (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) May 25 03:56:58.091 [err] Bug: Assertion inherit != INHERIT_RES_KEEP failed in crypto_fast_rng_new_from_seed at src/lib/crypt_ops/crypto_rand_fast.c:184: . (Stack trace not available) (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) [Lost connection!]
2019-05-28Trivial fix for a trivial warning with gcc 9.1.1Nick Mathewson
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any released Tor.
2019-05-23In coverage builds, use branch-free timeradd() and timersub()Nick Mathewson
The ordinary definitions of timeradd() and timersub() contain a branch. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-23In coverage builds, avoid basic-block complexity in log_debugNick Mathewson
Ordinarily we skip calling log_fn(LOG_DEBUG,...) if debug logging is completely disabled. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-07Merge branch 'tor-github/pr/994'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Merge branch 'tor-github/pr/954'David Goulet
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-30Use safe_mem_is_zero in a few more places.Nick Mathewson
I don't believe any of these represent a real timing vulnerability (remote timing against memcmp() on a modern CPU is not easy), but these are the ones where I believe we should be more careful.
2019-04-30Rename tor_mem_is_zero to fast_mem_is_zero()Nick Mathewson
For memeq and friends, "tor_" indicates constant-time and "fast_" indicates optimized. I'm fine with leaving the constant-time "safe_mem_is_zero" with its current name, but the "tor_" prefix on the current optimized version is misleading. Also, make the tor_digest*_is_zero() uniformly constant-time, and add a fast_digest*_is_zero() version to use as needed. A later commit in this branch will fix all the users of tor_mem_is_zero(). Closes ticket 30309.
2019-04-30Merge branch 'tor-github/pr/936'George Kadianakis
2019-04-30Merge branch 'tor-github/pr/980'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-30Merge branch 'tor-github/pr/909'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-30Add improved debugging support to crypto_rand_fast code.Nick Mathewson
2019-04-30Extract add-entropy code from crypto_fast_rng to a new functionNick Mathewson
2019-04-25Add rudimentary qstring support to kvline.cNick Mathewson
2019-04-25Move and rename decode_escaped_string()Nick Mathewson
This function decodes something different from the usual c-escaped format. It is only used in controller authorization.
2019-04-25Add a case-insensitive variant to config_line_find()Nick Mathewson
2019-04-25kvline: handle empty alues as well as empty keysNick Mathewson
The two options are mutually exclusive, since otherwise an entry like "Foo" would be ambiguous. We want to have the ability to treat entries like this as keys, though, since some controller commands interpret them as flags.
2019-04-25Merge branch 'tor-github/pr/953'George Kadianakis
2019-04-24Merge branch 'tor-github/pr/951'David Goulet
2019-04-24Merge branch 'tor-github/pr/955'David Goulet
2019-04-18Merge branch 'tor-github/pr/938'George Kadianakis
2019-04-18Merge branch 'maint-0.4.0'George Kadianakis
2019-04-18Merge branch 'tor-github/pr/891' into maint-0.4.0George Kadianakis
2019-04-17Do not warn about compatible OpenSSL upgradesBernhard M. Wiedemann
When releasing OpenSSL patch-level maintenance updates, we do not want to rebuild binaries using it. And since they guarantee ABI stability, we do not have to. Without this patch, warning messages were produced that confused users: https://bugzilla.opensuse.org/show_bug.cgi?id=1129411 Fixes bug 30190; bugfix on 0.2.4.2-alpha commit 7607ad2bec Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2019-04-15Clear memory in smartlist_remove_keeporder.Tobias Stoeckmann
The smartlist functions take great care to reset unused pointers inside the smartlist memory to NULL. The function smartlist_remove_keeporder does not clear memory in such way when elements have been removed. Therefore call memset after the for-loop that removes elements. If no element is removed, it is effectively a no-op. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-04-15Fix assertf() issues when ALL_BUGS_ARE_FATAL is defined.Nick Mathewson
Fix from Gisle Vanem; fixes bug 30179. Bug not in any released version of Tor.
2019-04-15Merge branch 'bug30189_035' into bug30189_041Nick Mathewson
2019-04-15Use a tor_abort_() wrapper in our util_bug.h macrosNick Mathewson
Previously, our use of abort() would break anywhere that we didn't include stdlib.h. This was especially troublesome in case where tor_assert_nonfatal() was used with ALL_BUGS_ARE_FATAL, since that one seldom gets tested. As an alternative, we could have just made this header include stdlib.h. But that seems bloaty. Fixes bug 30189; bugfix on 0.3.4.1-alpha.
2019-04-12Merge branch 'tor-github/pr/908'George Kadianakis
2019-04-12Merge branch 'tor-github/pr/754'George Kadianakis
2019-04-12crypt_ops: Stop using a separate buffer in ed25519_signature_from_base64()teor
Part of 29960.
2019-04-11Remove an extraneous _ from __COVERITY__Nick Mathewson
We had a typo in this check, so that coverity wasn't taking the right path. Bug not in any released Tor.
2019-04-11Don't leak on logic error in string_is_valid_nonrfc_hostname()Nick Mathewson
This is CID 1437438. No backport needed: this is unreachable, and guarded with a BUG() check.
2019-04-10Merge branch 'maint-0.4.0'teor
2019-04-10Merge remote-tracking branch 'tor-github/pr/920' into maint-0.4.0teor
2019-04-06Merge branch 'maint-0.4.0'teor
2019-04-06Merge remote-tracking branch 'tor-github/pr/911' into maint-0.4.0teor
2019-04-06NSS: disable TLS1.2 SHA-384 ciphersuites.Nick Mathewson
In current NSS versions, these ciphersuites don't work with SSL_ExportKeyingMaterial(), which was causing relays to fail when they tried to negotiate the v3 link protocol authentication. Fixes bug 29241; bugfix on 0.4.0.1-alpha.
2019-04-06NSS: Log an error message when SSL_ExportKeyingMaterial() failsNick Mathewson
Diagnostic for 29241.
2019-04-05Merge branch 'maint-0.4.0'George Kadianakis
2019-04-05Merge branch 'tor-github/pr/902' into maint-0.4.0George Kadianakis
2019-04-05Merge branch 'tor-github/pr/761'George Kadianakis
2019-04-05binascii: Fix the base64_encode_nopad() buffer length requirementteor
Comment-only change. Part of 29660.
2019-04-05crypto_format: Stop adding padding in ed25519_signature_from_base64()teor
base64_decode() does not require padding. Part of 29660.