Commit Graph

257 Commits

Author SHA1 Message Date
Nick Mathewson
92db96d80f Make our crypto library symbolic in the makefiles. 2018-07-11 12:51:36 -04:00
Nick Mathewson
cade65fd2e Add "check-includes" to check-local. 2018-07-09 15:55:03 -04:00
Nick Mathewson
4ff93dd94f Merge remote-tracking branch 'rl1987/doc26638' 2018-07-09 09:40:04 -04:00
Nick Mathewson
5f51c2de8b Fix our build system to know the new locations of the src/or stuff 2018-07-05 17:15:50 -04:00
Nick Mathewson
81cb0afb2b Start splitting src/or
This is a very gentle commit that just lays the groundwork in the
build system: it puts the include files to build libtor-app.a into
src/core, and to build the tor executable into src/app.  The
executable is now "src/app/tor".
2018-07-05 17:15:50 -04:00
Nick Mathewson
1e417b7275 All remaining files in src/common belong to the event loop. 2018-07-05 15:22:17 -04:00
rl1987
287b64ee10 Add CODE_OF_CONDUCT file 2018-07-05 11:22:33 +03:00
Nick Mathewson
7b1832d011 Add make targets to show static libraries.
These might make it easier for people to link our stuff, and keep
their scripts more robust.
2018-07-01 10:08:54 -04:00
Nick Mathewson
43dc92441d Tabify all of the .am files. 2018-07-01 09:37:28 -04:00
Nick Mathewson
028523c801 Merge branch 'maint-0.3.4' 2018-06-30 09:15:39 -04:00
Nick Mathewson
4e11c2ca6c Extract getpass to a new lib/term library
(Term is short for terminal)
2018-06-29 12:21:52 -04:00
Nick Mathewson
e0957022bd Extract get_uname to lib/osinfo. 2018-06-29 12:21:52 -04:00
Nick Mathewson
0362cdc169 Move fd and memory-info functions. 2018-06-29 12:21:52 -04:00
Nick Mathewson
0f02d2c041 Fix windows compilation in compat_time
We need to use lib/fs/winlib.h here so that we can use
GetTickCount64.

I would love to declare that XP is dead, and everybody has
GetTickCount64.
2018-06-28 13:40:21 -04:00
Nick Mathewson
a097ddb4f5 Extract time functionality into lib/wallclock and lib/time 2018-06-28 13:01:54 -04:00
Nick Mathewson
bdea94a665 Move floating-point math functions into a new lib/math 2018-06-28 12:24:45 -04:00
Nick Mathewson
315e6b59dd Extract process-management functionality into a new lib/process
Note that procmon does *not* go here, since procmon needs to
integrate with the event loop.
2018-06-28 11:18:13 -04:00
Nick Mathewson
eee86e627b Extract memarea into its own library 2018-06-28 09:25:18 -04:00
Nick Mathewson
9cf335c9a5 Extract threading code into a new library.
Note that the workqueue code does *not* go here: it is logically at
a higher level, since it needs to use libevent and the networking
stack.
2018-06-28 09:14:42 -04:00
Nick Mathewson
235ddb15a0 Move util_format into a new libtor-encoding library
libtor-encoding is about various ways to transform data to and from
character sequences.
2018-06-27 16:18:42 -04:00
Alex Xu (Hello71)
614a78ddaa Fix Rust cross compilation. 2018-06-27 14:42:06 -05:00
Nick Mathewson
000de2f2ac Merge branch 'fs_refactor' 2018-06-27 14:45:17 -04:00
Nick Mathewson
2113603718 Merge branch 'sandbox_refactor' 2018-06-27 14:45:14 -04:00
Nick Mathewson
b9b05e437d Merge branch 'net_refactor' 2018-06-27 12:52:31 -04:00
Nick Mathewson
1e2e0f7e46 Extract functions from compat.c and util.h into a new fs library 2018-06-27 12:30:11 -04:00
Nick Mathewson
bee580ddba Move sandbox code into a new library. 2018-06-27 10:04:17 -04:00
Nick Mathewson
42b3caa6ad Move network code to libtor-net.
There are some additional changes to come: those points are marked
by XXXX.
2018-06-27 09:08:35 -04:00
Nick Mathewson
b1de1e7a77 Extract core part of smartlist code into its own library.
The smartlist_core library now contains only the parts of smartlists
that are needed for the logging library.  This resolves the
circularity between "container" and "log".

