Steven Murdoch
d5127ebdd8
Fix connecting the stdin of tor-fw-helper to /dev/null
...
This wasn't working due to the parameters of dup2 being in the wrong order.
As a result, tor-fw-helper was inheriting the stdin of Tor.
2010-12-01 12:22:21 -05:00
Nick Mathewson
9908404f01
Merge remote branch 'sjmurdoch/cloexec'
2010-12-01 11:42:34 -05:00
Steven Murdoch
a961521a86
Check that FD_CLOEXEC is set before using it
...
I don't know if any platforms we care about don't have FD_CLOEXEC,
but this is what we do elsewhere
2010-12-01 15:43:17 +00:00
Steven Murdoch
786abbd54c
Open log files with CLOEXEC flag set
2010-12-01 15:38:18 +00:00
Nick Mathewson
3ed7505dc5
Merge remote branch 'origin/maint-0.2.2'
...
Conflicts:
src/or/relay.c
2010-11-30 19:23:40 -05:00
Nick Mathewson
89e97bdf94
Add wrappers function for libc random()
...
On windows, it's called something different.
2010-11-29 16:00:47 -05:00
Nick Mathewson
cbd3745924
Merge remote branch 'origin/maint-0.2.2'
2010-11-21 14:34:22 -05:00
Nick Mathewson
2bd64f9e8f
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2
2010-11-21 14:33:11 -05:00
Steven Murdoch
15f2b7859b
Don't both open the socket with SOCK_CLOEXEC and set FD_CLOEXEC
2010-11-21 15:40:17 +00:00
Nick Mathewson
92a99736fd
Do not set the hostname TLS extension server-side; only client-side
...
This may fix bug 2204, and resolve the incompatibility with openssl
0.9.8p/1.0.0b.
2010-11-20 22:21:50 -05:00
Steven Murdoch
9d63dfcf49
Fix compile error on MacOS X (and other platforms without O_CLOEXEC)
2010-11-20 13:50:55 +00:00
Nick Mathewson
b4f56dd4c6
Obviate need for doing a CLOEXEC on pipes: just close them before exec
2010-11-20 01:24:30 -05:00
Nick Mathewson
e669d25e43
Do cloexec on socketpairs and stdio files
2010-11-20 01:16:29 -05:00
Nick Mathewson
5a66de7015
Initial work to set CLOEXEC on all possible fds
...
Still to go: some pipes, all stdio files.
2010-11-20 00:58:40 -05:00
Nick Mathewson
223fc208f6
Split long lines in configure.in and Makefile.am files
...
Having very long single lines with lots and lots of things in them
tends to make files hard to diff and hard to merge. Since our tools
are one-line-at-a-time, we should try to construct lists that way too,
within reason.
This incidentally turned up a few headers in configure.in that we were
for some reason searching for twice.
2010-11-11 14:22:48 -05:00
Nick Mathewson
d238d8386f
Add a testing-only option to use bufferevent_openssl as a filter
...
We need filtering bufferevent_openssl so that we can wrap around
IOCP bufferevents on Windows. This patch adds a temporary option to
turn on filtering mode, so that we can test it out on non-IOCP
systems to make sure it hasn't got any surprising bugs.
It also fixes some allocation/teardown errors in using
bufferevent_openssl as a filter.
2010-11-09 15:36:27 -05:00
Nick Mathewson
1fb342dfab
Merge branch 'loggranularity'
2010-11-08 12:40:33 -05:00
Nick Mathewson
ccec0a1bd3
Merge remote branch 'origin/maint-0.2.2'
2010-10-26 13:59:09 -04:00
Sebastian Hahn
213139f887
Properly refcount client_identity_key
...
In a2bb0bf
we started using a separate client identity key. When we are
in "public server mode" (that means not a bridge) we will use the same
key. Reusing the key without doing the proper refcounting leads to a
segfault on cleanup during shutdown. Fix that.
Also introduce an assert that triggers if our refcount falls below 0.
That should never happen.
2010-10-26 18:22:04 +02:00
Nick Mathewson
17fdde3d92
Merge remote branch 'origin/maint-0.2.2'
...
Conflicts:
src/common/tortls.c
2010-10-21 16:23:01 -04:00
Nick Mathewson
4dbd8ba008
clarify fmt_addr32 documentation to note that the address is in host-order
2010-10-15 18:04:07 -04:00
Nick Mathewson
441d90a8f9
Fix one-time memory leak when initializing libevent. Spotted by Sebastian
2010-10-15 17:14:04 -04:00
Nick Mathewson
a7cf788740
Merge branch 'bug1992_part1'
2010-10-15 17:08:18 -04:00
Nick Mathewson
96ab83d3b6
Improve accuracy of comment about aes_crypt performance
...
The old comment was from before I tried a huge pile of crazy stuff to
make the inner loop faster. Short answer: GCC already knows how to
unroll loops pretty well. Other short answer: we should have made the
relay payload size an even multiple of 4, 8, or ideally 16.
2010-10-15 13:44:25 -04:00
Nick Mathewson
05274ba9b5
Kill comments saying to remove asserts once bug930 is solved.
...
It's okay to leave the asserts in: the code doesn't appear in profiles.
2010-10-15 13:44:25 -04:00
Nick Mathewson
04231a2ebe
Fix an apostrophe in a comment
2010-10-15 12:39:23 -04:00
Nick Mathewson
94a99ad205
Add a portable tor_timercmp
...
We can't use the platform timercmp, because
1) some platforms don't have them
2) some that do have them only support certain relational operators
2010-10-15 12:35:05 -04:00
Nick Mathewson
59cba1767c
Make the return value of tor_addr_sockaddr always be signed
2010-10-15 11:36:16 -04:00
Nick Mathewson
a5289fa794
Remove the unused old fuzzy-time code
2010-10-15 11:16:42 -04:00
Nick Mathewson
adc4f678f1
Fix an xxx wrt picking libevent methods known-to-work
...
The short version is, "where we want to do it, we have nothing real to
chose from and we can't do it easily. Where it's easy to do, we have
no reason to do it yet."
2010-10-15 10:58:16 -04:00
Sebastian Hahn
9bed40eb10
Make check-spaces happy
2010-10-14 17:54:45 +02:00
Nick Mathewson
8c837db38f
Merge branch 'nodes'
2010-10-13 16:04:25 -04:00
Nick Mathewson
fbacbf9fd9
Set OpenSSL 0.9.8l renegotiation flag early enough for bufferevents
...
This seems to fix another case of bug2001.
2010-10-12 14:52:33 -04:00
Nick Mathewson
a9172c87be
Actually call connection_tls_finish_handshake() with bufferevents
...
First start of a fix for bug2001, but my test network still isn't
working: the client and the server send each other VERSIONS cells,
but never notice that they got them.
2010-10-12 14:52:33 -04:00
Nick Mathewson
8ecb5abbe1
Add header for tor_tls_log_one_error
2010-10-11 13:26:57 -04:00
Nick Mathewson
4cfa6fbaca
Log OpenSSL errors coming from bufferevent_openssl
2010-10-11 13:25:41 -04:00
Nick Mathewson
544a8afe5a
Merge remote branch 'sjmurdoch/bug1903'
2010-10-11 11:01:15 -04:00
Nick Mathewson
8f76f31761
Make tor_sscanf handle %x
2010-10-11 10:50:47 -04:00
Steven Murdoch
8a12ce2cf9
Add a unit test for tor_spawn_background
...
- Test sucessfully starting a process
- Test failing to find the executable
2010-10-10 19:08:44 +01:00
Steven Murdoch
68e576e9f9
Update documentation for tor_spawn_background
...
- Include description of stdout_read, stderr_read, and argv
2010-10-10 19:08:44 +01:00
Steven Murdoch
23e9f362a2
Fix issues in nickm's review of log_from_pipe for bug #1903
...
- Replace sscanf with tor_sscanf
- Replace use of strstr with equivalent call to strcmpstart
2010-10-10 19:08:44 +01:00
Steven Murdoch
4d694c7890
Fix nickm's comments on logging for bug #1903
...
- Use log_warn rather than log_err for bad but survivable events
2010-10-10 19:08:44 +01:00
Steven Murdoch
708ba8899f
Note icky constructs mentioned in bug #1903
...
- To be dealt with as part of bug #2029
2010-10-10 19:07:40 +01:00
Sebastian Hahn
34546e2573
Fix a compile warning on OSX 10.6
2010-10-07 06:31:08 +02:00
Robert Ransom
17efbe031d
Maintain separate server and client TLS contexts.
...
Fixes bug #988 .
2010-10-04 21:51:47 -07:00
Robert Ransom
d3879dbd16
Refactor tor_tls_context_new:
...
* Make tor_tls_context_new internal to tortls.c, and return the new
tor_tls_context_t from it.
* Add a public tor_tls_context_init wrapper function to replace it.
2010-10-04 17:57:29 -07:00
Nick Mathewson
4c71be65d8
Merge remote branch 'origin/maint-0.2.2'
2010-10-04 13:56:17 -04:00
Robert Ransom
1b8c8059c7
Correct a bogus comment.
...
Whether or not OpenSSL reference-counts SSL_CTX objects is irrelevant;
what matters is that Tor reference-counts its wrapper objects for
SSL_CTXs.
2010-10-04 13:53:54 -04:00
Robert Ransom
c70d9d77ab
Correct a couple of log messages in tortls.c
2010-10-04 13:53:48 -04:00
Robert Ransom
068185eca2
Fix several comments in tortls.c
2010-10-04 13:47:57 -04:00