Nick Mathewson
fa63f991c0
Stop accessing 'ssl->s3->flags' when we are using openssl 1.1
...
This field was only needed to work with the now-long-gone (I hope,
except for some horrible apples) openssl 0.9.8l; if your headers say
you have openssl 1.1, you won't even need it.
2015-05-13 11:19:19 -04:00
Yawning Angel
53a347592a
ERR_remove_state() is deprecated since OpenSSL 1.0.0.
...
OpenSSL 1.1.0 must be built with "enable-deprecated", and compiled with
`OPENSSL_USE_DEPRECATED` for this to work, so instead, use the newer
routine as appropriate.
2015-05-13 11:13:07 -04:00
Nick Mathewson
e086db7952
Merge branch 'writing_tests'
2015-05-07 15:29:56 -04:00
Nick Mathewson
79e85313aa
Write the outlines of a WritingTests.txt document
...
Also, add some sample tests to be examples.
2015-05-07 15:29:16 -04:00
Yawning Angel
915c7438a7
Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.
...
These commands allow for the creation and management of ephemeral
Onion ("Hidden") services that are either bound to the lifetime of
the originating control connection, or optionally the lifetime of
the tor instance.
Implements #6411 .
2015-04-28 10:19:08 -04:00
Nick Mathewson
9a81ed1d23
Fix some RNG function issues
2015-04-23 11:13:51 -04:00
Nick Mathewson
c366e1fa32
Merge remote-tracking branch 'public/remove_old_libevent_autoconf_stuff'
2015-04-23 10:27:01 -04:00
Nick Mathewson
c3894473fe
whitespace fixes
2015-04-23 09:36:43 -04:00
Nick Mathewson
241e6b0937
Fix some conversion problems
2015-04-23 09:16:42 -04:00
Nick Mathewson
647b7d37c2
Merge remote-tracking branch 'public/bug15745_027_03'
2015-04-23 09:10:35 -04:00
Nick Mathewson
3acee61422
Merge branch 'feature15652_squashed'
2015-04-23 09:09:33 -04:00
Nick Mathewson
55118d90ca
Fix some implicit conversion warnings
2015-04-23 09:09:20 -04:00
Yawning Angel
196499da73
Use a custom Base64 encoder with more control over the output format.
2015-04-23 09:06:58 -04:00
Nick Mathewson
6bf31543dc
Make the crypto_rand_int_range return value right-exclusive.
2015-04-21 11:30:21 -04:00
David Goulet
3f41318472
Add crypto_rand_int_range() and use it
...
Incidently, this fixes a bug where the maximum value was never used when
only using crypto_rand_int(). For instance this example below in
rendservice.c never gets to INTRO_POINT_LIFETIME_MAX_SECONDS.
int intro_point_lifetime_seconds =
INTRO_POINT_LIFETIME_MIN_SECONDS +
crypto_rand_int(INTRO_POINT_LIFETIME_MAX_SECONDS -
INTRO_POINT_LIFETIME_MIN_SECONDS);
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21 11:06:12 -04:00
teor
af2b6bdaba
Fix spaces in crypto.h and test-memwipe.c
2015-04-15 19:42:41 +10:00
Yawning Angel
ba2485f7df
Remove USE_OPENSSL_BASE64
and the associated code.
...
The alternative has been available since 2007, there's no way to
actually enable the ifdef, and it breaks on well formed but not OpenSSL
style inputs.
2015-04-10 09:12:47 +00:00
Yawning Angel
38c8e0bfc5
Fix the windows test failure caused by the #15435 changes.
2015-04-02 03:25:51 +00:00
Nick Mathewson
d366c3354f
Merge branch 'remove_digests'
2015-04-01 13:53:03 -04:00
Nick Mathewson
cd8f13b5cb
Merge branch 'bug13736'
2015-04-01 13:46:50 -04:00
Nick Mathewson
baf24bf4d1
Unindent a block in crypto_set_tls_dh_prime
2015-04-01 13:40:37 -04:00
Nick Mathewson
aa7b792250
Merge remote-tracking branch 'yawning/feature15435'
2015-04-01 13:34:14 -04:00
Nick Mathewson
0ddd8f06a9
Merge remote-tracking branch 'yawning/feature15471'
2015-04-01 12:47:16 -04:00
Nick Mathewson
c66dd17980
Drop support for --digests
...
This is a fair amount of maintainance burden, and doesn't help much
more than the git microversion.
Closes ticket 14742.
2015-04-01 09:54:20 -04:00
Nick Mathewson
30e933b136
Merge branch 'ticket14710_squashed'
2015-03-31 14:37:09 -04:00
rl1987
a4f89e21a6
Whitebox test for get_interface_address6_via_udp_socket_hack().
...
Also, fix some whitespace mishaps.
2015-03-31 14:37:02 -04:00
rl1987
92fc728d83
Bugfix: we don't want loopback/multicastaddress from _hack().
2015-03-31 14:37:02 -04:00
rl1987
a13f944314
Black box test for get_interface_address6_via_udp_socket_hack().
2015-03-31 14:36:35 -04:00
rl1987
6888523d73
Moving the hacky part of get_interface_address6() into separate function.
2015-03-31 14:36:28 -04:00
Yawning Angel
fa81508eb2
Use prctl() to have the kernel SIGTERM background processes on exit.
...
This uses a Linux-ism to attempt to always clean up background processes
if possible. Note that it is not a catch-all, in that executables with
suid/sgid or elevated capabilities will have the prctl() attribute
stripped as part of the execve().
Resolves ticket 15471.
2015-03-26 14:56:14 +00:00
Yawning Angel
fda61e030e
Implement "TOR_PT_EXIT_ON_STDIN_CLOSE".
...
Background processes spawned by Tor now will have a valid stdin.
Pluggable transports can detect this behavior with the aformentioned
enviornment variable, and exit if stdin ever gets closed.
2015-03-26 12:55:12 +00:00
Nick Mathewson
9e80fc8171
Merge remote-tracking branch 'sebastian/coverage_builds'
2015-03-24 15:16:49 -04:00
Nick Mathewson
25c3ff4500
Merge remote-tracking branch 'public/bug15269'
2015-03-24 14:59:09 -04:00
Sebastian Hahn
1228dd293b
Disable assertions during coverage builds
...
This removes roughly 5000 branches in my testing. We never want to
trigger assertions even during tests, so this is sane. Implements #15400 .
2015-03-21 02:34:44 +01:00
Sebastian Hahn
348f2744cf
Initialize two variables
...
This is a trivial change to get around two compiler warnings when
assertions are removed during coverage builds.
2015-03-21 02:00:17 +01:00
Nick Mathewson
54d6e5e71e
Merge remote-tracking branch 'public/feature15053'
2015-03-18 14:27:00 -04:00
Nick Mathewson
e75e0c7278
Make log.o depend on micro-revision.i
...
Otherwise micro-revision.i might not get built on time.
2015-03-15 17:09:58 -04:00
Nick Mathewson
7bed9dc73a
Avoid double-parens in log_fn() messages on clang.
...
On clang (and elsewhere?) __PRETTY_FUNCTION__ includes parenthesized
argument lists. This is clever, but it makes our old "%s(): " format
look funny.
This is a fix on 0957ffeb
, aka svn:r288. Fixes bug 15269.
2015-03-14 14:12:03 -04:00
Nick Mathewson
feca329031
Log version when LD_BUG is logged.
...
Closes ticket 15026.
2015-03-14 13:50:23 -04:00
cypherpunks
ce9bd4e04c
Do not distribute common_sha1.i and or_sha1.i.
...
These files get generated automatically so there is need to include them in the
distribution.
2015-03-14 13:00:06 -04:00
cypherpunks
5176f6f103
Remove relative paths to header files.
...
The paths are already in the directory search path of the compiler therefore no
need to include them in the source code.
2015-03-14 13:00:05 -04:00
cypherpunks
7a86d53dee
Clean up generated files.
...
Remove src/or/or_sha1.i and src/common/common_sha1.i on `make clean` and remove
the temporary micro-revision file when its no longer needed.
Additional changes;
- show a message when generating the micro-revision file.
- add the temporary micro revision file to the list of files to be removed on
`make clean` just in case.
- fix indentation of the make rule to improve readability.
2015-03-14 13:00:04 -04:00
Nick Mathewson
511ca9b91c
Remove DynamicDHGroups as obsoleted by PluggableTransports or P256.
...
Closes ticket 13736.
2015-03-14 12:40:55 -04:00
Nick Mathewson
3a68f2f54e
const-ify the new failure vars, and one old one
2015-03-13 09:41:49 -04:00
Nick Mathewson
517e0f965b
Remove workarounds for Libevent < 1.3.
...
This actually lets us dump a lot of old cruft that nobody had (I
hope!) tested in ages.
Closes 15248.
2015-03-12 16:59:05 -04:00
Sebastian Hahn
68e9f364a0
don't init threads as side effect of assertion
...
Fixes part of bug 15211.
2015-03-12 17:52:37 +01:00
Nick Mathewson
2bfdfc849b
Merge remote-tracking branch 'origin/maint-0.2.6'
2015-03-12 10:06:10 -04:00
Nick Mathewson
192ed94410
Use PTHREAD_CREATE_DETACHED macro instead of 1: fix Solaris crash
...
When calling pthread_attr_setdetachstate, we were using 1 as the
argument. But the pthreads documentation says that you have to say
PTHREAD_CREATE_DETACH, which on Solaris is apparently 0x40. Calling
pthread_attr_setdetachstate with 1 crashes on Solaris with FLTBOUNDS.
(Because we're so late in the release cycle, I made the code define
PTHREAD_CREATE_DETACHED if it doesn't exist, so we aren't likely to
break any other platforms.)
This bug was introduced when we made threading mandatory in
0.2.6.1-alpha; previously, we had force-disabled threading on
Solaris. See #9495 discussion.
2015-03-12 10:03:02 -04:00
Nick Mathewson
985687bc4f
Fix check-spaces
2015-03-10 10:10:35 -04:00
Nick Mathewson
e732ec295d
Merge commit 'origin/maint-0.2.6^'
2015-03-10 08:36:53 -04:00
Nick Mathewson
1af67d7f72
Merge remote-tracking branch 'public/bug15205_025' into maint-0.2.6
2015-03-09 19:47:12 -04:00
Nick Mathewson
24c031b1a2
Don't use checked strl{cat,cpy} on OSX.
...
There is a bug in the overlap-checking in strlcat that can crash Tor
servers. Fixes bug 15205; this is an OSX bug, not a Tor bug.
2015-03-09 15:09:49 -04:00
Nick Mathewson
4ced3b59aa
Merge remote-tracking branch 'origin/maint-0.2.6'
2015-03-04 15:19:43 +01:00
Nick Mathewson
de2c5ad815
Revert "Missing dependencies; fixes 15127."
...
This reverts commit 930ab95e1f
.
2015-03-04 15:18:33 +01:00
Nick Mathewson
55e1fe874d
Merge remote-tracking branch 'origin/maint-0.2.6'
2015-03-04 12:20:01 +01:00
Nick Mathewson
c5c4ea2db0
Merge remote-tracking branch 'public/bug15088_025' into maint-0.2.6
2015-03-04 12:19:28 +01:00
Nick Mathewson
d5b2cbea10
Add wait4 to the seccomp2 sandbox allowable syscall list
...
fixes bug 15088. patch from sanic.
2015-03-04 12:18:10 +01:00
Nick Mathewson
6a8550fa3c
Merge remote-tracking branch 'origin/maint-0.2.6'
2015-03-04 12:15:10 +01:00
Nick Mathewson
5ad47aafab
Merge remote-tracking branch 'public/bug15127_025' into maint-0.2.6
2015-03-04 12:14:17 +01:00
Nick Mathewson
930ab95e1f
Missing dependencies; fixes 15127.
2015-03-04 12:09:33 +01:00
Andrea Shepard
d97f43dc8b
Fix formatting
2015-03-02 10:24:58 +00:00
Nick Mathewson
0dde4d6fa2
Merge remote-tracking branch 'yawning/bug14922'
2015-02-25 08:56:34 -05:00
Nick Mathewson
a9720b90f8
Fix whitespace from tor_x509_cert rename
2015-02-24 12:03:11 -05:00
Nick Mathewson
f253aef14f
Mechanical rename: tor_cert_t -> tor_x509_cert_t
2015-02-24 12:03:10 -05:00
Nick Mathewson
d74a78c58a
Merge branch 'bug14950_logs_squashed'
2015-02-23 13:04:03 -05:00
Nick Mathewson
21ac0cd2af
Let AF_UNIX connections through the sandbox
...
Fixes bug 15003; bugfix on 0.2.6.3-alpha.
2015-02-23 12:35:20 -05:00
Nick Mathewson
7a1a0a4cd7
Merge remote-tracking branch 'public/bug14988_025'
2015-02-23 11:33:07 -05:00
Nick Mathewson
aeb38bbdce
add another unused-var marker in backtrace.c for 14988
2015-02-23 11:32:04 -05:00
Nick Mathewson
8a9d86bf05
Merge remote-tracking branch 'public/bug11454_11457'
2015-02-20 01:08:12 -05:00
Nick Mathewson
251f6cfcd8
Quiet "caching debian-tor for debian-tor" notice
2015-02-19 12:30:34 -05:00
Yawning Angel
cbd26157c5
Remove tor_strclear(), and replace previous calls with memwipe().
2015-02-17 18:53:33 +00:00
Nick Mathewson
0b46b08225
Check thread count for negative; realloc->reallocarray
...
CID 1268069
2015-02-17 08:46:11 -05:00
Nick Mathewson
5d2a23397a
Fix a few coverity "Use after NULL check" warnings
...
Also remove the unit test mocks that allowed get_options() to be
NULL; that's an invariant violation for get_options().
2015-02-16 15:40:15 -05:00
Nick Mathewson
7117959199
Fix deadcode warning in get_interface_addresses_raw().
...
CID 1268070
2015-02-16 15:28:36 -05:00
Nick Mathewson
2af7bc5b46
Fix a trivial double-close in address.c. CID 1268071
2015-02-16 15:24:13 -05:00
Sebastian Hahn
424edd5710
Don't leak a cond var when starting threads in a pool
2015-02-15 11:21:54 +01:00
Nick Mathewson
5644d92dd7
Merge remote-tracking branch 'sebastian/bug14875'
2015-02-12 14:50:13 -05:00
Sebastian Hahn
c8ce973dc7
Avoid undefined behaviour in ifreq_to_smartlist
...
This could trigger where _SIZEOF_ADDR_IFREQ() might not return a
multiple of sizeof(void *). Fixes bug 14875; not in any released version
of Tor.
2015-02-12 14:56:47 +01:00
Sebastian Hahn
87a95b0236
Actually get all interface addresses
...
If we guessed a buffer size too small, we never increased the buffer and
tried again
Also simplify the interface of ifreq_to_smartlist a little
2015-02-12 14:54:39 +01:00
Nick Mathewson
99e915dbfe
Merge remote-tracking branch 'public/bug14759'
2015-02-11 15:15:24 -05:00
Nick Mathewson
f5f6d13e4c
Fix crash on glibc __libc_message()
...
__libc_message() tries to open /dev/tty with O_RDWR, but the sandbox
catches that and calls it a crash. Instead, I'm making the sandbox
setenv LIBC_FATAL_STDERR_, so that glibc uses stderr instead.
Fix for 14759, bugfix on 0.2.5.1-alpha
2015-02-11 09:46:29 -05:00
Nick Mathewson
6f331645c7
Remove mempools and buf freelists
...
They have been off-by-default since 0.2.5 and nobody has complained. :)
Also remove the buf_shrink() function, which hasn't done anything
since we first stopped using contiguous memory to store buffers.
Closes ticket 14848.
2015-02-11 09:03:50 -05:00
Nick Mathewson
5c820def99
Merge remote-tracking branch 'sysrqb/bug14802_025'
2015-02-09 22:39:55 -08:00
Matthew Finkel
9ae321db66
Return 0 when detecting the amount of memory fails
...
Fixes bug 14802; bugfix on 0.2.5.4-alpha.
2015-02-09 02:06:18 +00:00
Sebastian Hahn
6d8b614729
Avoid logging startup messages twice
2015-02-06 21:34:21 +01:00
Nick Mathewson
3f993dacc1
use ARRAY_LENGTH macro in domain_to_string
2015-02-05 11:01:13 -05:00
Yawning Angel
b330bdec8e
Add a string representation for LD_SCHED, and a extra sanity check.
...
This both fixes the problem, and ensures that forgetting to update
domain_list in the future will trigger the bug codepath instead of
a NULL pointer deref.
2015-02-05 15:46:27 +00:00
Nick Mathewson
5c807f30e4
Add more parenthesis to the definition of ARRAY_LENGTH
2015-02-02 14:14:35 -05:00
Nick Mathewson
69deab8b2a
Merge remote-tracking branch 'public/bug13319'
2015-02-02 10:25:25 -05:00
Nick Mathewson
e78b7e2776
Merge remote-tracking branch 'public/14188_part1'
2015-02-02 10:15:26 -05:00
David Goulet
2c41f12048
Fix: check r < 0 before checking errno
...
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-30 15:18:40 -05:00
David Goulet
51f793e37e
Fix possible infinite loop on pipe/sock_drain()
...
If the returned value of read/recv is 0 (meaning EOF), we'll end up in an
infinite loop (active wait) until something is written on the pipe which is
not really what we want here especially because those functions are called
from the main thread.
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-30 15:05:18 -05:00
Nick Mathewson
fac8d40886
Merge remote-tracking branch 'public/prop227_v2'
...
Conflicts:
src/test/test_dir.c
2015-01-30 07:36:55 -05:00
Arthur Edelstein
cb714d896c
Bug #8405 : Report SOCKS username/password in CIRC status events
...
Introduces two new circuit status name-value parameters: SOCKS_USERNAME
and SOCKS_PASSWORD. Values are enclosing in quotes and unusual characters
are escaped.
Example:
650 CIRC 5 EXTENDED [...] SOCKS_USERNAME="my_username" SOCKS_PASSWORD="my_password"
2015-01-28 12:02:15 -05:00
Nick Mathewson
e9caa8645e
Try to work around changes in openssl 1.1.0
...
Prefer not to use a couple of deprecated functions; include more
headers in tortls.c
This is part of ticket 14188.
2015-01-28 10:00:58 -05:00
Nick Mathewson
420037dcef
Merge branch 'if_addr_refactoring_squashed'
...
Conflicts:
src/test/include.am
src/test/test.c
2015-01-23 10:13:37 -05:00
rl1987
3966145dff
Refactor code that looks up addresses from interfaces
...
Now the code has separate implementation and examination functions,
uses smartlists sanely, and has relatively decent test coverage.
2015-01-23 10:07:17 -05:00
Nick Mathewson
4a6b43bf76
fix some warnings in compat_threads.c
2015-01-22 14:22:39 -05:00
Nick Mathewson
1fb9979eb8
Move a redundant _GNU_SOURCE to where it is not redundant
2015-01-22 14:18:10 -05:00
Nick Mathewson
38b3f9a619
use the correct free fn. spotted by dgoulet
2015-01-21 14:54:38 -05:00