The "containers" library still uses the logging code, and has the
higher-level smartlist functions.
2018-06-26 12:13:23 -04:00
Nick Mathewson
79f73ab330 Finally extract the log library and make it build.
This patch:
  - introduces an fdio module for low-level fd functions that don't
    need to log.
  - moves the responsibility for opening files outside of torlog.c,
    so it won't need to call tor_open_cloexec.
2018-06-22 11:40:20 -04:00
Nick Mathewson
97b15a1d7c Extract the locking and logging code
The locking code gets its own module, since it's more fundamental
than the higher-level locking code.

Extracting the logging code was the whole point here. :)
2018-06-22 10:31:51 -04:00
Nick Mathewson
2cf033f238 Extract simple integer math into its own module 2018-06-22 09:49:13 -04:00
Nick Mathewson
1abadee3fd Extract key string manipulation functions into a new library. 2018-06-22 09:49:13 -04:00
Nick Mathewson
9426751b72 Extract our code for answering "what time is it right now".
The other time stuff is higher-level
2018-06-22 09:49:13 -04:00
Nick Mathewson
77dff00b18 Refactor container into a library. 2018-06-22 09:49:13 -04:00
Nick Mathewson
e066966bf4 Extract tor_malloc and friends to a new module. 2018-06-21 15:20:01 -04:00
Nick Mathewson
7f2dbbe585 Make sure check-spaces applies in lib and dirauth. 2018-06-21 14:22:15 -04:00
Nick Mathewson
946428d273 Run checkIncludes.py from "make check-includes" 2018-06-21 14:20:43 -04:00
Nick Mathewson
25ccfff86a Split crypto and tls libraries into directories
I am calling the crypto library "crypt_ops", since I want
higher-level crypto things to be separated from lower-level ones.
This library will hold only the low-level ones, once we have it
refactored.
2018-06-21 13:14:14 -04:00
Nick Mathewson
4bdda6d05f Move trace into its own library in libs.
Apparently it has no testing variant.
2018-06-21 13:14:14 -04:00
Nick Mathewson
2d20cbf837 Extract compression functions into a new library. 2018-06-21 13:08:25 -04:00
Nick Mathewson
ad7776f66d Rename libtor.a to libtor-app.a 2018-06-21 11:03:39 -04:00
Nick Mathewson
a403ee6bb3 Move consttime library code into its own directory. 2018-06-21 11:03:39 -04:00
Nick Mathewson
2cfcb7b364 Extract error functionality into a new lowest-level library. 2018-06-21 10:47:11 -04:00
Nick Mathewson
b2346b1201 Refactor makefiles to keep list of internal libraries in one place.
This change makes it possible for us to change the list of libraries
more easily, without changing every single linker line.
2018-06-21 10:35:30 -04:00
Nick Mathewson
0dab29ce10 Run rectify_include_paths.py 2018-06-20 09:35:05 -04:00
Nick Mathewson
257b280776 Simplify AM_CPPFLAGS include setup
We had accumulated a bunch of cruft here.  Now let's only include
src and src/ext.  (exception: src/trunnel is autogenerated code, and
need to include src/trunnel.)

