aboutsummaryrefslogtreecommitdiff
path: root/src/ext
AgeCommit message (Collapse)Author
2020-12-17Fix Keccak undefined behavior on exotic platforms.George Kadianakis
Bug reported and diagnosed in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975977 Fixes bug #40210.
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-05-06include compat_compiler for ed25519_donnaNick Mathewson
2019-04-10Prevent double free on huge files with 32 bit.Tobias Stoeckmann
The function compat_getdelim_ is used for tor_getline if tor is compiled on a system that lacks getline and getdelim. These systems should be very rare, considering that getdelim is POSIX. If this system is further a 32 bit architecture, it is possible to trigger a double free with huge files. If bufsiz has been already increased to 2 GB, the next chunk would be 4 GB in size, which wraps around to 0 due to 32 bit limitations. A realloc(*buf, 0) could be imagined as "free(*buf); return malloc(0);" which therefore could return NULL. The code in question considers that an error, but will keep the value of *buf pointing to already freed memory. The caller of tor_getline() would free the pointer again, therefore leading to a double free. This code can only be triggered in dirserv_read_measured_bandwidths with a huge measured bandwith list file on a system that actually allows to reach 2 GB of space through realloc. It is not possible to trigger this on Linux with glibc or other major *BSD systems even on unit tests, because these systems cannot reach so much memory due to memory fragmentation. This patch is effectively based on the penetration test report of cure53 for curl available at https://cure53.de/pentest-report_curl.pdf and explained under section "CRL-01-007 Double-free in aprintf() via unsafe size_t multiplication (Medium)".
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-09Fix (and make consistent) the use of OpenBSD preprocessor macro testsKris Katterjohn
Prior to this commit, the testsuite was failing on OpenBSD. After this commit the testsuite runs fine on OpenBSD. It was previously decided to test for the OpenBSD macro (rather than __OpenBSD__, etc.) because OpenBSD forks seem to have the former macro defined. sys/param.h must be included for the OpenBSD macro definition; however, many files tested for the OpenBSD macro without having this header included. This commit includes sys/param.h in the files where the OpenBSD macro is used (and sys/param.h is not already included), and it also changes some instances of the __OpenBSD__ macro to OpenBSD. See commit 27df23abb675ffeb198bf0c1cc85c4baed77a988 which changed everything to use OpenBSD instead of __OpenBSD__ or OPENBSD. See also tickets #6982 and #20980 (the latter ticket is where it was decided to use the OpenBSD macro). Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2018-09-13Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-13Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-13Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-09-13Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-09-12Check waitpid return value and exit status in tinytest.cNick Mathewson
It's possible for a unit test to report success via its pipe, but to fail as it tries to clean up and exit. Notably, this happens on a leak sanitizer failure. Fixes bug 27658; bugfix on 0.2.2.4-alpha when tinytest was introduced.
2018-09-11Initialize 't' in ge25519_scalarmult_base_niels()Nick Mathewson
OSS-Fuzz's version of memorysanitizer can't tell that this value is not going to be used unsafely.
2018-09-04Update prefork and postfork NSS code for unit tests.Nick Mathewson
2018-07-31Merge branch 'nss_dh_squashed' into nss_dh_squashed_mergedNick Mathewson
2018-07-13Add postfork support for nssNick Mathewson
We need this in our unit tests, since otherwise NSS will notice we've forked and start cussing us out. I suspect we'll need a different hack for daemonizing, but this should be enough for tinytest to work.
2018-07-13Fix forking tests on Windows when there is a space in the path.Alexander Færøy
See: https://bugs.torproject.org/26437
2018-07-10Integrate getdelim() and getline() support into Tor.Nick Mathewson
2018-07-10Add the compatibility definition for getdelim.c from netbsd.Nick Mathewson
We shouldn't actually need this code nearly anywhere we build: getdelim is POSIX, and mingw provides it.
2018-06-29Remove non-windows system includes from compat.h and util.hNick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-16update tor-rust-dependencies submoduleNick Mathewson
2018-05-08Update rust submodule.Nick Mathewson
2018-05-04rust: Update submodule commit for src/ext/rust directory.Isis Lovecruft
* FIXES part of #26024: https://bugs.torproject.org/26024
2018-05-03Update rust dependencies to latest version.Nick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-17Fixup timing wheel warnings related to recent WHEEL_BIT change.Nick Mathewson
2018-04-06refactor: Remove unnecessary `#include "crypto.h"` throughout codebase.Isis Lovecruft
* FIXES part of #24658: https://bugs.torproject.org/24658
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-03-26Merge branch 'bug24658-rm-curve25519-header' into bug24658-mergeNick Mathewson
2018-03-21Update src/ext/rust to latest master for libc update.Nick Mathewson
2018-03-21maint: Update Rust libc dependency from 0.2.22 to 0.2.39.Isis Lovecruft
Requires the update/libc-0.2.39 branch from https://github.com/isislovecruft/tor-rust-dependencies to be merged first.
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-03Include crypto_digest.h in order to solve dependency issues.Fernando Fernandez Mancera
Included crypto_digest.h in some files in order to solve xof+digest module dependency issues. Removed crypto.h where it isn't needed anymore. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-11On shutdown, mark openssl as uninitialized.Nick Mathewson
This causes openssl to get completely reinitialized on startup, which is probably a good idea.
2018-01-03Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-01-03Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2018-01-03Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-12-20Fix the clz32 and clz64 settings on MSVC.Nick Mathewson
Fixes bug 24633; bugfix on 0.2.9.1-alpha.
2017-11-13Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-11-13Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-11-13Merge branch 'bug22895_027' into maint-0.2.9Nick Mathewson
2017-09-19Merge branch 'bug23583_029'Nick Mathewson
2017-09-19Avoid integer error in TEST_BITOPS testsNick Mathewson
If "1" is not 64 bits wide already, then "1 << i" will not actually work. This bug only affects the TEST_BITOPS code, and shouldn't matter for the actual use of the timeout code (except if/when it causes this test to fail). Reported by dcb314@hotmail.com. Fix for bug 23583. Not adding a changes file, since this code is never compiled into Tor.
2017-09-15sched: Groundwork before KIST implementationMatt Traudt
- HT_FOREACH_FN defined in an additional place because nickm did that in an old kist prototype - Make channel_more_to_flush mockable for future sched tests - Add empty scheduler_{vanilla,kist}.c files and put in include.am Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-11Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-11Fix GCC 7 -Wimplicit-fallthrough warningsAndreas Stieger
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.