This commit will break the build hard.  The next commit will fix it.
2018-06-20 09:27:04 -04:00
Nick Mathewson
fb0019daf9 Update copyrights to 2018. 2018-06-20 08:13:28 -04:00
Isis Lovecruft
5f3a4e14e3
build: Add make clippy option for Rust linting.
Note that clippy is quite loud/obnoxious, as its name would imply.
This target isn't meant to run on CI, or even necessarily exit
cleanly.  It's merely a way for developers to check if they've made
any glaring mistakes, or done awkward things they might not have
otherwise realised.  We *can* configure it to be quieter in the
future, but it's probably not worth rabbitholing on.

 * CLOSES #22156: https://bugs.torproject.org/22156
2018-06-11 19:16:56 +00:00
Nick Mathewson
f7949a440f Add a CONTRIBUTING file
This file contains pointers to other important top-level resources,
and some info about acceptable licenses.  Also, add that info to
CodingStandards.md
2018-05-11 13:19:37 -04:00
Nick Mathewson
be5b4415c2 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-05-03 13:38:54 -04:00
Nick Mathewson
7f629f7fd9 Merge branch 'maint-0.3.3' 2018-05-03 13:38:54 -04:00
David Goulet
43bba89656 build: Always compile module support for tests
The --disable-module-* configure option removes code from the final binary but
we still build the unit tests with the disable module(s) so we can actually
test that code path all the time and not forget about it.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01 10:07:09 -04:00
Taylor Yu
f0dc6c8e2a Merge branch 'bug25936-032' into bug25936-033 2018-04-26 16:07:56 -05:00
Taylor Yu
2edc9cd484 Merge branch 'bug25936-031' into bug25936-032 2018-04-26 15:58:39 -05:00
Taylor Yu
5982105098 Merge branch 'bug25936-029' into bug25936-031 2018-04-26 15:46:57 -05:00
Taylor Yu
31865b5029 Show test-suite.log for distcheck on Travis CI
When Travis CI runs make distcheck, test-suite.log doesn't exist in
the expected place.  Add a new make target to show this file and use
it when DISTCHECK=yes in .travis.yml.  Fixes bug 25814; bug not in any
released Tor.
2018-04-26 15:35:47 -05:00
Deepesh Pathak
72bfcb37f1 add changes file and update check-typos in makefile 2018-04-22 20:48:48 -04:00
Deepesh Pathak
48092540d0 Add spell check to makefile to check for typos ticket#25024
- Use misspell to check for typos in codebase
- Add `make check-typos` to run the checks
- Add `check-typos` to `make check`
2018-04-22 20:48:44 -04:00
Isis Lovecruft
af3e5bed10
build: Fix Makefile.am TOR_RUST_STATIC_NAME variable name after revert.
* FIXES #25341: https://bugs.torproject.org/25341
2018-02-24 02:17:36 +00:00
Isis Lovecruft
a9733a32d3
build: Revert "Use -lresolv in LIBS with rust on OSX."
This reverts commit 2ac9734bd2.

 * FIXES #25341: https://bugs.torproject.org/25341

Signed-off-by: Isis Lovecruft <isis@torproject.org>
2018-02-24 02:16:28 +00:00
Nick Mathewson
f470756cf4 Merge branch 'maint-0.3.2' 2018-01-16 13:36:48 -05:00
Nick Mathewson
2ac9734bd2 Use -lresolv in LIBS with rust on OSX.
This fixes issue #24652, and is a workaround for Rust issue
https://github.com/rust-lang/rust/issues/46797 .
2018-01-04 14:02:24 -05:00
Nick Mathewson
5051cfe9bd Merge remote-tracking branch 'ffmancera/github/bug24677' 2018-01-02 09:37:23 -05:00
Fernando Fernandez Mancera
3871c102a6 Use ping -6 ::1 on Linux when ping6 ::1 fails on tests.
Tor test now checks if "ping -6 -c 1 -W 1 ::1" works when "ping6 -c 1 -W 1 ::1"
fails on tests.

Fixes #24677; bugfix in 0.2.9.3-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-02 15:18:36 +01:00
Nick Mathewson
3a364529a4 Make distcleancheck pass with --enable-rust 2017-10-27 12:35:13 -04:00
Chelsea Holland Komlo
0c4d535972 refactor build infrastructure for single rust binary 2017-10-27 10:02:08 -04:00
Chelsea Holland Komlo
be583a34a3 use tor allocator for string allocation in rust 2017-10-27 10:02:08 -04:00
Chelsea Holland Komlo
d1820c1516 rust implementation of protover 2017-10-27 10:02:08 -04:00
Nick Mathewson
9af06bdd1e Whoops; only run lintchanges when usepython 2017-09-21 17:32:17 -04:00
Nick Mathewson
3c04c8317f Make check-spaces part of the standard "make check" process
To do this, we had to make sure it passes when the changes directory
is empty.  I also tried to improve the quality of the output, and
fix some false-positive cases.  Let's see how this goes!

Closes ticket 23564.
2017-09-21 16:25:24 -04:00
Nick Mathewson
283be00b0b Add support for running "calltool" on Tor via "make callgraph".
Closes #19307.
2017-09-07 10:51:02 -04:00
Ties Stuij
2e99f839e9 22839: Build tor with rust enabled on win
- make tor_util static library name configurable
- fix Rust libary dependency order for Windows
2017-08-21 15:08:24 -04:00
Sebastian Hahn
70c067102b Allow Rust build using locally supplied crates or crates.io
This adds a couple of configure commands to control whether we're
requiring all dependencies to be available locally (default) or not
(--enable-cargo-online-mode). When building from a tarball, we require
the RUST_DEPENDENCIES variable to point to the local repository of
crates. This also adds src/ext/rust as a git submodule that contains
such a local repository for easy setup.
2017-05-19 08:47:11 -04:00
Sebastian Hahn
f8ef7c65d1 Add some Rust utility functions and print support
This gives an indication in the log that Tor was built with Rust
support, as well as laying some groundwork for further string-returning
APIs to be converted to Rust
2017-05-19 08:47:10 -04:00
Sebastian Hahn
915fa39d0f Add --enable-rust configure switch
Introduce a way to optionally enable Rust integration for our builds. No
actual Rust code is added yet and specifying the flag has no effect
other than failing the build if rustc and cargo are unavailable.
2017-04-29 08:55:57 +02:00
Alexander Færøy
ce1feae9d9 Add --enable-zstd to our configure script.
This patch adds support for enabling support for Zstandard to our configure
script. By default, the --enable-zstd option is set to "auto" which means if
libzstd is available we'll build Tor with Zstandard support.

See: https://bugs.torproject.org/21662
2017-04-25 08:10:09 -04:00
Alexander Færøy
157af1d26e Add --enable-lzma to our configure script.
This patch adds support for enabling support for LZMA to our configure
script. By default, the --enable-lzma option is set to "auto" which
means if liblzma is available we'll build Tor with LZMA support.

See: https://bugs.torproject.org/21662
2017-04-25 08:06:02 -04:00
Nick Mathewson
7505f452c8 Run the copyright update script. 2017-03-15 16:13:17 -04:00
teor
a3bec9aa5a
Remove a spurious test-network-all warning that triggers when sh is not bash
Part of 21581.
2017-03-01 11:54:31 +11:00
teor
fb32c52232
Log tor warnings during 'make test-network-all'
Requires the chutney changes from 21572.
(Otherwise, asks users to upgrade their chutney.)

Implements 21570.
2017-02-28 02:01:37 +11:00
Nick Mathewson
1b244a64e4 libfuzzer tweaks per recommendations 2017-01-30 08:37:25 -05:00
Nick Mathewson
eb414a08a9 Add libfuzzer support. 2017-01-30 08:37:25 -05:00
Nick Mathewson
301eff0e90 fuzzing: Add copyright notices and whitespace fixes 2017-01-30 08:37:24 -05:00
Nick Mathewson
b96c70d668 Fuzzing: Add an initial fuzzing tool, for descriptors.
This will need some refactoring and mocking.
2016-12-19 15:34:55 -05:00
Nick Mathewson
1c5f2ee7c0 Add checkSpace to dist 2016-12-19 13:03:39 -05:00
cypherpunks
d2a091f3a2 Run check-spaces when using make check 2016-12-16 10:52:15 -05:00
cypherpunks
032da29d28 Run check-spaces only when Perl is available
Also permit users to override the Perl variable with relative paths.
2016-12-16 10:52:15 -05:00
Nick Mathewson
a49fb1e2e5 Teach 'make tags' about MOCK_IMPL.
Patch from nherring; closes ticket 16869
2016-10-03 13:58:09 -04:00
teor
b822c5891a
Fix the test network IPv6 check so it works on Linux 2016-08-31 15:22:34 +10:00
cypherpunks
3ac434104a Fix test-network-all target in out-of-tree builds
The test-network-all target assumes the test-driver script lives in the
current working directory. This assumption breaks out-of-tree builds
because it actually lives in the source directory.

Automake 1.12 introduces `LOG_DRIVER` which defines the location of the
test driver script. Because Tor still supports Automake 1.11 we use the
default value of this variable directly. The default value uses the
configured shell for calling the test driver script and explicitly
prefixes the source directory.
2016-07-08 10:19:18 -04:00
Sebastian Hahn
265e40b481 Raise libevent dependency to 2.0.10-stable or newer
Only some very ancient distributions don't ship with Libevent 2 anymore,
even the oldest supported Ubuntu LTS version has it. This allows us to
get rid of a lot of compat code.
2016-07-04 12:40:09 +02:00
Nick Mathewson
607a9056d4 Merge branch 'ftrapv_v3'
There were some conflicts here, and some breakage to fix concerning
library link order in newer targets.
2016-05-12 13:00:45 -04:00
Nick Mathewson
ce854a8d22 Add -ftrapv to gcc-hardening ... mostly!
We know there are overflows in curve25519-donna-c32, so we'll have
to have that one be fwrapv.

Only apply the asan, ubsan, and trapv options to the code that does
not need to run in constant time.  Those options introduce branches
to the code they instrument.

(These introduced branches should never actually be taken, so it
might _still_ be constant time after all, but branch predictors are
complicated enough that I'm not really confident here. Let's aim for
safety.)

Closes 17983.
2016-05-12 11:21:28 -04:00
Nick Mathewson
2c15a06597 Merge branch 'maint-0.2.8' 2016-05-09 18:14:54 -04:00
Nick Mathewson
5cd5979132 Merge branch 'maint-0.2.7' into maint-0.2.8 2016-05-09 18:14:44 -04:00
Nick Mathewson
85c698da72 Add "-c 1" to ping6 in test-network-all
Fixes bug 19008. bugfix on 0.2.7.3-rc
2016-05-09 18:12:59 -04:00
Nick Mathewson
a57ed38a8e Clean up TEST_TOR_BINARY so test-stem can have better dependencies
Fix #18240.  This version of the bug first appeared in
0.2.8.2-alpha.  0.2.8.1-alpha and earlier had a different bug.

Based on a patch from cypherpunks.
2016-05-02 13:53:16 -04:00
cypherpunks
25fa21802f Move Automake options to configure.ac
This will centralize the version configuration in one file to simplify
future changes.

Also fixes some typos in the Automake options comments.
2016-03-11 10:08:53 -05:00
Nick Mathewson
040ec4d034 Repare dependency in "make test-stem". 2016-02-24 15:49:55 -05:00
Nick Mathewson
31c7a65d89 Document required autotools versions
CentOS 6 is roughly the oldest thing we care about developers still
using, and it has autoconf 2.63 / automake 1.11.  These are both
older than openssl 1.0.0, so anybody who can't upgrade past those
probably can't upgrade to a modern openssl either.  And since only
people building from git or editing configure.ac/Makefile.am need to
use autotools, I'm not totally enthused about keeping support for
old ones anyway.

Closes ticket 17732.
2016-02-23 11:08:04 -05:00